ComposeMap – Camera Control

Welcome back dear reader!

It’s been a while since my last post, but I’m excited to dive into something new today. In this article, we’ll explore how to control the map camera on Android and iOS using Kotlin Multiplatform.

If you haven’t had a chance to check out the introduction yet, you can find it here. It’s a great starting point before diving deeper into today’s content.

On both Android and iOS, managing the camera position is slightly different. Today, I’ll walk you through three ways to control the camera using a library that leverages Jetpack Compose and Kotlin Multiplatform. We’ll also explore how to integrate simple animations with each approach.

Key Camera Interactions:

  • Zoom to multiple points – Adjust the camera to fit multiple locations within a given boundary using LatLngBounds. 
  • Move to a new target – Set the camera to a new location using LatLng.
  • Move to a new target with zoom – Change both the target location and adjust the zoom level.

To see these in action, check out the video below:

Camera Control Sample

There are also pitch and bearing properties that can be set, however we will add that later.

Below you may find the application source code of this demo.

I’m also thinking of sharing all the samples, so you can have a look yourself. I appreciate any kind of feedback.

Stay tuned! More is coming soon!


If you have some questions, suggestions, requests or want to test out this library yourself, get in touch with me using the contact form.

Get in touch