public void PanTo(GeographicBounds bounds) { string swBounds = JsonConvert.SerializeObject(bounds.SouthWest); string neBounds = JsonConvert.SerializeObject(bounds.NorthEast); _browser.InvokeScript("panToBounds", swBounds, neBounds); }
public void FitToBounds(GeographicBounds bounds) { string jsonSouthWest = JsonConvert.SerializeObject(bounds.SouthWest); string jsonNorthEast = JsonConvert.SerializeObject(bounds.NorthEast); _browser.InvokeScript("fitBounds", jsonSouthWest, jsonNorthEast); }
private static string GetBoundsString(GeographicBounds bounds) { if (bounds != null) { return(String.Format("&bounds={0},{1}|{2},{3}", bounds.SouthWest.Latitude, bounds.SouthWest.Longitude, bounds.NorthEast.Latitude, bounds.NorthEast.Longitude)); } return(String.Empty); }
public IRectangle DrawRectangle(GeographicBounds bounds, RectangleOptions rectangleOptions, bool hideOthers = false) { string jsonSW = JsonConvert.SerializeObject(bounds.SouthWest); string jsonNE = JsonConvert.SerializeObject(bounds.NorthEast); string jsonRectangleOptions = JsonConvert.SerializeObject(rectangleOptions); int rectangleId = (int)_browser.InvokeScript("addRectangle", jsonSW, jsonNE, jsonRectangleOptions, hideOthers); _rectangles[rectangleId] = new Rectangle(_browser, rectangleId); return(_rectangles[rectangleId]); }
public IGroundOverlay AddGroundOverlay(string imageUrl, GeographicBounds bounds, GroundOverlayOptions groundOverlayOptions) { string jsonSW = JsonConvert.SerializeObject(bounds.SouthWest); string jsonNE = JsonConvert.SerializeObject(bounds.NorthEast); string jsonGroundOverlayOptions = JsonConvert.SerializeObject(groundOverlayOptions); int groundOverlayId = (int)_browser.InvokeScript("addGroundOverlay", imageUrl, jsonSW, jsonNE, jsonGroundOverlayOptions); _groundOverlays[groundOverlayId] = new GroundOverlay(_browser, groundOverlayId); return(_groundOverlays[groundOverlayId]); }
public static GeocodingResponse GetResponse(string address, string region = null, GeographicBounds bounds = null) { var url = new Uri(String.Format("{0}json?address={1}®ion={2}&sensor=false{3}", ApiUrl, Http.UrlEncoding(address), GetRegionString(region), GetBoundsString(bounds))); return(Http.Get(url).As <GeocodingResponse>()); }
public GeocodingResponse RunGeocoder(string address, string region = null, GeographicBounds bounds = null) { return(GeocodingService.GetResponse(address, region, bounds)); }