B4J Question Google Maps Change Marker Icon

tufanv

Expert
Licensed User
Hello,

For some reasons I am not able to remove and re add marker with different icon image. Is it possible to use Java's seticon property for google maps to change the marker's icon without removing it ? I searched the forum but in one topic Erel says it is easier to remove and re add the icon instead of changing.

Thanks
 

oparra

Well-Known Member
Licensed User
see:

 
Upvote 0

oparra

Well-Known Member
Licensed User
See;

B4X:
Public Sub SetMarkerIcon( m As Marker, URL As String)
    Private joM As JavaObject = m
    joM = joM.RunMethod("getJSObject", Null)
    joM.RunMethod("eval", Array($"this.setIcon({icon: "${URL}"});"$))
    Private joP As JavaObject
    joP.InitializeStatic("com.lynden.gmapsfx.javascript.object.GMapPoint")
'    joP.RunMethod("eval", Array($"this.x: 1, this.y: 1;"$))
End Sub

 
Upvote 0

tufanv

Expert
Licensed User

Attachments

  • 0B206312-8585-4C0A-A8B7-2DA830906396.jpeg
    0B206312-8585-4C0A-A8B7-2DA830906396.jpeg
    41 KB · Views: 67
Upvote 0
Top