B4J Question Google Maps Change Marker Icon

tufanv

Expert
Licensed User
Longtime 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
 

TILogistic

Expert
Licensed User
Longtime User
see:

 
Upvote 0

TILogistic

Expert
Licensed User
Longtime 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
Longtime User

Attachments

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