Created
June 27, 2016 17:19
-
-
Save rwoloszyn/81c383c4d694edc426e479eb2a4f4ed0 to your computer and use it in GitHub Desktop.
Add custom control button to leafletmap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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