Skip to content

Latest commit

 

History

History
165 lines (135 loc) · 5.59 KB

File metadata and controls

165 lines (135 loc) · 5.59 KB

There are multiple ways to control the Camera Position in Mappls SDKs. Following are the methods tha you can use:

This method allows to move the camera towards the target location.

Kotlin

mapplsMap.moveCamera(CameraUpdateFactory.newLatLng(LatLng(latitude, longitude)))

Java

mapplsMap.moveCamera(CameraUpdateFactory.newLatLng(new LatLng(latitude, longitude)));

This method allows to move the camera towards the target location with a fixed zoom.

Kotlin

mapplsMap.moveCamera(CameraUpdateFactory.newLatLngZoom(LatLng(latitude, longitude), zoom))

Java

mapplsMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latitude, longitude), zoom));

This method allows to move the camera towards the target location with padding.

Kotlin

mapplsMap.moveCamera(CameraUpdateFactory.newLatLngPadding(LatLng(latitude, longitude), left, top, right, bottom))

Java

mapplsMap.moveCamera(CameraUpdateFactory.newLatLngPadding(new LatLng(latitude, longitude), left, top, right, bottom));

This method allows to move the camera towards the target location with view bounds.

Kotlin

val latLngBounds = LatLngBounds.Builder()
    .include(LatLng(lat1, lng1))
    .include(LatLng(lat2, lng2))
    .build()
mapplsMap.moveCamera(CameraUpdateFactory.newLatLngBounds(latLngBounds, left, top, right, bottom))

Java

LatLngBounds latLngBounds = new LatLngBounds.Builder()
            .include(new LatLng(lat1, lng1))
            .include(new LatLng(lat2, lng2))
            .build();
mapplsMap.moveCamera(CameraUpdateFactory.newLatLngBounds(latLngBounds, left, top, right, bottom));

This method allows to zoom the camera to a particular zoom-level. Example, 18/14 etc.

Kotlin

mapplsMap.moveCamera(CameraUpdateFactory.zoomTo(zoom))          

Java

mapplsMap.moveCamera(CameraUpdateFactory.zoomTo(zoom));

This method allows to zoom the camera to a particular zoom by some amount of zoom level

Kotlin

mapplsMap.moveCamera(CameraUpdateFactory.zoomBy(2.0))

Java

mapplsMap.moveCamera(CameraUpdateFactory.zoomBy(2.0));

This method allows to zoom in.

Kotlin

mapplsMap.moveCamera(CameraUpdateFactory.zoomIn())

Java

mapplsMap.moveCamera(CameraUpdateFactory.zoomIn()); 

This method allows to zoom out.

Kotlin

mapplsMap.moveCamera(CameraUpdateFactory.zoomOut())

Java

mapplsMap.moveCamera(CameraUpdateFactory.zoomOut());

This method allows to zoom with respect to the bearing.

Kotlin

mapplsMap.moveCamera(CameraUpdateFactory.bearingTo(bearing))

Java

mapplsMap.moveCamera(CameraUpdateFactory.bearingTo(bearing));

This method allows you to tilt the camera to specefic tilt in degrees eg.,20.

Kotlin

mapplsMap.moveCamera(CameraUpdateFactory.tiltTo(tilt))

Java

mapplsMap.moveCamera(CameraUpdateFactory.tiltTo(tilt));

This method allows to move the camera towards the location with padding.

Kotlin

mapplsMap.moveCamera(CameraUpdateFactory.paddingTo(left, top, right, bottom))

Java

mapplsMap.moveCamera(CameraUpdateFactory.paddingTo(left, top, right, bottom));




For any queries and support, please contact:


Email us at apisupport@mappls.com


Support
Need support? contact us!






@ Copyright 2026 CE Info Systems Ltd. All Rights Reserved.