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

Can't get custom map to work (Mexico) #389

Closed AlexEscalante closed 7 years ago

AlexEscalante commented 7 years ago

I am trying to get a map from Mexico using the data file in this repository, like this:

    new Datamap({
        element: node,
       geographyConfig: {
       highlightOnHover: false,
       popupOnHover: false,
       dataType: 'json',
       dataUrl: 'https://raw.githubusercontent.com/markmarkoh/datamaps/master/src/js/data/mex.topo.json'
     }

I am not sure if I need to use any other option, because I can get nice USA or world maps when not using dataUrl. It's just when I use the Mexico data file that I get no errors and no output on the div.

AlexEscalante commented 7 years ago

I got it working by importing the specific file:

import Datamap from 'datamaps/dist/datamaps.mex';

And then using the scope mex with it…

Thanks!

gogvale commented 5 years ago

I've been looking everywhere, any tips on how to make it work on Angular? :(