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
|
var Style_villes = new OpenLayers.StyleMap(
{
"default": new OpenLayers.Style(
{
pointRadius:0,
fillText:'black',
label:'${label}',
// labelBackgroundColor:'black',
fontFamily:'Comic Sans MS',
fontSize:'12',
fontWeight:'bold',
fontColor:'white',
labelXOffset: "${xOffset}",
labelYOffset: "${yOffset}",
labelOutlineColor: "black",
labelOutlineWidth: 3 },
{
context: {
label: function(feature)
{
return feature.attributes.NOM_COMM;
}
}
}
)
}
);
var layer_villes = new OpenLayers.Layer.Vector(
"Principales villes",
{
styleMap:Style_villes,
projection: map.displayProjection,
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP(
{
url: "./KML/centroide_capitale_prefecture.geojson",
format: new OpenLayers.Format.GeoJSON()
}
)
}
); |
Partager