Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Add custom control button to leafletmap
//Add center result control button
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment