Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
149 views
in Technique[技术] by (71.8m points)

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

I'm switching icon types of google maps markers between a default one and another one (made by google chart api). To switch back to standard icon I use:

marker.setIcon('http://maps.google.com/mapfiles/marker.png');

For another icon I use:

marker.setIcon('http://maps.google.com/mapfiles/marker_yellow.png');

The question is:

  1. is the URL I use really the "standard" (canonical)? Is it assured that google will not change it?

  2. it would be better to use some constant like G_DEFAULT_ICON in gmaps api v2. Is there anything similar in api v3?

  3. if not, where one can find the list of canonical icon/shadow URLs that are assured to work during all the google api v3 life?

The same question for shadows - when I set the icon, how to get the standard shadow instead of using ugly m.setShadow(new google.maps.MarkerImage('http://maps.gstatic.com/mapfiles/shadow50.png', null, null, new google.maps.Point(10, 34)))? (Note that getShadow() will not tell you anything as it returns null on the default icon with defaultshadow).


PS: there are some dynamic icons APIs but they all are now deprecated, and no remedy has been found. question from:https://stackoverflow.com/questions/8248077/google-maps-v3-standard-icon-shadow-names-equiv-of-g-default-icon-in-v2

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I did some digging through the Google Maps - My Places creation page and there's a place to find a bunch of default icons. Not sure if they'll remain forever or not, but here's a list of almost a hundred to get you in the right direction with default icons:

Preview PNG

https://maps.gstatic.com/intl/en_us/mapfiles/ms2/iconm.png

enter image description here


Row 1

Dots

https://maps.gstatic.com/mapfiles/ms2/micons/blue-dot.png

https://maps.gstatic.com/mapfiles/ms2/micons/red-dot.png

https://maps.gstatic.com/mapfiles/ms2/micons/green-dot.png

https://maps.gstatic.com/mapfiles/ms2/micons/ltblue-dot.png

https://maps.gstatic.com/mapfiles/ms2/micons/yellow-dot.png

https://maps.gstatic.com/mapfiles/ms2/micons/purple-dot.png

https://maps.gstatic.com/mapfiles/ms2/micons/pink-dot.png

Dot Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/msmarker.shadow.png


Row 2

Solid

https://maps.gstatic.com/mapfiles/ms2/micons/blue.png

https://maps.gstatic.com/mapfiles/ms2/micons/red.png

https://maps.gstatic.com/mapfiles/ms2/micons/green.png

https://maps.gstatic.com/mapfiles/ms2/micons/lightblue.png

https://maps.gstatic.com/mapfiles/ms2/micons/yellow.png

https://maps.gstatic.com/mapfiles/ms2/micons/purple.png

https://maps.gstatic.com/mapfiles/ms2/micons/pink.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/msmarker.shadow.png


Row 3

Pushpins

https://maps.gstatic.com/mapfiles/ms2/micons/blue-pushpin.png

https://maps.gstatic.com/mapfiles/ms2/micons/red-pushpin.png

https://maps.gstatic.com/mapfiles/ms2/micons/grn-pushpin.png

https://maps.gstatic.com/mapfiles/ms2/micons/ltblu-pushpin.png

https://maps.gstatic.com/mapfiles/ms2/micons/ylw-pushpin.png

https://maps.gstatic.com/mapfiles/ms2/micons/purple-pushpin.png

https://maps.gstatic.com/mapfiles/ms2/micons/pink-pushpin.png

Pushpin Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/pushpin_shadow.png


Row 4

Restaurant

https://maps.gstatic.com/mapfiles/ms2/micons/restaurant.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/restaurant.shadow.png

Coffeehouse

https://maps.gstatic.com/mapfiles/ms2/micons/coffeehouse.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/coffeehouse.shadow.png

Bar

https://maps.gstatic.com/mapfiles/ms2/micons/bar.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/bar.shadow.png

Snack Bar

https://maps.gstatic.com/mapfiles/ms2/micons/snack_bar.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/snack_bar.shadow.png

Man

https://maps.gstatic.com/mapfiles/ms2/micons/man.png

Shadow:

https://maps.gstatic.com/mapfiles/ms2/micons/man.shadow.png

Woman

https://maps.gstatic.com/mapfiles/ms2/micons/woman.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/woman.shadow.png

Wheel Chair Accessible

https://maps.gstatic.com/mapfiles/ms2/micons/wheel_chair_accessible.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/wheel_chair_accessible.shadow.png


Row 5

Parking Lot

https://maps.gstatic.com/mapfiles/ms2/micons/parkinglot.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/parkinglot.shadow.png

Cab

https://maps.gstatic.com/mapfiles/ms2/micons/cabs.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/cabs.shadow.png

Bus

https://maps.gstatic.com/mapfiles/ms2/micons/bus.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/bus.shadow.png

Truck

https://maps.gstatic.com/mapfiles/ms2/micons/truck.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/truck.shadow.png

Rail

https://maps.gstatic.com/mapfiles/ms2/micons/rail.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/rail.shadow.png

Plane

https://maps.gstatic.com/mapfiles/ms2/micons/plane.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/plane.shadow.png

Ferry

https://maps.gstatic.com/mapfiles/ms2/micons/ferry.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/ferry.shadow.png


Row 6

Helicopter

https://maps.gstatic.com/mapfiles/ms2/micons/helicopter.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/helicopter.shadow.png

Subway

https://maps.gstatic.com/mapfiles/ms2/micons/subway.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/subway.shadow.png

Tram

https://maps.gstatic.com/mapfiles/ms2/micons/tram.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/tram.shadow.png

Info

https://maps.gstatic.com/mapfiles/ms2/micons/info.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/info.shadow.png

Info Circle

https://maps.gstatic.com/mapfiles/ms2/micons/info_circle.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/micons/info_circle.shadow.png

Flag

https://maps.gstatic.com/mapfiles/ms2/micons/flag.png

Shadow: https://maps.gstatic.com/mapfiles/ms2/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...