Skip to content

Instantly share code, notes, and snippets.

@rwoloszyn
Created June 27, 2016 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rwoloszyn/81c383c4d694edc426e479eb2a4f4ed0 to your computer and use it in GitHub Desktop.
Save rwoloszyn/81c383c4d694edc426e479eb2a4f4ed0 to your computer and use it in GitHub Desktop.
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