1

I was looking around for the code that can give me the value for current location in bing map in silverlight. I have not found any codes yet. Can anyone please tell me how can I get altitude (elevation) value for current latitude and longitude. I tried to used google maps API as following so far.

string address = "http://maps.googleapis.com/maps/api/elevation/json?locations=" + lat + "," + lng + "&sensor=true";

But It does not give me proper and at a time output, because I am developing on silverlight technology. So I have to go through using Web service.

I want to implement some thing like following.

Bing

Please help me to find elevation value from lat and lang.

Thanks

1 Answers1

1

With Bing Maps API, you can use Elevation Service like described and documented on the MSDN, see the reference here:

https://msdn.microsoft.com/en-us/library/jj158961.aspx

And a sample request:

http://dev.virtualearth.net/REST/v1/Elevation/List?points=35.89431,-110.72522,35.89393,-110.72578,35.89374,-110.72606,35.89337,-110.72662&key=BingMapsKey

You can also specify the reference (Reference geoid) that will be used for the elevation, take a look at the MSDN documentation.

Nicolas Boonaert
  • 2,954
  • 1
  • 20
  • 28
  • I am developing on silverlight. web service takes some time to give response. I want it without using web service, because I need it instantly on mouse move event over the map. So as we get location on mouse move similarly I want the elevation for location pointed by mouse pointer. – WebAshlar EmailTest May 07 '15 at 06:43
  • You won't be able to do it on mousemove in an instant with the previous described method. You should consider trottling the requests and use grid request on the Elevation API (see the MSDN with the grid request), in that way, you'll be able to have a grid of point for a certain area and so you can work with those already returned points. – Nicolas Boonaert May 07 '15 at 08:48
  • Thanks for attention. I got it. Do you know any mathematical method that can help. I actually don't want to use WCF service here. – WebAshlar EmailTest May 07 '15 at 09:36
  • You will need the Elevation API to retrieve the grid with every point with information (location and elevation). Then in Silverlight, your keep your list of point information and find the closest to your mouse location (using Haversine formulat for example, see: https://megocode3.wordpress.com/2008/02/05/haversine-formula-in-c/ – Nicolas Boonaert May 07 '15 at 13:11