markmarkoh / datamaps

Customizable SVG map visualizations for the web in a single Javascript file using D3.js
http://datamaps.github.io
MIT License
3.78k stars 1.01k forks source link

Switch between 2 different maps – almost there but not quite.. #92

Closed xammamax closed 8 years ago

xammamax commented 10 years ago

What I'm trying to do is to visualise two measures – Income Inequality (Gini) and GDP per capita – in one world map and make it possible to switch between the two views.

I am almost there. Here is my example: http://www.ourworldindata.org/roser/maps/GDPandGINI_disposableIncome_ScienceData/GDPandGINI_disposableIncome_ScienceData.html

On the top you can choose which measure to look at and the updating works – except that the updated map is plotted underneath the previous one and not on top. This is happening even though I'm referring to the same id with both maps:

What am I missing? Thanks for helping me!

jessrubio commented 10 years ago

good day there is nothing wrong with what you created, put each map into div once the map is inside div, just hide or unhide the map that you want to show.. like this

  Githubissues.

  • Githubissues is a development platform for aggregating issues.