Skip to content

Instantly share code, notes, and snippets.

@odoe

odoe/staticMap.js

Created Oct 5, 2015
Embed
What would you like to do?
function staticMap(map, isFrozen) {
if (isFrozen) {
map.layerIds.map(function (x) {
map.getLayer(x).suspend();
});
map.disableClickRecenter();
map.disableDoubleClickZoom();
map.disableKeyboardNavigation();
map.disableMapNavigation();
map.disablePan();
map.disableRubberBandZoom();
map.disableScrollWheelZoom();
map.disableShiftDoubleClickZoom();
map.hideZoomSlider();
} else {
map.layerIds.map(function (x) {
map.getLayer(x).resume();
});
map.enableClickRecenter();
map.enableDoubleClickZoom();
map.enableKeyboardNavigation();
map.enableMapNavigation();
map.enablePan();
map.enableRubberBandZoom();
map.enableScrollWheelZoom();
map.enableShiftDoubleClickZoom();
map.showZoomSlider();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment