14

Am I right in thinking that there's only ONE icon included in google maps, and to use anything other than that you have specify a URL for an image, and a URL for a shadow, etc etc?

Basically I'm shocked that all of the icons you can see if you create a "My Maps" map aren't available in the API. It should be as simple as saying "icon: greenPin", "icon: parking", "icon: tent", surely?

Seems bizarre that they've not included such a basic thing given how powerful the rest of the API is - why make us jump through hoops giving specific URLs to images & shadows?

Am I missing something?

At the very least where can I find a list of the official google URLs for these "built in" images, as I'm struggling even with that.

:-S

Codemonkey
  • 4,455
  • 5
  • 44
  • 76
  • possible duplicate of [google maps v3 standard icon/shadow names (equiv. of G\_DEFAULT\_ICON in v2)](http://stackoverflow.com/questions/8248077/google-maps-v3-standard-icon-shadow-names-equiv-of-g-default-icon-in-v2) – Tomas Jan 08 '14 at 02:05

3 Answers3

13

Google has refreshed the look of the icons (and other things). The new default icon is this one here.

Other icons with this look can be found/made here.

^(By editing that URL, you can get the icons with letters inside, other colors, different sizes, &c.)

postylem
  • 1,185
  • 12
  • 26
  • 3
    See this post for array of icons that can be used: http://stackoverflow.com/questions/17746740/google-map-icons-with-visualrefresh – Scott Nov 11 '16 at 17:42
12

Yes you are right, google default image is only one and if you want to another image you have to use URL.

http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png

http://www.google.com/mapfiles/marker" + letter + ".png"

here you can replace the letter with any alphabet.

Ramesh Kotha
  • 8,266
  • 17
  • 66
  • 90
  • 5
    Thanks. I'm surprised google don't at least make this odd limitation more obvious - I just assumed I was being blind and missing something simple! Does seem odd that they don't have a small library of images built in to use though, doesn't it? – Codemonkey Feb 07 '12 at 15:50
  • 1
    +1 --is odd, especially considering you can see those other "default" Google images in other uses of the maps within Google. – Eric Jul 31 '13 at 01:49
1

The list is here & hosted by google. This lists them all(or most of them) out with the url to point to them.

Remember: They work with HTTPS:// and HTTP://

Using it:

marker = new google.maps.Marker({
    position: latLng, // this var would be set before calling this
    map: map, // this var would be set on initiating the api
    title: 'The location of the Million Dollars!',
    icon: 'https://maps.google.com/mapfiles/ms/icons/green-dot.png' // This is where you put the icon url
});
JSG
  • 390
  • 1
  • 4
  • 13