neveldo / mapael-maps

Vector maps for jQuery Mapael
MIT License
116 stars 139 forks source link

implemented getCoords for germany map #26

Closed xat closed 6 years ago

neveldo commented 7 years ago

Hi @xat ,

Happy new year and many thanks for your contribution !

However, I have checked the getCoords() function, and it seems that when I plot a city, it is displayed somewhere at south-east from the real position of the city. Maybe you have done an improved version since ?

Indigo744 commented 6 years ago

@xat any update on it?

Indigo744 commented 6 years ago

I checked, and as @neveldo said, there seems to be an issue with the computation: https://jsfiddle.net/z1o91cys/1/

See, Berlin and Zittau are not properly placed. I think there is an issue regarding the longitude computation.

Indigo744 commented 6 years ago

I recomputed the getCoords() function and I got:

            var xfactor = 64.231908437415,
              xoffset = -377.90181740496,
              x = (lon * xfactor) + xoffset,
              yfactor = -102.05323203605,
              yoffset = 5617.9125521016,
              y = (lat * yfactor) + yoffset;

See here: https://jsfiddle.net/z1o91cys/3/

If you don't have time to update your file, I'll merge and modify it directly.

neveldo commented 6 years ago

Great work @Indigo744 !