Skip to content

Commit ad806dc

Browse files
committed
Add zIndex support for marker
1) Allow user to pass 'zIndex' and 'optimized' props to marker class. Setting the 'optimized' property to 'false' seems to help the user determine which marker displays on top using the zIndex. See: https://stackoverflow.com/questions/11845916/google-maps-marker-zindex-doesnt-work-for-two-icon-types-symbol-and-string
1 parent f130550 commit ad806dc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

dist/components/Marker.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@
136136
icon = _props.icon,
137137
label = _props.label,
138138
draggable = _props.draggable,
139-
title = _props.title;
139+
title = _props.title,
140+
optimized = _props.optimized,
141+
zIndex = _props.zIndex;
140142

141143
if (!google) {
142144
return null;
@@ -153,7 +155,9 @@
153155
icon: icon,
154156
label: label,
155157
title: title,
156-
draggable: draggable
158+
draggable: draggable,
159+
optimized: optimized,
160+
zIndex: zIndex
157161
};
158162
this.marker = new google.maps.Marker(pref);
159163

0 commit comments

Comments
 (0)