Thank you David, that was a huge help!

Ok, the part of the documentation I found confusing was in how to actually make 
reference to the Hospital mark that the example defined.  I could understand 
the construction of the symbol but wasn't then sure how to assign it to points. 
It would also have helped if there was an explanation of what "usage" was doing.

I have one more question in this area which I can't find any documentation for..

I would like to define a rule which uses an external SVG file as a symbol for a 
point. How is this done in CSS? I have tried the following without success:

  mark: url(MySymbol.svg);

Where MySymbol.svg is located in the data_dir/styles directory.

Thanks

Chris


From: David Winslow [mailto:[email protected]]
Sent: 06 March 2012 18:06
To: Chris Haste; geoserver-users
Cc: [email protected]
Subject: Re: Geoserver CSS Module

Hi Chris,

I hope it's not a big deal to bring this to the users list; in general I prefer 
to answer CSS questions there so Google can help the next person to have your 
problem ;)

Yes, the docs are a bit confusing. (It's a common trap for developers - in SLD, 
styled marks rely heavily on nested XML structure, so finding a decent way to 
encode this in CSS was kind of tricky.  Then when I wrote up the documentation 
I only gave an example of the most complicated case - using multiple different 
symbols with different styling.  If you have suggestions on clarifying the 
documentation here I would be happy to incorporate some edits.)

Anyway, for basic styled marks, it's fairly straightforward: you can think of 
the mark as a new, polygon geometry and use stroke and fill parameters for 
that.  A rule with ":mark" in its selector will match these synthetic 
geometries (":stroke", ":fill", and ":shield" work for geometries generated for 
stroke patterns, fill patterns, and label shields respectively, and you can 
also use ":symbol" to match any generated symbol.)

You need at least two rules: one to generate this synthetic geometry, and one 
to style it (but as a convenience, if you don't style it it will have a 
grey/black theme.)

* {
  mark: symbol('circle');
}

* :mark {
  fill: red;
  stroke: black;
}

Or, specifically for the example you gave:

[@scale>34000000][@scale<69000000][longest_runway_ft>8000]{
  mark: symbol('circle');
  mark-size: 2;
  halo-radius: 3;
  halo-color: #FFFFFF;
  label: [icao_identifier];
  label-offset: 0.0 0.0;
  label-anchor: 0 0.5;
  -gt-label-padding: 20;
  -gt-label-priority: [longest_runway_ft];
}

[@scale>34000000][@scale<69000000][longest_runway_ft>8000]
:mark {
  fill: #FF0000;
}

--
David Winslow
OpenGeo - http://opengeo.org/

On Tue, Mar 6, 2012 at 6:30 AM, Chris Haste 
<[email protected]<mailto:[email protected]>> wrote:
Hi David,

I hope you will forgive the direct email.

I have been evaluating your CSS styling module for Geoserver. I am relatively 
new to Geoserver fullstop, but must say that I think the CSS option is a 
massive improvement over having to work with SLD, so a big thank you for the 
work being done in this area.

My question is probably quite a simple one but for the life of me I cannot find 
the answer anywhere!

I wish to use marks on my map (circles) and I wish them to be coloured based on 
an attribute of the data. I don't seem to be able to get any colour info to a 
symbol using CSS. I looked at the example of a hospital symbol, which would 
imply that it can be done, but I couldn't try this as I didn't know how to 
reference the 'hospital' as a mark (I tried - mark: symbol('hospital') but that 
didn't work).

As an example here is a CSS rule that I am defining:
[@scale>34000000][@scale<69000000][longest_runway_ft>8000]{
  mark: symbol('circle');
  mark-size: 2;
  fill: #FF0000;
  halo-radius: 3;
  halo-color: #FFFFFF;
  label: [icao_identifier];
  label-offset: 0.0 0.0;
  label-anchor: 0 0.5;
  -gt-label-padding: 20;
  -gt-label-priority: [longest_runway_ft];
}

The fill:#FF0000; line is where I am expecting it to render red circles, but I 
just get grey ones!

I think this problem is a result of what I am doing and not necessarily a bug 
etc. so I would appreciate if you could tell me where I'm going wrong?

Many thanks

Chris

*** This communication has been sent from World Fuel Services
Corporation or its subsidiaries or its affiliates for the intended recipient
only and may contain proprietary, confidential or privileged information.
If you are not the intended recipient, any review, disclosure, copying,
use, or distribution of the information included in this communication
and any attachments is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to this
communication and delete the communication, including any
attachments, from your computer. Electronic communications sent to or
from World Fuel Services Corporation or its subsidiaries or its affiliates
may be monitored for quality assurance and compliance purposes.***

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to