fix popup so that tip shadow is not cut off
This commit is contained in:
parent
dd1a134c50
commit
0e4e02a1d3
2
dist/leaflet.css
vendored
2
dist/leaflet.css
vendored
@ -288,7 +288,7 @@
|
||||
.leaflet-popup-tip-container {
|
||||
margin: 0 auto;
|
||||
width: 40px;
|
||||
height: 16px;
|
||||
height: 20px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ L.Popup = L.Class.extend({
|
||||
maxHeight: null,
|
||||
autoPan: true,
|
||||
closeButton: true,
|
||||
offset: new L.Point(0, 2),
|
||||
offset: new L.Point(0, 6),
|
||||
autoPanPadding: new L.Point(5, 5),
|
||||
className: ''
|
||||
},
|
||||
|
@ -3,10 +3,13 @@
|
||||
*/
|
||||
|
||||
L.Path.include({
|
||||
|
||||
bindPopup: function (content, options) {
|
||||
|
||||
if (!this._popup || this._popup.options !== options) {
|
||||
this._popup = new L.Popup(options, this);
|
||||
}
|
||||
|
||||
this._popup.setContent(content);
|
||||
|
||||
if (!this._openPopupAdded) {
|
||||
@ -17,6 +20,18 @@ L.Path.include({
|
||||
return this;
|
||||
},
|
||||
|
||||
openPopup: function (latlng) {
|
||||
|
||||
if (this._popup) {
|
||||
latlng = latlng || this._latlng ||
|
||||
this._latlngs[Math.floor(this._latlngs.length / 2)];
|
||||
|
||||
this._openPopup({latlng: latlng});
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_openPopup: function (e) {
|
||||
this._popup.setLatLng(e.latlng);
|
||||
this._map.openPopup(this._popup);
|
||||
|
Loading…
Reference in New Issue
Block a user