[OpenLayers-Users] OpenLayers feature labeling - not working anymore

3Deography.net info at 3deography.net
Thu Oct 22 04:50:39 EDT 2009


Hi,

I just migrated from apache/mysql to tomcat/postgresql and everything's
working fine - except 1 thing:

I use custom style types to visualize spatial db-data and want to label
features on a vector layer. The label can be found within the features
attributes. But this won't work anymore. Any ideas?
The styleMap itself works because if I use a static string, it affects the
right features/layer and labels them. The attribute "style_map" exists as
the unique values for styling are switched, based on this field. If i try,
"title"... nothing changes.

Somehow, the labelling ${attribute_fiels} won't work. Any help would be
appreciated as I am stuck right now :-(


var styleMap = new OpenLayers.StyleMap(OpenLayers.Util.applyDefaults({
  fillOpacity: 0.7,
  strokeColor: "black"},
  OpenLayers.Feature.Vector.style["default"])
);

var style_types = {
  "gazetteer": {
    labelAlign: 'lb',
    label: "${style_type}",
    fontSize: "10px",
    fontColor: 'white',
    pointRadius: 3
  }
}

styleMap.addUniqueValueRules("default", "style_type", style_types);

And here how the sample feature is passed by:

...{ "type":
"Feature","properties":"title":"Germany","featureType":"country","style_type":"gazetteer","tooltip":"wiki"},...

The fields title and style_type definitely exist and contain values ;-)

Regards,
Martin
-- 
View this message in context: http://n2.nabble.com/OpenLayers-feature-labeling-not-working-anymore-tp3871085p3871085.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list