地图V2标记pressed状态标记、状态、地图、pressed

2023-09-06 10:23:53 作者:有本事,躲着别出来。

在地图V2,哪能设置pssed状态记号的$ P $?

In Maps V2, how can I set a pressed state to a Marker?

的setIcon的()方法需要一个BitmapDesc​​riptor;我看不到的方式来传递一个XML选择,这将使一个pressed和选中状态。

The setIcon() method takes a BitmapDescriptor; I can't see a way to pass an XML selector which would give a pressed and selected state.

是实现这一覆​​盖OnMarkerClickListener和编程改变形象的唯一途径?

Is the only way to achieve this to override the OnMarkerClickListener and change the image programmatically?

推荐答案

有没有办法更改图标为标记的持续时间被pressed作为API V2版本3.1.36。

There is no way to change the icon for the duration of Marker being pressed as of API v2 version 3.1.36.

对于选定的状态,你可以围绕使用工作,它 OnMarkerClickListener ,设置一些图标,想起了参考这个标记,它更改回正常时的另一个标志是点击或其他一些动作occures,例如: onMapClick onMapLongClick 被调用。

For the selected state, you may work it around by using OnMarkerClickListener, setting some icon, remembering the reference to this marker and changing it back to normal when another marker is clicked or some other action occures, e.g. onMapClick or onMapLongClick is called.