Thursday, 14 April 2016

GeoServer CSS rotation with env and property name


Using GeoServer CSS extension


 mark-rotation:  [env('rot',2)];

ends in



    

rot
2



How should my style look like to add a property name to rotation:


 


mystyle

rot
2




I have tried


 mark-rotation:  [env('rot',2),mystyle];

mark-rotation: [mystyle],[env('rot',2)];

Answer



To produce a rotation of ( the rot variable or 2 ) plus the value of the property mystyle you should use:


mark-rotation: [env('rot',2)+mystyle]; 

To generate SLD that uses rot, followed by mystyle, or 2 you should use something like (and I haven't tested this). If it doesn't work you can check the syntax page:


mystyle is null {
mark-rotation: [env('rot',2)]
}
mystyle is not null {

mark-rotation: [mystyle];
}

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...