ammap3 icon indicating copy to clipboard operation
ammap3 copied to clipboard

custom zoomLVL and zoomCoordinates

Open joneswe opened this issue 7 years ago • 4 comments

I want to manipulate zoomLvL and the zoomCoordinates of mapObjects(mapAreas). with map.zoomToLongLat(areaZoomLvL + offset, areaLong + offset, areaLat+ offset) I can zoom to a specific location. I'm fine with the lat/long. I can get them with map.getAreaCenterLongitude(mapObject) and map.getAreaCenterLatitude(mapObject)

But I couldn't figure out how to get the standard zoomLvL of an area. Is there a way to get the standard zoomLvL of an area or to manipulate the standard zoom behavior?

joneswe avatar Oct 12 '17 12:10 joneswe

If you want to make the map zoom to specific area, why don't just use zoomToSelectedObject()?

E.g.:

map.selectedObject = map.getObjectById("FR");
map.zoomToSelectedObject();

martynasma avatar Oct 13 '17 04:10 martynasma

OK, here's a better way. There's an undocumented method zoomToObject:

map.zoomToObject(map.getObjectById("FR"));

martynasma avatar Oct 13 '17 05:10 martynasma

I don't want to zoom to an area. I want to zoom to a point to the right of an area. I want to add an offset to the area coordinates and zoomLvL

joneswe avatar Oct 13 '17 07:10 joneswe

Gotcha. Unfortunately, there's currently no way to find out the zoom level for the area. Sorry :(

martynasma avatar Oct 13 '17 08:10 martynasma