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

Multiple area layers #192

Closed altonsa closed 8 years ago

altonsa commented 8 years ago

I hope someone can help. I have a map with a legend for areas showing the African countries' GDP and another for plot points. I'd like to add another area layer for languages spoken in Africa to overlay all of this. Is this possible with Mapael?

Regards, Karen

neveldo commented 8 years ago

Hello,

I'm not sure to understand what visual result you expect to get with the second layer of areas. Do you have any wireframes that shows what you want ?

How would you show the languages spoken in African countries on the map ?

Maybe you could use the "multiple legend" feature that allows you to set multiple values to each areas (one value for the GDP, and another for the language that could set different styles on the area, the border color and the background color for example). Here is an example on plot points : http://jsfiddle.net/neveldo/xd2azoxL/ .

altonsa commented 8 years ago

Thanks so much for your reply. Best way to explain is for you to see what I've done.

Map 1: http://anysite.co.za/africa-map/map.php Map 2 with language: http://anysite.co.za/africa-map/map_lang.php

I'd like to combine the two into one map so the legend with have 3 options, GDP, language and Overlays.

Does that make sense? Is it possible?

neveldo commented 8 years ago

Hello,

I now see what you want to get. Mapael doesn't include this kind of feature to handle multiple layer.

One approach could be to represent the langagues with a second legend that sets a specific border color on the contries depending on the spoken language, but I think the map will become difficult to read. Maybe, a better approach could be to create the two map on the same page, and right after the map creation, hide one of them (because Mapael doesn't support map creation into an hidden div, it leads to some side effects). Then, you just have to add two radio buttons to switch between the map that shows the GDP of countries, and the map that shows the spoken languages. What do you think about it ?

altonsa commented 8 years ago

No problem at all. I've taken your advice and went with the tabbed pages route. That makes things a lot neater as well.

Thanks again for your help!

neveldo commented 8 years ago

I'm glad it helped you !