Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unrecognizable src script #529

Open
pietrobanana opened this issue May 5, 2021 · 3 comments
Open

Unrecognizable src script #529

pietrobanana opened this issue May 5, 2021 · 3 comments

Comments

@pietrobanana
Copy link

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
Copy link
Author

pietrobanana commented May 5, 2021

<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
Copy link
Author

pietrobanana commented May 6, 2021

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
Copy link

Spensiir commented May 6, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants