0
votes

I'm trying to define the limit the zoom level, I want to increase it, a user can go on a map. Because for some country I'm showing on the map, there is some region that is so small that the shape is not visible, even if they are correctly defined into the GeoJSON, and there is also the label over it.

You can take as reference the following code from highmaps developers: http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/maps/demo/doubleclickzoomto/

$('#container').highcharts('Map', {
        title : {
            text : 'Zoom in on country by double click'
        },
        mapNavigation: {
            enabled: true,
            enableDoubleClickZoomTo: true
        },

        colorAxis: {
            min: 1,
            max: 1000,
            type: 'logarithmic'
        },

        series : [{
            data : data,
            mapData: Highcharts.maps['custom/world'],
            joinBy: ['iso-a2', 'code'],
            name: 'Population density',
            states: {
                hover: {
                    color: '#BADA55'
                }
            }
        }]
    });
1

1 Answers

0
votes

found the solution:

setting minRange property on both xAxis and yAxis:

The minimum range to display on this axis. The entire axis will not be allowed to span over a smaller interval than this, in terms of shape path coordinates. Defaults to 5 times the size of the smallest area.

$('#container').highcharts('Map', {
        title : {
            text : 'Zoom in on country by double click'
        },
        xAxis: {
            minRange: 1
        },
        yAxis: {
            minRange: 1
        },
 .....