1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| function init() {
var index = document.getElementById("legend_1_choix").legend_1.choix_n1.selectedIndex;
switch (index) {
case 1:
var SDL_choix = "http://localhost/SLD/SLD_alea_bleu.xml";
var val_opacity = 0;
break;
case 2:
var SDL_choix = "http://localhost/SLD/SLD_alea_bleu.xml";
var val_opacity = 0.5;
break;
case 3:
var SDL_choix = "http://localhost/SLD/SLD_alea_rouge.xml";
var val_opacity = 0.5;
break;
case 4:
var SDL_choix = "http://localhost/SLD/SLD_alea_bleu.xml";
var val_opacity = 0.5;
break;
case 1:
var SDL_choix = "http://localhost/SLD/SLD_alea_bleu.xml";
var val_opacity = 0.5;
break;
};
//code intermédiaire
var wms2 = new OpenLayers.Layer.WMS("alea", "http://localhost/cgi-bin/mapserv?map=/var/www/mapfile/alea_wms.map&",
{layers: "alea_raster",
transparent: true,
SLD: SDL_choix
},
{opacity: val_opacity
}
);
//code intermédiaire
map.addLayer(wms2); |