[OpenLayers-Users] Styling point features by attribute values
Vishal Mehta
vishalm1975 at gmail.com
Thu Jun 16 12:38:55 EDT 2011
I'm trying to get point features ( in a vector kml layer) size to scale with
an attribute value named "Water_Leve"
I tried to test this in Firebug like this:
map.layers[1].styleMap.styles.default.defaultStyle.pointRadius='${Water_Leve}';
and got the error message:
Unexpected value ${Water_Leve} parsing r attribute.
I think that the attribute may have been registered as a string when i
created the kml file from a shapefile earlier (is there a quick way to check
the data type of an attribute in firebug?)
So i tried to convert it to float on the fly like this:
map.layers[1].styleMap.styles.default.defaultStyle.pointRadius=parseFloat('${Water_Leve}');
and got the message:
Unexpected value NaN parsing r attribute.
Can someone help me get this right?
Thanks,
Vishal
--
Vishal K. Mehta, PhD
Scientist
Stockholm Environment Institute - US
133 D St Suite F
Davis CA 95616
www.sei-us.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110616/3b071f0d/attachment.html
More information about the Users
mailing list