9

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!

Community
  • 1
  • 1
  • Maybe you'll find here what you are looking for: http://stackoverflow.com/questions/19142242/what-are-the-filenames-of-new-colored-google-maps-markers/19147695#19147695 – Dr.Molle Aug 18 '14 at 19:03
  • @Dr.Molle I believe it's a start, it doesn't look exactly like the new icons though –  Aug 18 '14 at 19:09
  • 1
    The best one I found was here on this post: http://stackoverflow.com/questions/17746740/google-map-icons-with-visualrefresh – Telmo Dias Sep 23 '15 at 11:32
  • Answered [here](https://stackoverflow.com/a/44332827/3003133), with: https://github.com/Concept211/Google-Maps-Markers – Kevin Jun 02 '17 at 15:48

2 Answers2

11

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)

Dr.Molle
  • 116,463
  • 16
  • 195
  • 201
  • Thank you very much, I was unaware of this! –  Aug 18 '14 at 23:31
  • The Developer-Tools "Networking Tab" is a very efficent method, I will be using it more often –  Aug 18 '14 at 23:36
  • 1
    Quick question, can I change the color of the icon? Something like yellow or blue? I have changed `spotlight-waypoint-a` to `spotlight-waypoint-b` and it gives me red, but there is nothing after that –  Aug 18 '14 at 23:51
  • I can't tell you(maybe it's notpossible) – Dr.Molle Aug 19 '14 at 00:52
  • 1
    I have found this https://mts.googleapis.com/vt/icon/name=icons/spotlight/spotlight-waypoint-blue.png&psize=16&font=fonts/Roboto-Regular.ttf&color=ff333333&ax=44&ay=48&scale=1 but I cannot get rid of the circle in the middle –  Aug 19 '14 at 00:55
  • the following claims to provide 26 (A-Z) pins in 10 colors. http://www.benjaminkeen.com/google-maps-coloured-markers/comment-page-3/ – Mike D Mar 15 '15 at 18:59
4

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;
                }
            }
Triet Nguyen
  • 763
  • 9
  • 20