Ejemplo n.º 1
0
 /// <summary>
 /// Sets center of the map to position, and zooms to zoomLevel.
 /// </summary>
 /// <param name="position">New center position.</param>
 /// <param name="zoomLevel">New zoom level.</param>
 public void SetCenterAndZoom(VELatLong position, int zoomLevel)
 {
     WebBrowser.InvokeScript(this.GetType().Name + "SetCenterAndZoom",
                             position.Latitude,
                             position.Longitude,
                             zoomLevel);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Converts a (lat,long) couple to their corresponding pixels on the map viewer.
        /// </summary>
        /// <param name="position"></param>
        /// <returns></returns>
        public VEPixel LatLongToPixel(VELatLong position)
        {
            var result = WebBrowser.InvokeScript(this.GetType().Name + "LatLongToPixel",
                                                 position.Latitude, position.Longitude);

            if (result.ToString() != String.Empty)
            {
                var results = result.ToString().Split(',');
                return(new VEPixel(Convert.ToInt32(results[0]), Convert.ToInt32(results[1])));
            }

            return(null);
        }
Ejemplo n.º 3
0
 public VEShape(VEShapeType type, VELatLong latLong)
 {
     if (type == VEShapeType.Pushpin)
     {
         this.type   = type;
         this.points = new List <VELatLong>();
         points.Add(latLong);
     }
     else
     {
         throw new Exception("This constructor only works for VEShapeType.Pushpin");
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Sets center of the map to (lat,long).
 /// </summary>
 /// <param name="position"></param>
 public void SetCenter(VELatLong position)
 {
     WebBrowser.InvokeScript(this.GetType().Name + "SetCenter", position.Latitude, position.Longitude);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Pans the map to specified (lat,lon).
 /// </summary>
 /// <param name="position"></param>
 public void PanToLatLong(VELatLong position)
 {
     WebBrowser.InvokeScript(this.GetType().Name + "PanToLatLong", position.Latitude, position.Longitude);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Sets center of the map to position, and zooms to zoomLevel.
 /// </summary>
 /// <param name="position">New center position.</param>
 /// <param name="zoomLevel">New zoom level.</param>
 public void SetCenterAndZoom(VELatLong position, int zoomLevel)
 {
     WebBrowser.InvokeScript(this.GetType().Name + "SetCenterAndZoom",
                                                                 position.Latitude,
                                                                 position.Longitude,
                                                                 zoomLevel);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Sets center of the map to (lat,long).
 /// </summary>
 /// <param name="position"></param>
 public void SetCenter(VELatLong position)
 {
     WebBrowser.InvokeScript(this.GetType().Name + "SetCenter", position.Latitude, position.Longitude);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Pans the map to specified (lat,lon).
 /// </summary>
 /// <param name="position"></param>
 public void PanToLatLong(VELatLong position)
 {
     WebBrowser.InvokeScript(this.GetType().Name + "PanToLatLong", position.Latitude, position.Longitude);
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Converts a (lat,long) couple to their corresponding pixels on the map viewer.
        /// </summary>
        /// <param name="position"></param>
        /// <returns></returns>
        public VEPixel LatLongToPixel(VELatLong position)
        {
            var result = WebBrowser.InvokeScript(this.GetType().Name + "LatLongToPixel",
                                                                position.Latitude, position.Longitude);
            if (result.ToString() != String.Empty)
            {
                var results = result.ToString().Split(',');
                return new VEPixel(Convert.ToInt32(results[0]), Convert.ToInt32(results[1]));
            }

            return null;
        }