taty
Posts: 2
Joined: Tue Sep 29, 2020 4:00 pm

Drilldown province to municipalities in Cuba map

I want to do a drilldown on the map of Cuba between the provinces and the municipalities, but I do not have a geo.json of the municipalities structured in the way that Highmaps needs, the one I have has another structure. Is there a geo.json that links the provinces and municipalities or some way to do it? I tried to do it on my own, being guided by the example of drilldown from Alabama, from the United States, but it didn't work. I don't know the meaning of each parameter of the json. It would be very helpful to receive some guidance. Thanks
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Drilldown province to municipalities in Cuba map

Hello taty,

Welcome to our forum and thanks for contacting us with your question!

If we want to add a new map and we don't have the GeoJSON data we need to create one. :wink:

In the articles below there is well explained how to create a custom GeoJSON map:
https://www.highcharts.com/docs/maps/cr ... stom-maps/
https://www.highcharts.com/docs/maps/cu ... ojson-maps

Hope it helps!
Regards.
Dominik Chudy
Highcharts Developer
taty
Posts: 2
Joined: Tue Sep 29, 2020 4:00 pm

Re: Drilldown province to municipalities in Cuba map

Hello, thanks for your answer. I have GeoJSON file for all cuban municipalities, but i don't know what it means next parameters in Highmaps structure:

Code: Select all

 
 "hc-transform": {
        "default": {
            "crs": "+proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.99996 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m +no_defs",
            "scale": 0.00131810083316,
            "jsonres": 15.5,
            "jsonmarginX": -999,
            "jsonmarginY": 9851.0,
            "xoffset": -49768.1312835,
            "yoffset": 502488.819561
        }
    },
 
If I understood this maybe I could transform what I have to the structure that Highmaps needs.
The rest of the geojson is done...I think...

Thanks
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Drilldown province to municipalities in Cuba map

Hi again,

Highmaps doesn't require any special structure as far as I know. In this article: https://www.highcharts.com/docs/maps/cu ... ojson-maps you've got two links. The first one optimizes your file and the second one tests your GeoJSON. Have you tried to put your GeoJSON in the second demo: https://jsfiddle.net/highcharts/xbzxfx2L to check if it works?

If it doesn't work I recommend to follow this tutorial and create your map from scratch. You can always reach me with any questions of course! :wink:

Regards!
Dominik Chudy
Highcharts Developer

Return to “Highcharts Maps”