VDS Technologies

 

get location

9/21/2014 4:06:32 AM
Total Posts 8

get location

dear,

how to get coordinate from map ..

 

9/21/2014 12:41:16 PM
Total Posts 5

Re: get location

hi

 

you can use this code :

<asp:Label ID="status" runat="server" Text="Label"></asp:Label>

<script type="text/javascript">
function mouseMoveHandler(sender, e /* MouseEventArgs */) {
var label = document.getElementById("status");
if (e.isInside) {
label.innerHTML = formatCoord(e.latitude, "lat") + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + formatCoord(e.longitude, "long");
}
else
label.innerHTML = "&nbsp;";
}
function formatCoord(coord, type) {
var dec = Math.abs(coord);
var deg = Math.floor(dec);
var min = Math.floor((dec - deg) * 60);
var sec = Math.floor((dec - deg - (min / 60)) * 3600);
var suff = (coord > 0 ? "E" : "W"); if (type == "lat") suff = (coord > 0 ? "N" : "S");
return deg + "&deg; " + min + "' " + sec + '" ' + suff;
}

var map = AspMap.find('<%=Map1.ClientID%>');
map.add_mouseMove(mouseMoveHandler);

</script>

9/22/2014 3:01:33 AM
Total Posts 8

Re: get location

hi 

thers is other way 

 

9/22/2014 3:27:58 AM
Total Posts 8

Re: get location

hi 

Ineed find routing between tow points in map

please help me...

thanx.

9/22/2014 3:47:42 AM
MVP
Total Posts 323

Re: get location

Set the Map.MapTool to MapTool.Info, then add an event handler

protected void map_InfoTool(object sender, InfoToolEventArgs e)
{
      // e.InfoPoint.X - X coordinate or longitude
      // e.InfoPoint.Y - Y coordinate or latitude

     map.MapShapes.Add(e.InfoPoint, e.InfoPoint.X.ToString() + "  " + e.InfoPoint.ToString());
}

While the map is set to the Info tool, you can continue to pan the map and zoom it using the mouse wheel (or pinch zoom gestures on tablets or smartphones).

9/23/2014 3:39:00 AM
Total Posts 8

Re: get location

HI 

Can stored this coordinate in lable or text box ..

thanx  very much for you...