get actual zoom level

53 views
Skip to first unread message

Erich Melinz

unread,
Feb 26, 2021, 6:07:07 PM2/26/21
to Mapsforge & VTM
I want to save the actual zoom level in the shared preferences, so that the map is created with the last settings.

I set the zoom level with:
mapView.setZoomLevel((byte) 12);

I add an InputListener with a callback-method in case of a zoom event
mapView.addInputListener(new InputListener() {
@Override
public void onZoomEvent() {
...
}

But how do I get the actual ZoomLevel?

Thank's a lot for your help.

Emux

unread,
Feb 27, 2021, 4:09:28 AM2/27/21
to mapsfo...@googlegroups.com
Set zoom level:
mapView.getModel().mapViewPosition.setZoomLevel

Get zoom level:
mapView.getModel().mapViewPosition.getZoomLevel

--
Emux

Erich Melinz

unread,
Feb 27, 2021, 4:51:12 PM2/27/21
to Mapsforge & VTM
Thank you for your help - it's working :-)
Reply all
Reply to author
Forward
0 new messages