1

I know that the

<VendorOption name="partials">true</VendorOption> 

SLD directive would fix my issue with labels not rendering in my tiles when I want them to and I would add to my SLD style had I written it in SLD format. But I've developed my style directives with CSS.

There are certainly CSS directives that say they do the same as this VendorOption or that VendorOption.

I cannot find documentation of a CSS version of the "partials" vendor option. Nor any documentation on how to specify an arbitrary "VendorOption" using CSS.

Did I miss it somewhere? Or is this something to consider adding to the CSS spec?

1
  • FYI - I did find a work around to this, it's not elegant but it works great. Use CSS to style. When happy with the results, save it. This actually compiles the CSS into SLD. If you look in your Styles folder, you'll see the CSS and SLD versions. I then copied the contents of the SLD and created a new SLD style with a slightly different name ("asSLD" suffix), and proceeded to add the vendor options I want in the SLD where they belong. Whenever I change the CSS, I have to redo this step, but it doesn't change often...
    – Brian B
    Commented Jun 13, 2022 at 13:08

4 Answers 4

2

It seems not to be implemented in the CSS parser so if you wanted to you could (or sponsor someone else to) provide a pull request to implement it.

Update

This is now implemented in GeoTools 26.5 and 27.1 and later.

2
  • Ian Turton, I see you are a geotools developer :-) - any interest in either being sponsored or giving me some guidance - perhaps another vendor option that is supported I can mimic? I've cloned the source but have very limited time I can put into this at the moment, and it was not intuitively obvious after looking at it briefly...
    – Brian B
    Commented Dec 10, 2018 at 17:55
  • Post a proposal on the user list and people can bid on it. Should be fairly reasonable
    – Ian Turton
    Commented Dec 10, 2018 at 18:56
1

The Geoserver CSS code for VendorOption "partials" for labels is

label-partials: false;

The VendorOptions are available in newer Geoserver versions that utilized newer implementation of GeoTools. Here is list of the CSS implementation of VendorOptions from the answer provided above by Ian Turton.

1

In the meantime, support for it has been added (around May 2022). The property is called "label-partials".

0

While I still can't do this directly in the CSS, I did find a work around to this. It's not elegant but it works great. Use CSS to style as you wish. When happy with the results (except for the lacking VendorOption), save it. This actually compiles the CSS into SLD format. If you look in your Styles folder, you'll see the CSS and SLD versions. I then copied the contents of the SLD and created a new SLD style with a slightly different name ("asSLD" suffix), and proceeded to add the vendor options I want in the SLD where they belong. Then use this new SLD based style. Whenever I change the CSS, I have to redo this step, but it doesn't change often.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.