[OpenLayers-Users] Layer Styling - Column names
uk52rob
uk52rob at yahoo.co.uk
Thu Jul 19 14:38:04 PDT 2012
I'm having issues getting OpenLayers.Style to pick up my column names as they have a period in their names, e.g. 'sites.name'
Here is an example:
var style = new OpenLayers.Style();
//rule used for all polygons
var rule_sites = new OpenLayers.Rule({
symbolizer: {
fillColor: "#ff9a9a",
fillOpacity: 0.5,
strokeColor: "#000000",
strokeWidth: 1,
strokeDashstyle: "solid",
label: " ${sites.name}",
labelAlign: "cc",
fontColor: "#333333",
fontOpacity: 0.9,
fontFamily: "Arial",
fontSize: 14}
});
This simply displays '${sites.name}' on the map, whereas if I change the column name from 'sites.name' to 'name' it works fine.
I have tried '${sites\\.name}' to escape the period, but this does not work.
Does anyone know how to get around this (without having to change the column names..)?
Thanks,
Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120719/cce1e5ab/attachment.html>
More information about the Users
mailing list