简体   繁体   中英

Ammaps change initial map zoom and coordinates

Using Ammaps, how can I change the default zoom and center coordinates for when the map loads? I am using a world map but unfortunately I can't get it to start zoomed in over a specific point.

Thanks!

You can define zoomLevel , zoomLongitude and zoomLatitude in your dataProvider .

"dataProvider": {
    "map": "worldLow",
    "zoomLevel": 3.5,
    "zoomLongitude": -55,
    "zoomLatitude": 42,
    ...
}

Please check this example: https://www.amcharts.com/demos/animations-along-lines/

The other option is to use methods after the chart starts. You can use zoomTo method to zoom to the desired coordinates and the zoom level. Optionally you could try zoomIn in case you want to rely on the default zoom level and you don't need to change the coordinates.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM