Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Querymap fails for polygon layers with labels only (no styles) #6262

Closed
szekerest opened this issue Mar 14, 2021 · 1 comment
Closed

Querymap fails for polygon layers with labels only (no styles) #6262

szekerest opened this issue Mar 14, 2021 · 1 comment
Assignees
Milestone

Comments

@szekerest
Copy link
Member

Currenly msDrawQueryLayer fails with the following error if the layer type is polygon, the querymap style is MS_HILITE, and the layer class contains only label elements.

msDrawMap(): Image handling error. Failed to draw layer named '...'.;msDrawQueryLayer(): General error message. Don't know how to draw class Class (0) of layer ... without a style definition.

The same setting works with the point and line layers (where the labels are being highlighted) so I guess it should also work with the polygon layers.

The corresponding code looks like this:

 if(layer->type == MS_LAYER_POLYGON) { /* 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);
          msFree(mindistancebuffer);
          return(MS_FAILURE);
        }

however the classes with no styles can surely be handled later in the code:

} else if (layer->class[i]->numlabels > 0) {
          colorbuffer[i] = layer->class[i]->labels[0]->color;
          layer->class[i]->labels[0]->color = map->querymap.color;
      }
@szekerest szekerest self-assigned this Mar 14, 2021
@jmckenna jmckenna added this to the 8.0 Release milestone Mar 15, 2021
jmckenna added a commit that referenced this issue May 3, 2021
Fix querymap failure for polygon layers with labels only (no styles) (#6262)
@jmckenna
Copy link
Member

jmckenna commented May 3, 2021

Fixed by @szekerest through #6318

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants