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

Maps Object does not resolve using Node #229

Closed obonyojimmy closed 7 years ago

obonyojimmy commented 8 years ago

Tried using this awesome plugin using node , however it seems like the maps object to ../js/maps/.. files does not resolve i get below error ie: using map name " france_departments " :

Uncaught TypeError: Cannot read property 'france_departments' of undefined

Kindly check

neveldo commented 8 years ago

Hello,

I haven't tried to use Mapael through node yet, have you tried by setting an absolute path maybe ? Feel free to share the answer if you find any solution !

dwhipps commented 7 years ago

I'm having the same problem, but with Require.js. Seems that no matter what I do, the /maps/.js tries to "extend" an undefined Mapael object and so $.mapael.maps is undefined when I try to use it later.

neveldo commented 7 years ago

Hello @dwhipps ,

Could you provide a code example (for instance on JSFiddle) that highlight the issue ?

I think this is the same issue that https://github.com/neveldo/jQuery-Mapael/issues/241 . It seems there is an inconsistency within the dependencies names in several places. I would be glad to have a code example in order to better fix it !

neveldo commented 7 years ago

I have fixed the issue, and it should now work fine : https://github.com/neveldo/jQuery-Mapael/commit/a83bd3a11e635ed9ffe99c070edb275f5c2cc9e4 (this fix will be included in the next release that will come very soon)