[OpenLayers-Users] OpenLayers.StyleMap + labelOutlineColor

Jürgen Dankoweit Juergen.Dankoweit at T-Online.de
Wed Feb 1 03:52:11 EST 2012


Hello to the list,

how to use the attribute "labelOutlineColor" in OpenLayers.StyleMap()?
When I use the following code, no white line or halo is drawn around
each letter of the label.
But the example "
http://openlayers.org/dev/examples/vector-features-with-text.html "
works and I see no difference between the example and my code.

Please help me to solve this problem. I'm using OpenLayers 2.11 with
FireFox 3.6.24 and Chrome 16.0.912.77, both browsers show the same effect.

Many thanks in advance.

Best regards

Juergen

My code:

var styleMap_Stadt = new OpenLayers.StyleMap({'default': {
 label : "\${text}",
 fontColor: '\${fcolor}',
 fontSize: "12pt",
 fontFamily: "serif",
 fontWeight: "bold",
 labelAlign: "ct",
 labelXOffset: 0,
 labelYOffset: 0,
 labelOutlineColor: "#FFFFFF",
 labelOutlineWidth: 3
}});
map.addLayer(new OpenLayers.Layer.Vector("Stadt", {
 styleMap: styleMap_Stadt,
 renderers: renderer,
 displayInLayerSwitcher: false
}));

point = new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat);
var pf = new OpenLayers.Feature.Vector(point);
if (pf) {
 pf.attributes = {text: stadt, fcolor: text_color};
 pf.fid = iaco;
 var vl = map.getLayersByName("Stadt")[0];
 if (vl)
  vl.addFeatures([pf]);
}

-- 
Meine stets unfertige Homepage: www.dankoweit.de


More information about the Users mailing list