I've seen lots of other questions similar to this (here, here and here), but they all have accepted answers that don't solve my problem. The best solution I have found to the problem is the StyledMarker library, which does let you define custom colours for markers, but I can't get it to use the default marker (the one you get when you do a google maps search - with a dot in the middle), it just seems to provide markers with a letter in, or with a special icon.
相关问题
- How do you change the color of the dotted line on
- Add HTML class/ID to Google Maps Marker (API V3)
- Google maps how to force marker on the nearest roa
- Google Maps API v3 Hiding and showing a circle bou
- google maps adding overlay layer above UI and mark
相关文章
- Avoiding “Sorry, we have no imagery here” with Goo
- Cursor disappears in Google Maps application
- How to draw a proper polylines on google maps [clo
- Draw a rectangle arround a polygon when given in c
- Disable 'use strict' in Google Maps Drawin
- Unable to rotate kml layer
- Opening only a infobox at a time when multiple mar
- How to change strokeColor between points when usin
I tried for a long time to improve vokimon's drawn marker and make it more similar to Google Maps one (and pretty much succeeded). This is the code I got:
I also scaled it by 0.8.
You can dynamically request icon images from the Google charts api with the urls:
Which looks like this: the image is 21x34 pixels and the pin tip is at position (10, 34)
And you'll also want a separate shadow image (so that it doesn't overlap nearby icons):
Which looks like this: the image is 40x37 pixels and the pin tip is at position (12, 35)
When you construct your MarkerImages you need to set the size and anchor points accordingly:
You can then add the marker to your map with:
Simply replace "FE7569" with the color code you're after. Eg:
Credit due to Jack B Nimble for the inspiration ;)
These are costume Circular markers
small_red:
small_yellow:
small_green:
small_blue:
small_purple:
They are 9x9 png images.
Once they're on your page you can just drag them off and you'll have the actual png file.