Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add custom control button to leafletmap
//Add center result control button
L.easyButton({
states: [{
stateName: 'zoom-to-forest',
icon: 'glyphicon glyphicon-screenshot',
title: 'Center map to heat results',
onClick: function(btn, map) {
if (typeof $scope.heatLayer != 'undefined'
&& typeof $scope.maxGlobalHeat != 'undefined') {
map.setView($scope.maxGlobalHeat, 10);
}
}
}]
}).addTo(map);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment