Tomasz Jeznach Tomasz Jeznach - 5 months ago 15
Javascript Question

Datamap isn't showing map

I used the following repository

https://github.com/markmarkoh/datamaps

This is the code:

<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/topojson/1.6.9/topojson.min.js"></script>
<script src="dist/datamaps.all.min.js"></script>
<div id="container" style="position: relative; width: 500px; height: 300px;"></div>

<script>
var map = new Datamap({
element: document.getElementById('container'),
scope: 'pol'
});
</script>


When I change the scope to "usa" the browser shows me a map of the USA.
But when I put "pol" there is nothing...
In the datamaps.all.min.js "pol" is contained...
Other maps don't work either... Only US

Does someone know what's wrong?

Answer

datamaps.all.min.js shows only usa-only map as per this link

For showing world map, you need to use this script during initial import

http://datamaps.github.io/scripts/0.4.4/datamaps.world.min.js

For poland Map, try this script URL instead

Comments