Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
I need to convert logical screen cordinates to latitude/longitude. I have image, which is return from google static api url. the size of returned image is 512x512 and this image is placed to the WPF Image control of size 300x200. When I move with the cursor through the image, I would like to change the mouse position to the coordinatees. Can you help me how to do it?
thank you
Posted
Comments
Richard MacCutchan 30-Nov-15 12:35pm    
You need to know the coordinates of the section of map from Google. You also need to know the scale factor of pixels to latitude, and pixels to longitude.
Jurdo 30-Nov-15 12:53pm    
i read something about mercator projection. but i dont know how to transform X,Y of image control to coordinates
Richard MacCutchan 30-Nov-15 13:01pm    
I just told you how. You need to get the starting co-ordinates and the scale values from the image provider.
Jurdo 30-Nov-15 15:36pm    
How can I get starting coordinates? This is my URL: https://maps.googleapis.com/maps/api/staticmap?center=48.9533881,18.1742164&zoom=12&size=512x512 ... And when click on the image on position 423x150, i want get new Lat/Long
Richard MacCutchan 1-Dec-15 2:46am    
You need to get that information from the Google maps API, as I keep telling you. There is nothing in an image that provides this information.

1 solution

Perhaps you can take a look at Bing Maps? This provides a real map and works with real coordinates.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900