Cluster markers overlay by User's current location icon in Android

[亡魂溺海] 提交于 2019-12-05 09:30:38

According to the user's marker, I am assuming you use the

mGoogleMap.setMyLocationEnbladed(true)

method.

According to your result, I think that googleMap draws the myLocation marker after the cluster markers.

Maybe the solution is to draw your personnal marker for myLocation and so, don't use the setMyLocationEnabled() method but your own marker with onLocationChanged method.

I think it's really hard to do what you want. As I said, GoogleMap draws marker over the previous. Even if you draw the myLocation marker before the clusters, the next mylocation will be over your cluster, so you'll need to redraw your cluster.

Another approach could be to draw markers with alpha (or transparency).

Last thing, why do you want to hide the user's location when he is below a cluster ?

The other way would be to draw layers on gmaps in onDraw, that way you might also draw location marker just before drawing the location pins. I'm pretty sure I did something like this back in 2013. Sorry don't have any code left, but it shouldn't be hard.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!