Skip to content

Commit

Permalink
feat(Marker): prevent Marker from redrawing under clusters
Browse files Browse the repository at this point in the history
* Original commit: 414f676
* Original author: @amangeot
* Closes #397
  • Loading branch information
amangeot authored and tomchentw committed Apr 20, 2017
1 parent 15c925e commit 7849f28
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/Marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const controlledPropTypes = {

label: PropTypes.any,

noRedraw: PropTypes.bool,

opacity: PropTypes.number,

options: PropTypes.object,
Expand Down Expand Up @@ -211,7 +213,7 @@ export default _.flowRight(
);
const markerClusterer = this.context[MARKER_CLUSTERER];
if (markerClusterer) {
markerClusterer.addMarker(marker);
markerClusterer.addMarker(marker, !!this.props.noRedraw);
} else {
marker.setMap(this.context[MAP]);
}
Expand All @@ -231,7 +233,7 @@ export default _.flowRight(
if (marker) {
const markerClusterer = this.context[MARKER_CLUSTERER];
if (markerClusterer) {
markerClusterer.removeMarker(marker);
markerClusterer.removeMarker(marker, !!this.props.noRedraw);
}
marker.setMap(null);
}
Expand Down

0 comments on commit 7849f28

Please sign in to comment.