I'm using version 1.3.1 of the Google Maps Extension and am trying to exclude a marker from being clustered. I have one marker that is set in the onCreate method of my app and it represents My Location. I want this to always be visible and not be clustered like the rest of my markers. Is this possible? I tried adding the marker before I set the clustering settings and before I called setClustering on the GoogleMaps object, but it doesn't seem to work.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
If you are using just one
Marker
which should not be clustered with all other, you can see a workaround in comment #2 here:https://code.google.com/p/android-maps-extensions/issues/detail?id=10#c2
Basically using
SupportMapFragment.getMap().addMarker(...)
instead ofSupportMapFragment.getExtendedMap()
The problem is you will get null in
GoogleMap
callbacks likeonMarkerClick
, but for just oneMarker
you can find out it's "the Marker". Clustering engine will not be aware ofMarker
added that way. You will also have class name collision, so you have to use full class name for original library likecom.google.android.gms.maps.model.Marker
in case you keep a reference to thisMarker
.Hope it helps until this improvement is implemented.
Edit:
This is available as of version 1.5 via simple call:
The default group is
0
and onlyMarker
s with the same group are clustered together, so if you change oneMarker
's group, you'll get the desired effect.