Zooming to specific location

321 views Asked by At

I've included the world map and I'd like to know how I can zoom to a specific continent e.g. europe, without using coordinates.

I already found the .zoomTo method.

Thanks in advance!

1

There are 1 answers

4
AnyChart Support On BEST ANSWER

As of version 7.12.0 there is no way to specify the set of regions to be zoomed too, but:

1) There is also zoomToFeature method that allows zooming into a given feature;

2) and probably this way may work for you, changing:

        var mapScale = map.scale();

        mapScale.minimumX(100);
        mapScale.maximumX(153);
        mapScale.minimumY(-50);
        mapScale.maximumY(-10);

Here is Sample of AnyMap zooming to Australia based on hit test and geo scale changes based on this option. Zoom out must be done the same way too.

3) There are plans to allow zoomToFeature method to zoom to a set of features, probably version 7.13 or 7.14