Made Marker openPopup fail silently, closed #507
This commit is contained in:
parent
60f96281e7
commit
7889b692b0
@ -46,6 +46,7 @@ An in-progress version being developed on the master branch.
|
||||
* Added chaining to `DomEvent` methods.
|
||||
* Added `Map` `addHandler` method.
|
||||
* Moved dragging cursor styles from JS code to CSS.
|
||||
* Improved `Marker` `openPopup` not to raise an error if it doesn't have a popup. [#507](https://github.com/CloudMade/Leaflet/issues/507)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
|
5
dist/leaflet-src.js
vendored
5
dist/leaflet-src.js
vendored
@ -2681,9 +2681,8 @@ L.Popup = L.Class.extend({
|
||||
|
||||
L.Marker.include({
|
||||
openPopup: function () {
|
||||
this._popup.setLatLng(this._latlng);
|
||||
|
||||
if (this._map) {
|
||||
if (this._popup && this._map) {
|
||||
this._popup.setLatLng(this._latlng);
|
||||
this._map.openPopup(this._popup);
|
||||
}
|
||||
|
||||
|
2
dist/leaflet.js
vendored
2
dist/leaflet.js
vendored
File diff suppressed because one or more lines are too long
@ -4,9 +4,8 @@
|
||||
|
||||
L.Marker.include({
|
||||
openPopup: function () {
|
||||
this._popup.setLatLng(this._latlng);
|
||||
|
||||
if (this._map) {
|
||||
if (this._popup && this._map) {
|
||||
this._popup.setLatLng(this._latlng);
|
||||
this._map.openPopup(this._popup);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user