简体   繁体   中英

How to zoom and scroll map at the same time with OSMDroid

I work on a project with Google Maps API. I want to move to OSMDroid.

With Google Maps API, when I click on a marker, my map scroll and zoom to it. I can't reproduce the same effect on OSMDroid.

It seems that animateTo and zoomTo cannot be called at the same time. My map either scroll or zoom, but does not do both.

Do you have any idea or workaround?

Try one of the new methods in version 6, zoomToFixing :

Point p = mMapView.getProjection().toPixels(point, null);
mMapView.getController().zoomToFixing(zoomLevel, p.x, p.y);

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