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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| // creation map + ajout couche
var map = new ol.Map({
target: 'map',
layers: [
maCouche1,
maCouche2
],
view: new ol.View({
center: [x,y],
zoom: monzoom
})
});
// ajout + configuration LayerSwitcher
var lsControl = new ol.control.LayerSwitcher({
layers : [{
layer: maCouche1,
config: {
title: "Titre Couche 1",
description: "Description Couche 1",
legends:[{
url:"URL_vers_Legende_couche1_200000_500000",
minScaleDenominator: 200000,
maxScaleDenominator: 5000000
},
{
url:"URL_vers_Legende_couche1_500000_1000000",
minScaleDenominator: 500000,
maxScaleDenominator: 10000000
}]
}
},
{
layer: maCouche2,
config: {
title: "Titre Couche 2",
description: "Description Couche 2",
legends:[{
url:"URL_vers_Legende_couche2_200000_500000",
minScaleDenominator: 200000,
maxScaleDenominator: 5000000
},
{
url:"URL_vers_Legende_couche2_500000_1000000",
minScaleDenominator: 500000,
maxScaleDenominator: 10000000
}]
}
}]
}); |
Partager