//
// modification de l'opacité d'une couche
//
http://openlayers.org/dev/examples/layer-opacity.html
this.changeOpacity = function(layer,newOpacity) {
console.log("changeOpacity(%s,%d)",layer.name,newOpacity);
var maxOpacity = 0.9;
var minOpacity = 0.1;
newOpacity = Math.min(maxOpacity,Math.max(minOpacity, newOpacity));
layer.setOpacity(newOpacity);
}
// fonctions pour faciliter l'impression
//
https://api.ign.fr/geoportail/faq.do?faqSubjectId=2
// modification des caractéristiques des couches avant impression
this.printLayers = function() {
console.log("printLayers()");
for(var i = 1; i < map.getMap().layers.length; i++){
var layer= map.getMap().layers[i];
if ( ! layer.params ) {
continue;
}
if(layer.params.LAYERS.search('ORTHOIMAGERY.ORTHOPHOTOS')!=-1) {
layer.setVisibility(false);
}
if(layer.params.LAYERS.search('GEOGRAPHICALGRIDSYSTEMS.MAPS')!=-1) {
layer.setVisibility(true);
layer.setOpacity(0.9);
}
}
}
Partager