Merge pull request #2838 from AndreyGeonya/master
Clickable option renamed to interactive
This commit is contained in:
commit
6e4c4cef82
@ -35,7 +35,7 @@
|
|||||||
opacity: 1,
|
opacity: 1,
|
||||||
smoothFactor: 1,
|
smoothFactor: 1,
|
||||||
color: 'red',
|
color: 'red',
|
||||||
clickable:true
|
interactive:true
|
||||||
}));
|
}));
|
||||||
|
|
||||||
polygons.on('click', function(m) {
|
polygons.on('click', function(m) {
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
[51, 7.000],
|
[51, 7.000],
|
||||||
[51.002, 7.004]
|
[51.002, 7.004]
|
||||||
],
|
],
|
||||||
{ clickable:false,color:'#f00' }
|
{ interactive:false,color:'#f00' }
|
||||||
).addTo(map);
|
).addTo(map);
|
||||||
|
|
||||||
// when the mouse hovers over the red route2, you cannot click through the blue route1 beneath
|
// when the mouse hovers over the red route2, you cannot click through the blue route1 beneath
|
||||||
|
6
dist/leaflet.css
vendored
6
dist/leaflet.css
vendored
@ -171,7 +171,7 @@
|
|||||||
|
|
||||||
/* cursors */
|
/* cursors */
|
||||||
|
|
||||||
.leaflet-clickable {
|
.leaflet-interactive {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.leaflet-container {
|
.leaflet-container {
|
||||||
@ -179,7 +179,7 @@
|
|||||||
cursor: -moz-grab;
|
cursor: -moz-grab;
|
||||||
}
|
}
|
||||||
.leaflet-crosshair,
|
.leaflet-crosshair,
|
||||||
.leaflet-crosshair .leaflet-clickable {
|
.leaflet-crosshair .leaflet-interactive {
|
||||||
cursor: crosshair;
|
cursor: crosshair;
|
||||||
}
|
}
|
||||||
.leaflet-popup-pane,
|
.leaflet-popup-pane,
|
||||||
@ -187,7 +187,7 @@
|
|||||||
cursor: auto;
|
cursor: auto;
|
||||||
}
|
}
|
||||||
.leaflet-dragging .leaflet-container,
|
.leaflet-dragging .leaflet-container,
|
||||||
.leaflet-dragging .leaflet-clickable {
|
.leaflet-dragging .leaflet-interactive {
|
||||||
cursor: move;
|
cursor: move;
|
||||||
cursor: -webkit-grabbing;
|
cursor: -webkit-grabbing;
|
||||||
cursor: -moz-grabbing;
|
cursor: -moz-grabbing;
|
||||||
|
@ -10,7 +10,7 @@ L.Marker = L.Layer.extend({
|
|||||||
icon: new L.Icon.Default(),
|
icon: new L.Icon.Default(),
|
||||||
// title: '',
|
// title: '',
|
||||||
// alt: '',
|
// alt: '',
|
||||||
clickable: true,
|
interactive: true,
|
||||||
// draggable: false,
|
// draggable: false,
|
||||||
keyboard: true,
|
keyboard: true,
|
||||||
zIndexOffset: 0,
|
zIndexOffset: 0,
|
||||||
@ -201,9 +201,9 @@ L.Marker = L.Layer.extend({
|
|||||||
|
|
||||||
_initInteraction: function () {
|
_initInteraction: function () {
|
||||||
|
|
||||||
if (!this.options.clickable) { return; }
|
if (!this.options.interactive) { return; }
|
||||||
|
|
||||||
L.DomUtil.addClass(this._icon, 'leaflet-clickable');
|
L.DomUtil.addClass(this._icon, 'leaflet-interactive');
|
||||||
|
|
||||||
L.DomEvent.on(this._icon, 'click dblclick mousedown mouseup mouseover mousemove mouseout contextmenu keypress',
|
L.DomEvent.on(this._icon, 'click dblclick mousedown mouseup mouseover mousemove mouseout contextmenu keypress',
|
||||||
this._fireMouseEvent, this);
|
this._fireMouseEvent, this);
|
||||||
|
@ -207,12 +207,12 @@ L.Canvas = L.Renderer.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_handleHover: function (layer, e, point) {
|
_handleHover: function (layer, e, point) {
|
||||||
if (!layer.options.clickable) { return; }
|
if (!layer.options.interactive) { return; }
|
||||||
|
|
||||||
if (layer._containsPoint(point)) {
|
if (layer._containsPoint(point)) {
|
||||||
// if we just got inside the layer, fire mouseover
|
// if we just got inside the layer, fire mouseover
|
||||||
if (!layer._mouseInside) {
|
if (!layer._mouseInside) {
|
||||||
L.DomUtil.addClass(this._container, 'leaflet-clickable'); // change cursor
|
L.DomUtil.addClass(this._container, 'leaflet-interactive'); // change cursor
|
||||||
layer._fireMouseEvent(e, 'mouseover');
|
layer._fireMouseEvent(e, 'mouseover');
|
||||||
layer._mouseInside = true;
|
layer._mouseInside = true;
|
||||||
}
|
}
|
||||||
@ -221,7 +221,7 @@ L.Canvas = L.Renderer.extend({
|
|||||||
|
|
||||||
} else if (layer._mouseInside) {
|
} else if (layer._mouseInside) {
|
||||||
// if we're leaving the layer, fire mouseout
|
// if we're leaving the layer, fire mouseout
|
||||||
L.DomUtil.removeClass(this._container, 'leaflet-clickable');
|
L.DomUtil.removeClass(this._container, 'leaflet-interactive');
|
||||||
layer._fireMouseEvent(e, 'mouseout');
|
layer._fireMouseEvent(e, 'mouseout');
|
||||||
layer._mouseInside = false;
|
layer._mouseInside = false;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ L.Path = L.Layer.extend({
|
|||||||
fillOpacity: 0.2,
|
fillOpacity: 0.2,
|
||||||
|
|
||||||
// className: ''
|
// className: ''
|
||||||
clickable: true
|
interactive: true
|
||||||
},
|
},
|
||||||
|
|
||||||
onAdd: function () {
|
onAdd: function () {
|
||||||
|
@ -56,8 +56,8 @@ L.SVG = L.Renderer.extend({
|
|||||||
L.DomUtil.addClass(path, layer.options.className);
|
L.DomUtil.addClass(path, layer.options.className);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (layer.options.clickable) {
|
if (layer.options.interactive) {
|
||||||
L.DomUtil.addClass(path, 'leaflet-clickable');
|
L.DomUtil.addClass(path, 'leaflet-interactive');
|
||||||
}
|
}
|
||||||
|
|
||||||
this._updateStyle(layer);
|
this._updateStyle(layer);
|
||||||
@ -116,7 +116,7 @@ L.SVG = L.Renderer.extend({
|
|||||||
path.setAttribute('fill', 'none');
|
path.setAttribute('fill', 'none');
|
||||||
}
|
}
|
||||||
|
|
||||||
path.setAttribute('pointer-events', options.pointerEvents || (options.clickable ? 'visiblePainted' : 'none'));
|
path.setAttribute('pointer-events', options.pointerEvents || (options.interactive ? 'visiblePainted' : 'none'));
|
||||||
},
|
},
|
||||||
|
|
||||||
_updatePoly: function (layer, closed) {
|
_updatePoly: function (layer, closed) {
|
||||||
|
Loading…
Reference in New Issue
Block a user