[OpenLayers-Users] Rotation based on database field

ramaralo mail.roliveira at gmail.com
Tue Apr 2 07:54:42 PDT 2013


I'm trying to create an OpenLayers.Rule like this:

var rule = new OpenLayers.Rule({
				name: " rule",
				filter: andFilter,
				symbolizer: {
					"Point": {
						rotation: model.pointAttributes.rotation
					}
				}
			});

this works fine if /model.pointAttributes.rotation/ is a Number and later
this rule will be converted to this SLD

<sld:Rotation>20</sld:Rotation>

when calling OpenLayers.Format.SLD().write where I pass an OpenLayers.Style
object wich contains the above OpenLayers.Rule.

*My problem is* I want to support String in /model.pointAttributes.rotation/
as well as Number. And if a String is provided the generated SLD should be
(imagine the value is "azimuth"):

<sld:Rotation><ogc:PropertyName>azimuth</ogc:PropertyName></sld:Rotation>

The point here is to make rotation, dependent on the azimuth database field.
This SLD works if built on Geoserver, but I want to create it dynamically on
the client side so I can append it to the sld_body parameter request.

I've looked into the openLayers api documentation, and can't seem to find a
way to create a PorpertyName SLD object or any other way to achieve the same
result.

Any ideas on how to solve this?

Thanks in advance.







--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Rotation-based-on-database-field-tp5044094.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list