var map;
var objectLayer;
+var objectLoader;
var layers = [
{
}
function addObjectToMap(object, zoom, callback) {
+ if (objectLoader) {
+ objectLoader.abort();
+ }
+
if (objectLayer) {
map.removeLayer(objectLayer);
}
- $.ajax({
+ objectLoader = $.ajax({
url: OSM.apiUrl(object),
dataType: "xml",
success: function (xml) {
}
function getMapLayers() {
+ var layerConfig = "";
for (var i = 0; i < layers.length; i++) {
if (map.hasLayer(layers[i].layer)) {
- return layers[i].layerCode;
+ layerConfig += layers[i].layerCode;
}
}
-
- return "";
+ return layerConfig;
}
function setMapLayers(layerConfig) {