I have done with polygon on Google map, now I want to calculate the area of a drawn polygon by using SphericalUtil.computeArea()
, but I am not able to import com.Google.maps.android.SphericalUtil
.
I have added Google play services and also added
uses-library "android:name="com.Google.android.maps"
into the manifest.
In Android Studio - You have to add following dependency to your Gradle build file:
dependencies {
compile 'com.google.maps.android:android-maps-utils:0.6.2'
}
Reference - Google Maps Android API utility library
See link here
com.google.maps.android.SphericalUtil
is included in the Google Maps Android API Utility Library, so you need to setup this library in order to import SphericalUtil
in your project.
Here is the Google Maps Android API Utility Setup guide
This works to me:
dependencies {
...
implementation 'com.google.maps.android:android-maps-utils:0.5'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
}
from https://developers.google.com/maps/documentation/android-sdk/utility/setup and https://developers.google.com/android/guides/setup
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With