Unrecognizable src script
Opened this issue · 3 comments
pietrobanana commented
My program is not able to recognize new Datamap, this happened when I changed the pointed package from the nodes_module component to the <script src="/datamaps.world.min.js"></script> link.
Any idea why this isn't working?
pietrobanana commented
<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="/datamaps.world.min.js"></script>
<div id="container" style="position: relative; width: 1000px; height: 600px;"></div>
<script>
var map = new Datamap({element: document.getElementById('container'),
scope: 'world',
geographyConfig: {
highlightFillColor: '#E07300',
popupTemplate: function(geography, data) {
return '<div class="hoverinfo">' + geography.properties.name + ' residencies:' + data.residencies + ' '
},
},
fills: {
defaultFill: '#0D7A9E'
},
pietrobanana commented
It seems the problem was fixed by replacing the min file in line 3 with:
<script src="http://datamaps.github.io/scripts/0.4.4/datamaps.usa.min.js"></script>If anyone has other suggestions of better practices please let me know. Thanks.
Spensiir commented
I'm also unable to use the Datamaps API. I'm importing the script via:
<script src="http://datamaps.github.io/scripts/0.4.4/datamaps.usa.min.js"></script>
but i am getting the following error in my console when I try to instantiate a new datamap:
Uncaught TypeError: Cannot read property 'equirectangular' of undefined