B4J Question [ABMaterial] Google Map Custom Icon

Harris

Expert
Licensed User
Longtime User
Anyone have code to create a custom icon for google map in ABM?
I would like to show an icon that depicts the direction of travel (0 - 359). I would also like to put a custom label on this icon showing the time of point.
JavaObject will likely play a role here...
 

alwaysbusy

Expert
Licensed User
Longtime User
I'm very limited in what I can do with the Google Maps, but here is what I've done:

I created a new AddMarkerEx() method:
B4X:
Sub btn10_Clicked(Target As String)
   Dim gm1 As ABMGoogleMap = page.Component("gm1")
   gm1.AddMarker("start", 50.8500, 2.8833, ABM.COLOR_RED, "", "")
   gm1.AddMarkerEx("stop", 50.9333, 3.1167,"STOP", "{B}{C:#f44336}VUN:{/C}{/B} 15{BR}{B}{C:#f44336}TIME:{/C}{/B} 15:31", "https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png", True)
   gm1.AddRoute(50.8500, 2.8833, 50.9333, 3.1167, ABM.GOOGLEMAP_TRAVELMODE_DRIVING, ABM.COLOR_DEEPPURPLE, ABM.INTENSITY_NORMAL, 0.6, 5)
   gm1.FitZoom
   gm1.refresh ' IMPORTANT
End Sub

Here you can set a png url for the icon, and if the infoWindow is open when created (so the user does not have to click on it).
I also made it possible to use the formatting tags like {B}, {C}, etc can be used in the infoWindow.

How it looks for example if one clicks 'ADD ROUTE' (the infoWindow is open without anyone clicking on it):

upload_2017-5-16_14-12-39.png
 
Last edited:
Upvote 0

Harris

Expert
Licensed User
Longtime User
Nice...
Available next version release?

Thanks
 
Upvote 0
Top