Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
viewport to window mapping
I need to draw a map .I have the latitude longitude values of it .I was able to map these to screen coordinates and then draw the map.Once the map is drawn,as the mouse moves over the map i need to show the latitude and longitude values. This is where i am struck .For the initial case its simple,just rearrangement of window to view port mapping formula .i.e.,
u = (x-xmin)* sx+ umin
v = (y-ymin)* sy + vmin
But once the zoom and pan operations are applied on the map, I dont know how to get the latitude longitude values for each screen coordinate .
If some one knows how to solve this ,Please help me
Thanks in advance