comparison war/scripts/sti/STIMap.js @ 75:d69066d16e45 trimmed_data

load overlays from data-file
author Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
date Tue, 15 Jan 2013 16:32:25 +0100
parents eac73bf1ce6e
children 7b65d95735d2
comparison
equal deleted inserted replaced
74:caca95f925cc 75:d69066d16e45
1375 this.openlayersMap.removeLayer(this.overlayLayers[index]); 1375 this.openlayersMap.removeLayer(this.overlayLayers[index]);
1376 this.overlayLayers[index] = null; 1376 this.overlayLayers[index] = null;
1377 1377
1378 } else { 1378 } else {
1379 1379
1380 var limesLayer = new OpenLayers.Layer.Vector("KML", { 1380 var newLayer = new OpenLayers.Layer.Vector("KML", {
1381 projection: this.openlayersMap.displayProjection, 1381 projection: this.openlayersMap.displayProjection,
1382 strategies: [new OpenLayers.Strategy.Fixed()], 1382 strategies: [new OpenLayers.Strategy.Fixed()],
1383 protocol: new OpenLayers.Protocol.HTTP({ 1383 protocol: new OpenLayers.Protocol.HTTP({
1384 url: "data/overlay/limes.kml", 1384 url: this.core.overlays[index].url,
1385 format: new OpenLayers.Format.KML({ 1385 format: new OpenLayers.Format.KML({
1386 extractStyles: true, 1386 extractStyles: true,
1387 extractAttributes: true 1387 extractAttributes: true
1388 }) 1388 })
1389 }) 1389 })
1390 }); 1390 });
1391 this.openlayersMap.addLayer(limesLayer); 1391 this.openlayersMap.addLayer(newLayer);
1392 1392
1393 this.overlayLayers[index] = limesLayer; 1393 this.overlayLayers[index] = newLayer;
1394
1395 //limesLayer.setVisibility(true);
1396 } 1394 }
1397 }, 1395 },
1398 1396
1399 configure: function(zoom,cLon,cLat,mapId){ 1397 configure: function(zoom,cLon,cLat,mapId){
1400 this.openlayersMap.zoomTo(zoom); 1398 this.openlayersMap.zoomTo(zoom);