Skip to content

Commit be3a25a

Browse files
committed
fix: update google maps custom marker generation strategy
moved to custom svg path
1 parent 76e292b commit be3a25a

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

googlemaps/js/google.maps.jquery.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,17 @@
114114
var place = places[i];
115115
var color = place.color;
116116
if(!(color in markers_images)){
117-
var image_url = 'maps_images/pins/'+color;
118-
var icon = new google.maps.MarkerImage(image_url, new google.maps.Size(width, height));
119-
icon.anchor = new google.maps.Point(width / 2, height);
117+
// see https://developers.google.com/maps/documentation/javascript/examples/marker-symbol-custom
118+
var icon = {
119+
path: "M-1.547 12l6.563-6.609-1.406-1.406-5.156 5.203-2.063-2.109-1.406 1.406zM0 0q2.906 0 4.945 2.039t2.039 4.945q0 1.453-0.727 3.328t-1.758 3.516-2.039 3.070-1.711 2.273l-0.75 0.797q-0.281-0.328-0.75-0.867t-1.688-2.156-2.133-3.141-1.664-3.445-0.75-3.375q0-2.906 2.039-4.945t4.945-2.039z",
120+
fillOpacity: 0.8,
121+
strokeWeight: 0,
122+
rotation: 0,
123+
scale: 2,
124+
size : new google.maps.Size(width, height),
125+
};
126+
icon.fillColor = '#' + color;
127+
icon.anchor = new google.maps.Point(width / 12 , height/2);
120128
markers_images[color] = icon;
121129
}
122130
var marker_image = markers_images[color];

0 commit comments

Comments
 (0)