VELatLong Class
Contains the latitude and longitude of a single point on the globe.
Public Properties
Name | Description |
---|---|
Latitude | Specifies the latitude of a single point on the globe. |
Longitude | Specifies the longitude of a single point on the globe. |
Remarks
To obtain the LatLong object of a point on the current map, use the VEMap.PixelToLatLong method. To convert a LatLong object to a point on the current map, use the VEMap.LatLongToPixel method.
The following example shows how to create an array of VELatLong objects when drawing a polyline on the map.
Example
<html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="https://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js"></script> <script> var map = null; function GetMap() { map = new VEMap('myMap'); map.LoadMap(); } function DrawPoly(id,points,width,color) { poly = new VEPolyline(id,points); poly.SetWidth(width); poly.SetColor(color); map.AddPolyline(poly); map.SetMapView(points); } </script> </head> <body onload="GetMap();"> <div id='myMap' style="position:relative; width:400px; height:400px;"></div> <INPUT id="draw" type="button" value="Draw a Polygon" name="delRoute" onclick="DrawPoly( '1', [new VELatLong(46.21758,-69.08529), new VELatLong(46.21531,-69.00402), new VELatLong(46.21596,-68.82146), new VELatLong(45.85619,-68.82360), new VELatLong(45.82631,-68.82453), new VELatLong(45.82633,-68.85976), new VELatLong(45.81160,-68.85743), new VELatLong(45.81326,-68.89499), new VELatLong(45.83453,-68.94900), new VELatLong(45.85566,-68.95039), new VELatLong(45.85316,-69.07216), new VELatLong(45.93761,-69.07287), new VELatLong(45.93807,-69.08599), new VELatLong(46.01658,-69.08624), new VELatLong(46.01651,-69.06572), new VELatLong(46.03624,-69.06471), new VELatLong(46.03668,-69.08646), new VELatLong(46.21758,-69.08529)], 2, new VEColor(250,250,50,1.0) );"> <INPUT id="drawline1" type="button" value="Draw a thin blue line" name="delRoute" onclick="DrawPoly( '2', [new VELatLong(45.01188,-111.06687), new VELatLong(45.01534,-104.06324), new VELatLong(41.01929,-104.06), new VELatLong(41.003,-111.05878), new VELatLong(45.01188,-111.06687)], 1, new VEColor(0,0,255,1));"> <INPUT id="drawline2" type="button" value="Draw a thick red line" name="delRoute" onclick="DrawPoly( '3', [new VELatLong(45.01188,-111.06687), new VELatLong(45.01534,-104.06324), new VELatLong(41.01929,-104.06), new VELatLong(41.003,-111.05878), new VELatLong(45.01188,-111.06687)], 7, new VEColor(255,0,0,1));"> </body> </html>