Skip to main content
Became Hot Network Question
naming
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

How to combine Combine attribute and zoom based style in GeoserverGeoServer using CSS styling

Is it possible to use attribute and zoom based condition to apply CSS style in Geoserver.GeoServer? I have a point layer, I would like to use attribute and zoom based condition to apply a colour style and sizes at different zoom levels. I have tried different code combinations but not been successful. Below is my latest attempt but the style is not applied.

* {
    label: [No];
    mark: symbol(circle);
   
      :mark {
     [@sd >0][@sd <=6000]{  mark-size: 50m;    font-size: 25;};
     [@sd > 6000] [@sd <= 12000]{    mark-size: 25px;    font-size: 25;};
     [@sd >12000] [@sd <= 24000]{    mark-size: 50px;    font-size: 25;};
     [@sd >24000] [@sd <= 48000]{    mark-size: 750px;    font-size: 25;};

    [Km > 245] [Km <= 295]  { fill: blue;};
    [Km > 295] [Km <= 345]  { fill: pink;};
    [Km > 345] [Km <= 395]  { fill: yellow;};
    [Km > 395]              { fill: orange;};
  }
}

How to combine attribute and zoom based style in Geoserver using CSS styling

Is it possible to use attribute and zoom based condition to apply CSS style in Geoserver. I have a point layer, I would like to use attribute and zoom based condition to apply a colour style and sizes at different zoom levels. I have tried different code combinations but not been successful. Below is my latest attempt but the style is not applied.

* {
    label: [No];
    mark: symbol(circle);
   
      :mark {
     [@sd >0][@sd <=6000]{  mark-size: 50m;    font-size: 25;};
     [@sd > 6000] [@sd <= 12000]{    mark-size: 25px;    font-size: 25;};
     [@sd >12000] [@sd <= 24000]{    mark-size: 50px;    font-size: 25;};
     [@sd >24000] [@sd <= 48000]{    mark-size: 750px;    font-size: 25;};

    [Km > 245] [Km <= 295]  { fill: blue;};
    [Km > 295] [Km <= 345]  { fill: pink;};
    [Km > 345] [Km <= 395]  { fill: yellow;};
    [Km > 395]              { fill: orange;};
  }
}

Combine attribute and zoom based style in GeoServer using CSS styling

Is it possible to use attribute and zoom based condition to apply CSS style in GeoServer? I have a point layer, I would like to use attribute and zoom based condition to apply a colour style and sizes at different zoom levels. I have tried different code combinations but not been successful. Below is my latest attempt but the style is not applied.

* {
    label: [No];
    mark: symbol(circle);
   
      :mark {
     [@sd >0][@sd <=6000]{  mark-size: 50m;    font-size: 25;};
     [@sd > 6000] [@sd <= 12000]{    mark-size: 25px;    font-size: 25;};
     [@sd >12000] [@sd <= 24000]{    mark-size: 50px;    font-size: 25;};
     [@sd >24000] [@sd <= 48000]{    mark-size: 750px;    font-size: 25;};

    [Km > 245] [Km <= 295]  { fill: blue;};
    [Km > 295] [Km <= 345]  { fill: pink;};
    [Km > 345] [Km <= 395]  { fill: yellow;};
    [Km > 395]              { fill: orange;};
  }
}
Source Link
mapperx
  • 1.5k
  • 3
  • 14
  • 32

How to combine attribute and zoom based style in Geoserver using CSS styling

Is it possible to use attribute and zoom based condition to apply CSS style in Geoserver. I have a point layer, I would like to use attribute and zoom based condition to apply a colour style and sizes at different zoom levels. I have tried different code combinations but not been successful. Below is my latest attempt but the style is not applied.

* {
    label: [No];
    mark: symbol(circle);
   
      :mark {
     [@sd >0][@sd <=6000]{  mark-size: 50m;    font-size: 25;};
     [@sd > 6000] [@sd <= 12000]{    mark-size: 25px;    font-size: 25;};
     [@sd >12000] [@sd <= 24000]{    mark-size: 50px;    font-size: 25;};
     [@sd >24000] [@sd <= 48000]{    mark-size: 750px;    font-size: 25;};

    [Km > 245] [Km <= 295]  { fill: blue;};
    [Km > 295] [Km <= 345]  { fill: pink;};
    [Km > 345] [Km <= 395]  { fill: yellow;};
    [Km > 395]              { fill: orange;};
  }
}