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

Error when changed scope #79

Closed Solidary closed 10 years ago

Solidary commented 10 years ago

Hi,

I am a guy with D3.js and DataMaps.

I would like to display just for Cameroon country. So after including datamaps.all.min.js the rest of my code is var map = new Datamap({ scope : 'cmr', element : document.getElementById('container'), });

I have this error Uncaught TypeError: Cannot read property 'objects' of undefined. Even when I changed scope by other country.

Any solutions please ? Thanks.

markmarkoh commented 10 years ago

Unfortunately changing the scope isn't as easy as sending in a country code via the scope parameter.

You need to override setProjection to set your own projection. Here is something zoomed somewhat into Cameroon, you could increase the .scale(400) to something larger to continue zooming in.

Zoomed into Cameroon

EdisonDevadoss commented 4 years ago

HI, Can anybody help me to zoom in to India?