Created
July 26, 2016 13:06
-
-
Save adriantre/5f1bf83fc1d8d35d1b6844453d4e4033 to your computer and use it in GitHub Desktop.
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
function updateMap() { | |
var oldLayerGroup = L.layerGroup(); | |
map.eachLayer(function (layer) { | |
if (layer instanceof L.GeoJSON) { | |
oldLayerGroup.addLayer(layer); | |
} | |
}); | |
getActiveDataLayers(); | |
clean_map(oldLayerGroup); | |
} | |
function getActiveDataLayers(callback) {// Denne må endres til å kalle funksjonene for de brukeraktiverte kartlagene | |
bb = map.getBounds(); | |
getDataWithBBox(["situations", "cctv", "travel_time_data"], bb); | |
callback(); | |
} | |
function clean_map(layerGroup) { | |
layerGroup.eachLayer(function (layer) { | |
if (layer instanceof L.GeoJSON) { | |
map.removeLayer(layer); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment