VDS Technologies

 

Map CoOrdinates

3/4/2016 4:23:03 AM
Total Posts 19

Map CoOrdinates

Hi

I need to be able to click on a map and retrieve the northing/easting coordinates, store them, then at a later time use them to zoom back to that position.

I have looked through the sample code and I cant see anything obvious, can anyone point me in the right direction?

Cheers

Dave

3/4/2016 6:19:38 AM
MVP
Total Posts 323

Re: Map CoOrdinates

Modify the AddClickEvent.aspx sample as follows:

protectedvoid map_InfoTool(object sender, InfoToolEventArgs e)

{

  double longitude = e.InfoPoint.X;

  double latitude = e.InfoPoint.Y;

  ViewState("longitude") = longitude;

  ViewState("latitude") = latitude;

  // zoom to the point later

  // map.CenterAt(new AspMap.Point((double)ViewState("longitude"), (double)ViewState("latitude")));

}

3/4/2016 7:04:45 AM
Total Posts 19

Re: Map CoOrdinates

As always - thanks for a swift reply and the info!

 

Dave

3/4/2016 10:09:20 AM
Total Posts 19

Re: Map CoOrdinates

Hi
I have just realized that you have given me C#  code, and I need code for Windows forms.
When I try to change the centerat, it says it cant change a double to a point, I am not a good enough coder to work out how to translate - any chance you could help?

Thanks

 

Dave

3/4/2016 11:26:51 AM
Total Posts 19

Re: Map CoOrdinates

Hi

OK just played about recoding and got it working

Cheers
Dave