I have came across similar questions and read through the documentations, so sorry if I missed something. I'm looking for a way to turn of transformations based on a zoom scale using CSS. For an example, I have written the following code to cluster points together using the point stacker:

[@sd >= 100k]{   
  transform: vec:PointStacker(cellSize:30, outputBBOX:env('wms_bbox'), outputWidth:env('wms_width'), outputHeight:env('wms_height'));
  mark: symbol("circle");

        fill:  [categorize(
         1, '#4866A3',
         25, '#26ADF2',
         50, '#53F08E',
         100, '#21E86D',
         200, '#FF9D35',
         400, '#EA4638')];
        stroke: black;
        size:  [categorize(
          1, 3,
         10, 5,
         25, 10,
         50, 15,
         100, 20,
         200, 30,
         400, 50)];

After a user has zoomed in (@sd < 100k), I would like to show single points categorized/recoded on a field, for an example:

[@sd < 100k]{

   mark: symbol(circle);
   :mark {
      fill: recode([HomeAddress_Confidence], 1,'#1A62C9', 2,'#F0FBF7', 3,'#0398EE', 4,'#3EEC83', 5,'#FFBE73', 6,'#D35230', 7,'#C90000') ;
      size: 5;

It seems that although PointStacker are within one rule it takes over the whole css and can't use attribute in other rules. I also included the different modes using @mode 'Eclusive', 'Flat', 'Simple' and 'Auto'. A possible work around is to create 2 separate CSS styles and create a group layer, but would like to avoid that if possible.


CSS eventually gets transformed to SLD, where transformations happen at the FeatureTypeStyle level. So you need to force two separate FeatureTypeStyles.

The translation code does not do it for you, but I believe you can force it manually by setting a different z-index in the two rules.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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