HOW TO find the latitude & longitude of any town/city using Virtual Earth Map Control 6

ko aham kuta aayaatah (Who am I? From where do I come?) - Adi Shankaracharya

Geography was my favorite subject in school. So more than a year ago when I heard of the MS Virtual Earth mapping service, I monkeyed around with it & put up a quick & dirty fun app to search for any given place in India & show it's latitude and longitude.

The interesting thing about the Virtual Earth mapping service is the low barrier of entry for developers. It works with just plain HTML & client-side Javascript. As such it can be hosted on any web server & used along with any server-side language. Unlike Google Maps which works works only for a real domain, Microsoft's Virtual Earth Map Control works locally and does not require signing up for an API key.

I was amazed recently to find that there have been more than 3 versions of the Virtual Earth Map Control since I last tried it out. The latest version Virtual Earth Map Control 6 contains a host of fantastic features. The Javascript classes & related members of the Map Control are comprehensively documented in the MSDN Help with simple & practical examples.

My biggest & most pleasant surprise was that there is now a ready made method to get the latitude, longitude pair for the point you clicked on the map irrespective of the zoom factor. With a few minor changes to the MSDN code sample for the PixelToLatLong Method, I now have a sample that gets you the latitude and longitude of any Indian town/city (that just as well works for any place in the world)

Related links:
Reverse geocoding
Winforms Earth v4

Comments

Popular posts from this blog

Datawrapper Makes Data Beautiful & Insightful

Maven Crash Course - Learn Power Query, Power Pivot & DAX in 15 Minutes

GitHub Copilot Q&A - 1