<div dir="ltr">Layers with only labels (so the old ANNOTATION layers) wouldn't normally be queryable so things are as they are on purpose. I mean, labels are conditionally shown based on available space, they can spill out over other features and you can't actually query/click on a label. That doesn't mean there isn't room for improvement and I'd expect all label-only layers to behave the same way regardless of the underlying geometry type. I'd be fine with your suggestion and would suggest pushing the point case of label-only (I'm surprised it works as it does) to that same block of code.<div><br></div><div>--Steve </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 11, 2021 at 3:41 PM Tamas Szekeres <<a href="mailto:szekerest@gmail.com">szekerest@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Devs,<div><br></div><div>Currenly msDrawQueryLayer fails with error if the layer type is polygon, the querymap style is MS_HILITE, and the layer class contains only label elements.</div><div><br></div><div>Is this intentional?</div><div><br></div><div>The same setting works with the point layers (where the labels are being highlighted) so I guess it should also work with the polygon layers.</div><div><br></div><div>The corresponding code looks like this:</div><div><br></div><div> <i>if(layer->type == MS_LAYER_POLYGON) { /* alter BOTTOM style since that's almost always the fill */<br>        if (layer->class[i]->styles == NULL) {<br>          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);<br>          msFree(colorbuffer);<br>          msFree(mindistancebuffer);<br>          return(MS_FAILURE);<br>        }</i><br></div><div><br></div><div>however the classes with no styles can surely be handled later in the code:</div><div><br></div><div>} else if (layer->class[i]->numlabels > 0) {<br>          colorbuffer[i] = layer->class[i]->labels[0]->color;<br>          layer->class[i]->labels[0]->color = map->querymap.color;<br>      }</div><div><br></div><div>Should I prepare a fix for this problem?</div><div><br></div><div>Best regards,</div><div><br></div><div>Tamas</div><div><br></div></div>
_______________________________________________<br>
mapserver-dev mailing list<br>
<a href="mailto:mapserver-dev@lists.osgeo.org" target="_blank">mapserver-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapserver-dev</a><br>
</blockquote></div>