Exemplo n.º 1
0
        public void PanTo(GeographicBounds bounds)
        {
            string swBounds = JsonConvert.SerializeObject(bounds.SouthWest);
            string neBounds = JsonConvert.SerializeObject(bounds.NorthEast);

            _browser.InvokeScript("panToBounds", swBounds, neBounds);
        }
Exemplo n.º 2
0
        public void FitToBounds(GeographicBounds bounds)
        {
            string jsonSouthWest = JsonConvert.SerializeObject(bounds.SouthWest);
            string jsonNorthEast = JsonConvert.SerializeObject(bounds.NorthEast);

            _browser.InvokeScript("fitBounds", jsonSouthWest, jsonNorthEast);
        }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
        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]);
        }
Exemplo n.º 5
0
        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]);
        }
Exemplo n.º 6
0
        public static GeocodingResponse GetResponse(string address, string region = null, GeographicBounds bounds = null)
        {
            var url = new Uri(String.Format("{0}json?address={1}&region={2}&sensor=false{3}", ApiUrl, Http.UrlEncoding(address), GetRegionString(region), GetBoundsString(bounds)));

            return(Http.Get(url).As <GeocodingResponse>());
        }
Exemplo n.º 7
0
 public GeocodingResponse RunGeocoder(string address, string region = null, GeographicBounds bounds = null)
 {
     return(GeocodingService.GetResponse(address, region, bounds));
 }