Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0 preview. Fix - dynamic markers update problems #375

Open
wants to merge 5 commits into
base: 2.0-preview
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions google-map-marker.html
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,8 @@
this._contentObserver = new MutationObserver( this._contentChanged.bind(this));
this._contentObserver.observe( this, {
childList: true,
subtree: true
subtree: true,
characterData: true
});

var content = this.innerHTML.trim();
Expand Down Expand Up @@ -458,9 +459,11 @@
},

_clearListener: function(name) {
if (this._listeners[name]) {
google.maps.event.removeListener(this._listeners[name]);
this._listeners[name] = null;
if (typeof this._listeners != 'undefined'){
if (this._listeners[name]) {
google.maps.event.removeListener(this._listeners[name]);
this._listeners[name] = null;
}
}
},

Expand Down
15 changes: 12 additions & 3 deletions google-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,15 @@
value: false,
observer: '_disableZoomChanged'
},

/**
* If true, prevent the user from zooming the map by mouse scroll wheel.
*/
disableScrollWheelZoom:{
type: Boolean,
value: false,
observer: '_disableZoomChanged'
},

/**
* If set, custom styles can be applied to the map.
Expand Down Expand Up @@ -457,7 +466,7 @@

detached: function() {
if (this._markersChildrenListener) {
this.unlisten(this.$.selector, 'items-changed', '_updateMarkers');
this.unlisten(this.$.selector, 'iron-items-changed', '_updateMarkers');
this._markersChildrenListener = null;
}
if (this._objectsMutationObserver) {
Expand Down Expand Up @@ -500,7 +509,7 @@
mapTypeControl: !this.disableDefaultUi && !this.disableMapTypeControl,
streetViewControl: !this.disableDefaultUi && !this.disableStreetViewControl,
disableDoubleClickZoom: this.disableZoom,
scrollwheel: !this.disableZoom,
scrollwheel: !this.disableScrollWheelZoom,
styles: this.styles,
maxZoom: Number(this.maxZoom),
minZoom: Number(this.minZoom)
Expand Down Expand Up @@ -531,7 +540,7 @@
if (this._markersChildrenListener) {
return;
}
this._markersChildrenListener = this.listen(this.$.selector, 'items-changed', '_updateMarkers');
this._markersChildrenListener = this.listen(this.$.selector, 'iron-items-changed', '_updateMarkers');
},

_updateMarkers: function() {
Expand Down