简体   繁体   中英

How to put marker at bottom of map instead of center(by default) of map with zoom enabled in android?

In live track app I want to animate camera above marker and want to put marker always at bottom in newLocationChanged.

If I am building CameraPosition without zoom, It works fine.

But with zoom also I need to achieve same.

Use the screen boundaries to get the desired position:

As per documentation:

getBounds()
Return Value: LatLngBounds

Returns the lat/lng bounds of the current viewport. If more than one copy of the world is visible, the bounds range in longitude from -180 to 180 degrees inclusive. If the map is not yet initialized (ie the mapType is still null), or center and zoom have not been set then the result is null or undefined.

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