Skip to content

Commit

Permalink
Apply SLD from STYLEITEM field
Browse files Browse the repository at this point in the history
  • Loading branch information
geographika committed Mar 1, 2024
1 parent f52354f commit f4b35ae
Show file tree
Hide file tree
Showing 3 changed files with 187 additions and 131 deletions.
4 changes: 4 additions & 0 deletions src/mapdraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ imageObj *msDrawMap(mapObj *map, int querymap) {

lp = GET_LAYER(map, map->layerorder[i]);

// no need to apply style if we aren't drawing the layer
if (lp->status != MS_ON)
continue;

if (lp->styleitem && strncasecmp(lp->styleitem, "sld://", 6) == 0) {
char *filename = lp->styleitem + 6;

Expand Down
2 changes: 2 additions & 0 deletions src/maplayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,8 @@ int msLayerGetFeatureStyle(mapObj *map, layerObj *layer, classObj *c,
strncasecmp(stylestring, "symbol", 6) == 0 ||
strncasecmp(stylestring, "label", 5) == 0) {
msOGRUpdateStyleFromString(map, layer, c, stylestring);
} else if (strcasestr(stylestring, "StyledLayerDescriptor>") != NULL) {
msSLDApplySLD(map, stylestring, layer->index, NULL, NULL);
} else {
resetClassStyle(c);
}
Expand Down
Loading

0 comments on commit f4b35ae

Please sign in to comment.