I am designing an application in C++ to view and edit a map of a fictional planet. How it works will be similar to Google Maps. I would like the user to be able to see their current position in latitude/longitude and world coordinates on the GUI.
How can I convert a latitude and longitude values to "world coordinates" and back, as in Google Maps? or to "pixel coordinates" and back?
To format your coordinates so they work in Google Maps, use decimal degrees in the following format: Correct: 41.40338, 2.17403. Incorrect: 41,40338, 2,17403.
I found the answer to my question. The formulas for converting between the different coordinate systems can be found in the source code of this example on the Google Maps API website: http://code.google.com/apis/maps/documentation/javascript/examples/map-coordinates.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With