osmbonuspack icon indicating copy to clipboard operation
osmbonuspack copied to clipboard

distinguish the tapped marker from other markers

Open dust27149 opened this issue 4 years ago • 2 comments

A low-cost solution to distinguish the tapped marker from other markers with the help of onSingleTapUp & onSingleTapConfirmed method and drawable resources. Works in MarkerClusterer container as well.

Step1.

add drawable resources that can distinguish status from focused and other status; marker_with_status.xml `

<item android:drawable="@drawable/marker_default" android:state_focused="true" />
<item android:drawable="@drawable/marker_default_focused_base" />

`

Step2.

replace Marker with MarkerWithStatus, and call setIcon(Drawable icon) method;

MarkerWithStatus startMarker = new MarkerWithStatus(map); startMarker.setIcon(ContextCompat.getDrawable(this,R.drawable.marker_with_status));

dust27149 avatar Jun 09 '21 03:06 dust27149

Is there a way to show selected marker differently at the moment? The patch is useful.

Psijic avatar Sep 25 '23 08:09 Psijic

I provided "marker_with_status.xml" to specify icons which is selected or is not selected. However, this solution is not "elegant".Maybe we can strengthen the class "Marker" and provide a method like "setSelectedIcon". 

Dust_2 @.***

 

dust27149 avatar Oct 07 '23 01:10 dust27149