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 51 52 53 54 55 56 57 58
| function affiche() {
var symb1= {
'1' :{fillColor:'#0DF20D', strokeWidth:2},
'2' :{fillColor:'#008000', strokeWidth:2},
'3' :{fillColor:'#D99226', strokeWidth:2},
};
var contextMAJ = function(feature) {
return { 'CODE_ARR': feature.attributes['CODE_ARR'].value };
}
var styles = new OpenLayers.StyleMap({
"default": new OpenLayers.Style({
strokeColor:'#000000',
strokeWidth:2,
fillColor:'#ff00ff',
fillOpacity:0.5
}),
"temporary": new OpenLayers.Style({
strokeColor:'#00ff00',
strokeWidth:2,
fillColor:'#00ff00',
fillOpacity:0.5
}),
"select": new OpenLayers.Style({
strokeColor:'#00ff00',
strokeWidth:2,
fillColor:'#0000ff',
fillOpacity:0.5
})
});
styles.addUniqueValueRules('default','CODE_ARR',symb1,contextMAJ);
kmlLayer = viewer.getMap().addLayer(
"KML",
"communes",
"http://randonnee.pedestre85.free.fr/analysethematique/vendee.kml",
{
styleMap:styles,
visibility: true,
panMapIfOutOfView:false,
minZoomLevel: 6,
maxZoomLevel: 16
},
{
formatOptions:{
backgroundColor:'green',
opacity:0.75,
extractStyles:false // désactivation des styles
},
onSelect: ouvrePopup,
onUnselect: outPopup,
hover: false // Ouverture au sélect = false. Au survol = true
});
}//fin fonction |
Partager