Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom zoomLVL and zoomCoordinates #25

Open
joneswe opened this issue Oct 12, 2017 · 4 comments
Open

custom zoomLVL and zoomCoordinates #25

joneswe opened this issue Oct 12, 2017 · 4 comments

Comments

@joneswe
Copy link

joneswe commented Oct 12, 2017

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?

@martynasma
Copy link
Collaborator

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
Copy link
Collaborator

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

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

@joneswe
Copy link
Author

joneswe commented Oct 13, 2017

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

@martynasma
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants