Map API

Nutiteq Maps Lib SDK enables developing advanced mobile mapping applications.
Platforms: Android, RIM BlackBerry, Java ME (J2ME)
Download maps API SDK »
Untitled Document

Products

» View demos
» Downloads

Latest news

Last at Tue, 3 Apr 2012 23:31:42
Topic: MapXT SDK evaluation
See more news »

ZoomChangedListener ?

2 replies [Last post]
Octa
User offline. Last seen 17 weeks 6 days ago. Offline
Joined: 12/20/2011

Hi,
Is there any way to find out when the zoom of the map changed ?
I search something like a Listener.
I've tried following:

// The zoom before Click --> 10
Log.i("Zoom..: ",""+mapComponent.getZoom());

zoomControls.setOnZoomInClickListener(new View.OnClickListener()
{
public void onClick(final View v)
{
mapComponent.zoomIn();

// the zoom after zoomIn is still 10
Log.i("Zoom..: ",""+mapComponent.getZoom());
}

});

It seems, that "mapComponent.zoomIn();" isnt finish at this time and I got the old value of the zoom.

What can I do ?

I need all this because I would like to call a method when the zoom got change, but I got always the false value.

jaak
User offline. Last seen 15 hours 51 min ago. Offline
Joined: 06/19/2008

I would implement MapListener, this has mapMoved() method and this is called also if zoom is changed. You should remember zoom before and after anyway. ZoomControl is probably not enough, as user can zoom without it also (using pinch gesture or double-click).

/JaakL

Octa
User offline. Last seen 17 weeks 6 days ago. Offline
Joined: 12/20/2011

Thx!