Search code examples
highchartsprojection

Highcharts Highmaps How to change projection with hc-transform


I built this map with Highmaps and it looks ok: see fiddle

Now I want to use another projection and created this geojson file with pseudo mercator and added hc-transform. Unfortunately the map is not displayed: see fiddle

This is what the geojson looks like:

    Highcharts.maps["custom/europe-nuts"] = {
"type": "FeatureCollection",
"name": "worldmap",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::3857" } },
"hc-transform": {
    "default": {
        "crs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs"
    }
},

What went wrong?


Solution

  • Check your developer console. The error occurs because one of your geometry properties for features is set as null.

    I found that it is this line of your code:

    { "type": "Feature", "properties": { "hc-key": "AQ", "WB_A2": "-99", "NAME_DE": "Antarktika" }, "geometry": null },