Skip to content

Commit

Permalink
Fix querymap failure for polygon layers with labels only (no styles) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
szekerest authored and jmckenna committed May 4, 2021
1 parent 7c05724 commit 782ee8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mapdraw.c
Expand Up @@ -1362,7 +1362,7 @@ int msDrawQueryLayer(mapObj *map, layerObj *layer, imageObj *image)
}

for(i=0; i<layer->numclasses; i++) {
if(layer->type == MS_LAYER_POLYGON) { /* alter BOTTOM style since that's almost always the fill */
if(layer->type == MS_LAYER_POLYGON && layer->class[i]->numstyles > 0) { /* alter BOTTOM style since that's almost always the fill */
if (layer->class[i]->styles == NULL) {
msSetError(MS_MISCERR, "Don't know how to draw class %s of layer %s without a style definition.", "msDrawQueryLayer()", layer->class[i]->name, layer->name);
msFree(colorbuffer);
Expand Down Expand Up @@ -1521,7 +1521,7 @@ int msDrawQueryLayer(mapObj *map, layerObj *layer, imageObj *image)
/* if MS_HILITE, restore color and mindistance values */
if(map->querymap.style == MS_HILITE) {
for(i=0; i<layer->numclasses; i++) {
if(layer->type == MS_LAYER_POLYGON) {
if(layer->type == MS_LAYER_POLYGON && layer->class[i]->numstyles > 0) {
if(MS_VALID_COLOR(layer->class[i]->styles[0]->color))
layer->class[i]->styles[0]->color = colorbuffer[i];
else if(MS_VALID_COLOR(layer->class[i]->styles[0]->outlinecolor))
Expand Down

0 comments on commit 782ee8b

Please sign in to comment.