Merge pull request #4018 from w33ble/fix/bounds-pointer

Fix zoom-to-bounds pointer
This commit is contained in:
Khalah Jones Golden 2015-06-02 20:44:22 -04:00
commit 81ecb7fb9b

View file

@ -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) {