neveldo / jQuery-Mapael

jQuery plugin based on raphael.js that allows you to display dynamic vector maps
https://www.vincentbroute.fr/mapael/
MIT License
1.01k stars 195 forks source link

map does not load #289

Closed netoguitar closed 7 years ago

netoguitar commented 7 years ago

I have a svg map that I converted to .js, but it does not load the page. any ideas?

neveldo commented 7 years ago

Hello,

Could you provide a JSFiddle sample of your code that highlights the issue ?

Thanks in advance !

netoguitar commented 7 years ago

Hello, Thank you, follow the link

https://jsfiddle.net/netoguitar/4q1onqx6/

neveldo commented 7 years ago

Hello @netoguitar ,

Sorry for my late answer. First, on JSFiddle, if you want to load a resource from Github, you should use rawgit : https://rawgit.com/netoguitar/jQuery-Mapael/master/js/maps/rondonia.js , otherwise, you will get a mimetype error.

Regarding your issue, the map is loading properly, but the paths are not shown in the SVG because their coordinates are wrong. Your map size is 231X194, so all the paths should be under these dimensions. However, when I see the first path for instance, it starts at the coordinates 4624,63969. I think you have a remaining translation in your SVG file that you should remove (through Inkscape for instance). All the raw coordinates from your paths (without transforms) have to be included within the dimensions of the SVG.

Indigo744 commented 7 years ago

@netoguitar do you still need help or can we close this issue?