如何在Android Studio中导入com.google.maps.android.SphericalUtil? [英] How do I import com.google.maps.android.SphericalUtil in Android Studio?
本文介绍了如何在Android Studio中导入com.google.maps.android.SphericalUtil?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经完成了Google地图上的多边形,现在我想通过使用 SphericalUtil.computeArea()
来计算绘制的多边形的面积,但是我无法导入 com.Google.maps.android.SphericalUtil
。
我添加了Google play服务并添加了
$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $'
放入清单中。
> Android Studio - 您必须将以下依赖项添加到您的Gradle构建文件中: 依赖关系{
编译'com.google.maps.android:android-maps-utils:0.4+'
}
- SphericalUtil 类位于 android-maps-utils
请参阅 link here
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.4+'
}
Reference - Google Maps Android API utility library
- SphericalUtil class is available under android-maps-utils
See link here
这篇关于如何在Android Studio中导入com.google.maps.android.SphericalUtil?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文