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

mapOptions.areas can't replace my map areas when updating it with replaceOptions = true #218

Closed eslammahgoub closed 7 years ago

eslammahgoub commented 8 years ago

I use Mapael Version: 2.0.0-dev Here my update option var newupdate = { mapOptions: { areas : {} }, replaceOptions : false, }; when I do that it not replace the areas with new one it extend with the old areas options I want to replace the map areas options with new one any help

neveldo commented 8 years ago

Hello @eslammahgoub ,

Could you provide a little JSFiddle example of your work ? You said you have set replaceOptions : false instead of replaceOptions : true .

eslammahgoub commented 8 years ago

Sorry but when i set replaceOptions : true it will remove all the default option even the legend; what i asked for is to replace just the areas option with new one "replaced not extend it",I wanna to do that but in the new version that

Samjin commented 8 years ago

I am having the exact same problem.

neveldo commented 8 years ago

Hello @Samjin ,

The issue is not clear to me, could you provide a JSFiddle example of your code that highlights your issue , and explain what you want to achieve ?

Indigo744 commented 7 years ago

As stated in the help file, opt.replaceOptions option will entirely replace current map options. Which means opt.mapOptions will extends the default options (actually in a similar fashion to the map creation) and replace all current options.

What you usually want to do is simply passing new options. If you want to replace option, simply pass a new value for a specific area/plot/link (or defaultAttr).

I am closing this. Feel free to reopen if you need help.