<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span style="font-size: 12pt; ">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'</span><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span style="font-size: 12pt; "><br></span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span style="font-size: 12pt; ">Here is an example:</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div><div><div><font face="times new roman, new york, times, serif">var style = new OpenLayers.Style();</font></div><div><font face="times new roman, new york, times, serif">
//rule used for all polygons</font></div><div><font face="times new roman, new york, times, serif"> var rule_sites = new OpenLayers.Rule({</font></div><div><font face="times new roman, new york, times, serif"> symbolizer: {</font></div><div><font face="times new roman, new york, times, serif"> fillColor: "#ff9a9a",</font></div><div><font face="times new roman, new york, times, serif"> fillOpacity: 0.5,</font></div><div><font face="times new roman, new york, times, serif"> strokeColor: "#000000",</font></div><div><font face="times new roman, new york, times, serif"> strokeWidth:
1,</font></div><div><font face="times new roman, new york, times, serif"> strokeDashstyle: "solid",</font></div><div><font face="times new roman, new york, times, serif"> label: " ${sites.name}",</font></div><div><font face="times new roman, new york, times, serif"> labelAlign: "cc",</font></div><div><font face="times new roman, new york, times, serif"> fontColor: "#333333",</font></div><div><font face="times new roman, new york, times, serif"> fontOpacity: 0.9,</font></div><div><font face="times new roman, new york, times, serif"> fontFamily: "Arial",</font></div><div><font face="times new roman, new york, times, serif">
fontSize: 14}</font></div><div><font face="times new roman, new york, times, serif"> });</font></div><div><font face="times new roman, new york, times, serif"><br></font></div><div><font face="times new roman, new york, times, serif">This simply displays '</font><span style="font-family: 'times new roman', 'new york', times, serif; ">${sites.name}' on the map, whereas if I change the column name from 'sites.name' to 'name' it works fine.</span></div><div><span style="font-family: 'times new roman', 'new york', times, serif; "><br></span></div><div><span style="font-family: 'times new roman', 'new york', times, serif; ">I have tried '${sites\\.name}' to escape the period, but this does not work.</span></div><div><span style="font-family: 'times new roman', 'new york', times, serif; "><br></span></div><div><span style="font-family: 'times
new roman', 'new york', times, serif; ">Does anyone know how to get around this (without having to change the column names..)?</span></div><div><span style="font-family: 'times new roman', 'new york', times, serif; "><br></span></div><div><span style="font-family: 'times new roman', 'new york', times, serif; ">Thanks,</span></div><div><br></div><div><font face="times new roman, new york, times, serif">Rob</font></div></div></div></div></body></html>