mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Merge pull request #4018 from w33ble/fix/bounds-pointer
Fix zoom-to-bounds pointer
This commit is contained in:
commit
81ecb7fb9b
1 changed files with 5 additions and 3 deletions
|
@ -171,7 +171,7 @@ define(function (require) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mapData && mapData.features.length > 0) {
|
if (mapData && mapData.features.length > 0) {
|
||||||
var fitContainer = L.DomUtil.create('div', 'leaflet-control leaflet-bar leaflet-control-zoom leaflet-control-fit');
|
var fitContainer = L.DomUtil.create('div', 'leaflet-control leaflet-bar leaflet-control-fit');
|
||||||
|
|
||||||
// Add button to fit container to points
|
// Add button to fit container to points
|
||||||
var FitControl = L.Control.extend({
|
var FitControl = L.Control.extend({
|
||||||
|
@ -179,10 +179,12 @@ define(function (require) {
|
||||||
position: 'topleft'
|
position: 'topleft'
|
||||||
},
|
},
|
||||||
onAdd: function (map) {
|
onAdd: function (map) {
|
||||||
$(fitContainer).html('<a class="leaflet-control-zoom fa fa-crop" title="Fit Data Bounds"></a>');
|
$(fitContainer).html('<a class="fa fa-crop" href="#" title="Fit Data Bounds"></a>')
|
||||||
$(fitContainer).on('click', function () {
|
.on('click', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
self.fitBounds(map, mapData.features);
|
self.fitBounds(map, mapData.features);
|
||||||
});
|
});
|
||||||
|
|
||||||
return fitContainer;
|
return fitContainer;
|
||||||
},
|
},
|
||||||
onRemove: function (map) {
|
onRemove: function (map) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue