OpenLayers.StyleMap + labelOutlineColor

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

OpenLayers.StyleMap + labelOutlineColor

Jürgen Dankoweit
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
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers.StyleMap + labelOutlineColor

Steffen G
The question is a little bit old but here a answer:

The feature "label outline" is indroduced in OL 2.12. Maybe the examples worked with 2.12 and your local version with 2.11.