9
votes

I am trying to get the current default Google Maps Icons.

I am making a program with the Google Maps API and have set my DirectionsRenderer to suppress markers so I can make markers to set the specific icon.

This is my current result:

This is what I had before suppressing the default markers:

Later in my program I will be adding waypoints so I would like to set markers like the ones above with the letter A, B, C, etc. with a different color, (like marker "A", which is green).

I have visited several sites such as:

https://developers.google.com/maps/documentation/javascript/examples/marker-symbol-predefined

https://www.google.com/fusiontables/DataSource?dsrcid=308519#map:id=3

google maps v3 standard icon/shadow names (equiv. of G_DEFAULT_ICON in v2)

The markers these websites tell you to use, do not look the same as the current markers. I am wondering if there is a way to call the current "green marker a" just like in the fusion tables:

If so, how? Thanks!

2
Maybe you'll find here what you are looking for: stackoverflow.com/questions/19142242/…Dr.Molle
@Dr.Molle I believe it's a start, it doesn't look exactly like the new icons thoughuser1832583
The best one I found was here on this post: stackoverflow.com/questions/17746740/…Telmo Dias

2 Answers

11
votes

When you take a look at the network-tab of the developer-tools you'll see that the URL for the green marker is:

https://mts.googleapis.com/vt/icon/name=icons/spotlight/spotlight-waypoint-a.png&text=A&psize=16&font=fonts/Roboto-Regular.ttf&color=ff333333&ax=44&ay=48&scale=1
//------------------------------------------------------------------------------------^

The letter may be defined via the text-parameter

(Note: there is also a color-parameter, this parameter is used for the text-color and not for the background of the marker)

3
votes

This post was old. I hope my answer that will help people to do that.

            for (var i = 0; i < listMarkers.length; i++) { //loop markers
                if (listMarkers[i].icon) { // if icon is set
                    listMarkers[i].setIcon(); //set default 
                    break;
                }
            }