Welcome back.
I want from you to focus with me because this is a very important video I'm describing, and I'm showing
you how to solve major problems in the next updates and the next versions of Android.
Android is keep updating and many documentations are deprecated.
Many classes are changed.
Many composables are changed.
How to deal with this change?
I'm showing you how to, uh, to uh, get the correct parameters, how to specify the correct parameters
of the composables.
For example, here we have the ground overlay.
The position was a lat long bounce, but in the new version of Android and the new updates is changed
to be a ground overlay position.
And this is a problem for me because I created a new, uh, valuable according to the documentations
and specify it here.
But there is an error.
We need to create a ground overlay position in order to solve this issue.
We need to follow the documentation and the the declarations.
Ctrl and left click.
We open the ground overlay.
Here we have many parameters.
We have the position image and so on.
We need to specify the position which is a ground overlay position.
Also Ctrl and left click.
So the first thing is to keep tracking.
Keep going deep diving into the documentations and the declarations.
Open the ground overlay.
And here we have the ground overlay position which is a class.
Inside this class we have a constructor having four parameters lat long bounds location width and height.
And also we have a companion object.
So this is the scope of the ground overlay position.
Please pay attention I'm showing you how to think how to solve your problems.
Your own problems.
You don't need me or ChatGPT or Deep Sea or any other because you.
This is a waste of time.
You should solve your problems by your own and keep updating and keep tracking.
Okay, so the ground overlay position class has four parameters and a companion object with two with
two functions.
The first one is create and the second one is create.
The first create function takes a lat long bounds as a parameter and returns a ground overlay position.
And the second case we have a create function.
Taking to the parameter location with height and returns a ground of position.
So in.
In both cases we return a ground overlay position and this is the required thing we need to get here
inside the position of the ground overlay.
But which one we need to pass since we created a Manhattan bounds which is a lat long bounds.
So I'm going to use this create function.
And by the way here is a method over loading.
So create a new variable called position or lay equals to ground.
Let me check ground overlay position I'm creating an instance of this variable ground overlay position
dot create I'm calling this function create.
I'm passing the lat long bounds to it to return a ground overlay position with the specified lat long
bounds dot, create which one I need to pass the first one and Manhattan bounds okay, so this position
overlay variable it's of type ground overlay position.
Now I can use it here inside the ground overlay.
Let me run and see the magic.
Here we go.
This is our map.
Let me dive into New York.
IRC.
And here we go.
This is our map overlay.
You can notice that it is not, uh, exactly over the the New York map.
So this is the vertex here.
So I need to specify it here.
You can use other parameters like rotation like blurring.
Let me return it for example 0.3 degrees.
It's not tilted.
So I'm going to use 30 degrees.
Let me check again.
And here we go.
It's better now.
It's matching.
Uh New York I can increase the the bounds I can increase and edit the image and so on okay.
So congratulations guys.
We succeeded in displaying a ground overlay, which is an overlay over the map used for historical maps
showing constructions, adding custom map layers, visualizing heatmaps, or special or specific zones.