我正在尝试使用这个blibioteca android-maps-extensions,因为我需要在我的地图上修复超过1000个标记.
在我的项目中添加了项目依赖项:
compile project (':android-maps-extensions')
Run Code Online (Sandbox Code Playgroud)
但是当我更新build.gradle时会出现以下错误:
没有这样的属性:对于类sonatypeUserName:org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer
用户名和密码似乎不正确或者其他什么,这段代码是我正在构建的项目的一部分.如何库,如何库:
...
pom.project {
name 'Android Maps Extensions'
description 'Library extending capabilities of Google Maps Android API v2'
inceptionYear '2013'
url 'http://AndroidMapsExtensions.com'
packaging 'aar'
developers {
developer {
name 'Maciej Górski'
id 'mg6maciej'
email 'maciek.gorski@gmail.com'
url 'http://mg6.pl'
}
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
url 'https://github.com/mg6maciej/android-maps-extensions'
connection 'scm:git:https://github.com/mg6maciej/android-maps-extensions.git'
developerConnection 'scm:git:https://github.com/mg6maciej/android-maps-extensions.git'
}
}
...
Run Code Online (Sandbox Code Playgroud)
有什么建议 ?
根据API文档,只有圆形Geofences允许:
https://developers.google.com/android/reference/com/google/android/gms/location/Geofence.Builder
它的例子如下:https://developer.android.com/training/location/geofencing.html
但我有4个位置,代表矩形的4个角,我希望我的地理围栏是那个矩形.
我想避免构建我的自定义位置监控服务的解决方案,扩展监控Geofences的功能,因为我认为这种服务是CPU和耗电的......
谢谢,
android geofencing android-maps-v2 android-maps-extensions android-geofence
我已经尝试这个很棒的库一个月了。到目前为止,它允许我在地图上拥有超过 5000 个标记。问题是我必须在这些位置之间绘制折线。请问有人有关于如何聚类折线的示例吗?当我不绘制折线时,缩放(和地图)很平滑,但是一旦我绘制折线,它就会变得很慢。请问mg6maciej(库的作者),你有关于如何聚类折线的Demo吗?提前致谢
当我调用这个createMarker()方法时,我得到一个IllegalArgumentException:
private void createMarker(GoogleMap map, MarkerOptions options, OnMarkerCreateListener listener) {
Log.e("LazyMarker", "Options var val: "+options);
Log.i("LazyMarker", "GoogleMap Value:"+map);
Log.i("LazyMarker", "OnMarkerCreateListener Value:"+listener);
marker = map.addMarker(options);
//Log.i("LazyMarker", "The value of Marker is:"+map.addMarker(options));
if (listener != null) {
listener.onMarkerCreate(this);
}
}
Run Code Online (Sandbox Code Playgroud)
这是logcat输出:
06-14 11:40:38.627: I/OGT.RideTracking(25590): Map value is: com.google.android.gms.maps.GoogleMap@4249bd30
06-14 11:40:38.627: E/LazyMarker(25590): Options var val: com.google.android.gms.maps.model.MarkerOptions@4318baf8
06-14 11:40:38.627: I/LazyMarker(25590): GoogleMap Value:com.google.android.gms.maps.GoogleMap@4249bd30
06-14 11:40:38.627: I/LazyMarker(25590): OnMarkerCreateListener Value:null
06-14 11:40:38.637: D/AndroidRuntime(25590): Shutting down VM
06-14 11:40:38.637: W/dalvikvm(25590): threadid=1: thread exiting with uncaught exception (group=0x415d7438)
06-14 …Run Code Online (Sandbox Code Playgroud) java android google-maps-android-api-2 android-maps-v2 android-maps-extensions