Welcome back.
In this video, we're going to learn about some useful utilities and tools that Google Maps platform
provide.
First of all, you should go to github.com Google Maps.
You can read about the Google Maps platform tools you can call Web Services APIs for from your preferred
language.
Go, Java, Node.js, and Python.
You can see the utility libraries for JavaScript API, loader language and frameworks support, but
we are interested in Jetpack Compose.
So if we scroll down to the repositories, we can notice Android Maps Compose.
You can see that our Java, Kotlin KTX, Android maps, utils, JavaScript and flutter and so on.
We are interested in Jetpack Compose, so open Android maps compose, and here there are a lot of things
we can implement.
There are some useful things like clustering.
We're going to talk about clustering.
Street view uh metadata check and others.
Also we can include the the widgets library for scale bar for example by using this dependency.
So at first let me start with the scale bar.
And then we'll move to Clustering and Street view.
Copy this implementation.
Google maps compose widget 6.6.
Go to here to the Gradle file and then paste it here.
Correct the implementation sync now and here we go.
Now let's move back to our Google map.
Composable.
And inside the scoop.
We need to implement the scale bar back to Google Maps.
If we scroll down to scale bar, this is the scale bar that I'm talking about in Google Maps when using
Jetpack Compose, a scale bar is a UI element that shows the relationship between distances on the map
and real world distances.
It helps users understand the scale of the map they are viewing.
To add a scale bar in Google Maps with Jetpack Compose, you typically use the Google Map composable
along with the scale bar functionality.
You can use the scale bar or disappearing scale bar.
Let me copy this scale bar with those modifier and camera position state parameters and inside the.
Let me paste it here alt plus enter to import the scale bar.
Because I created and I imported this library the compose widgets.
Let's run and see.
And here we go.
This is our app and it crashes.
Let me check the look at.
And here we have the Android X compose layout node can't be cast to Google Maps Android map node.
This is due to, I think, the wrong placement of the scale bar.
Let me check the documentations and here you can see Google Maps.
This is the scoop of the Google Maps scale bar is outside the Google Maps.
So it's a widget, uh, like an A layer over the Google Maps.
So let me cut this code and let me place it outside the box layout.
You can put it near the surface here.
Scale bar.
Let me test again.
And you notice at the top left we have this bar.
This is the scale bar okay.
So congratulations guys.
We learned about the scale bar we implemented.
And it's very useful in many applications.