1
votes

I have a map, which is accurate (enough) to the real world map, as viewed in google maps. I'm projecting the drawn image using the google.maps.ImageMapType class, thus the corners of the new, drawn, map are (sw)-90,-180 and (ne)90,180. Now, knowing the coordinates of the south-west and north-east of the overlay in the real-world map, how do I convert GPS coordinates to this new scale?

1
The corners of your image are clearly not (sw)-90,-180 and (ne)90,180. I told you last week, when you asked the same question, that unless you're using a custom projection, there's nothing to convert.Have you tried placing a marker within the image, (for exanmple in Paris)?Marcelo
Ok, here is the problem. I am using the drawn map as the entire map, by setting an imageMapType. This results in europe being projected as if it were the entire world ( with getBounds() showing the google maps maxima of -85.05~,85.05~,-180,180 ). Does this qualify as being it's own projection?Lg102
If that was the case, then your image would not fit on top of the normal image of Europe. Better show us your code of how you load the image.Marcelo
If it won't work it is no use. You can choose to be stubborn and not accept what I'm saying but unless you're using a custom projection there's nothing to convert.Marcelo
No, your question should be "why do my coordinates not match", and post working code that demonstrates the problem.Marcelo

1 Answers

1
votes

OK, I added a marker in "Paris" to your jsFiddle, but the marker is clearly not where it should be.

I think you might be mixing google.maps.MapType object and google.maps.ImageMapType

google.maps.ImageMapType uses a google.maps.ImageMapTypeOptions object, which should have a getTileUrl() method, but instead you have a getTile() method which is breaking the projection.