[Google Maps] Changing marker label to numbers in RouteMap

[Google Maps] Changing marker label to numbers in RouteMap

  
Forge Component
(19)
Published on 2017-04-24 by OutSystems Labs
19 votes
Published on 2017-04-24 by OutSystems Labs

is there any way to change marker labels in a RouteMap to be 1,2,3,4,5,..... instead of A,B,C,D,E,..... ?



I've had a good look at the plugin and... although it's brilliant... I can't make my way through it to change what it's doing.  I believe you'd have to make modifications to the plugin to get what you want.

Also, I don't think what you want is available as an option built into Google Maps.  So... even though this is totally against the established methodology, attached is an oml that attacks this problem from the client-side using Javascript.  Most of this is just the Google Maps Javascript Library doc samples... and an excellent StackOverflow answer...

https://stackoverflow.com/questions/37807917/google-maps-directions-using-1-2-3-instead-of-a-b-c

What this does is render the map without markers... and then adds in the markers (with numbers) using the marker positions of the route.

There's most likely a far better, more correct way of loading the Google Maps API, but being Web, this stuff is just hard to figure out and do.  I've placed an Expression on the HomeScreen which loads the API.  You must put in your own Google Maps API Key.

Also on the HomeScreen is another Expression which creates the div for the map.

I would love to know the proper/best way to load an API Library.

The Simple Map button loads a map you can click on to place markers, clear those markers, show them, and delete them.  Also change the marker labels from letters to numbers... but doing this resets the starting letter or number.  Lots more you can do with this.  1-9 for numbers work here, but it would be an easy change to add the use of more numbers.

The Directions Map button loads a route map with numbered markers.  The other buttons, e.g. Clear Markers, have no effect on this map.

Davidk wrote:

I've had a good look at the plugin and... although it's brilliant... I can't make my way through it to change what it's doing.  I believe you'd have to make modifications to the plugin to get what you want.

Also, I don't think what you want is available as an option built into Google Maps.  So... even though this is totally against the established methodology, attached is an oml that attacks this problem from the client-side using Javascript.  Most of this is just the Google Maps Javascript Library doc samples... and an excellent StackOverflow answer...

https://stackoverflow.com/questions/37807917/google-maps-directions-using-1-2-3-instead-of-a-b-c

What this does is render the map without markers... and then adds in the markers (with numbers) using the marker positions of the route.

There's most likely a far better, more correct way of loading the Google Maps API, but being Web, this stuff is just hard to figure out and do.  I've placed an Expression on the HomeScreen which loads the API.  You must put in your own Google Maps API Key.

Also on the HomeScreen is another Expression which creates the div for the map.

I would love to know the proper/best way to load an API Library.

The Simple Map button loads a map you can click on to place markers, clear those markers, show them, and delete them.  Also change the marker labels from letters to numbers... but doing this resets the starting letter or number.  Lots more you can do with this.  1-9 for numbers work here, but it would be an easy change to add the use of more numbers.

The Directions Map button loads a route map with numbered markers.  The other buttons, e.g. Clear Markers, have no effect on this map.

Thank you very much for the answer, i need it to be higher than 1-9, but i can use a lot of this information aswell, thanks again!