Legend icons for annotation layers are not always drawn #4641

Closed
szekerest opened this Issue Apr 29, 2013 · 13 comments

Projects

None yet

2 participants

@szekerest
Member

No description provided.

@szekerest szekerest was assigned Apr 29, 2013
@tbonfort
Member

@szekerest please be more precise. Multiple labels are clearly not supported with annotation layers, and therefore label expressions neither. Annotation layers wil be going away very soon and are marked as deprecated, there's no reason to have expressions inside a label for annotation layers.

@szekerest
Member

@tbonfort In case of MS_LAYER_ANNOTATION label->status may set to MS_OFF by the rendering code. Therefore the legend image "Az" is not drawn. The status should always set to MS_ON when drawing the legend icons.
We should think it over how we deprecate annotation layers without loosing many of the features behind.

@tbonfort
Member

Which features are left behind? To my knowledge, there are none.

@szekerest
Member

For example rendering text legend icons for layers which contain annotations only.

@tbonfort
Member

please post the layer definition when your annotation layer does not show up in the legend.

@szekerest
Member

LAYER
CONNECTION "C:\IntraMaps\SampleData\Spatial\suburbs_bdry.TAB"
CONNECTIONTYPE OGR
LABELITEM "Suburb"
METADATA
"coordsys_name" "AGD66 / AMG zone 50"
END # METADATA
NAME "suburbs_bdry"
PROJECTION
"proj=utm"
"zone=50"
"south"
"ellps=aust_SA"
"towgs84=-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29"
"units=m"
"no_defs"
END # PROJECTION
STATUS ON
TEMPLATE "query"
TILEITEM "location"
TYPE ANNOTATION
UNITS METERS
CLASS
NAME "Class (0)"
LABEL
EXPRESSION ('[Suburb]' = 'Munster')
FONT "arial"
SIZE 15
COLOR 255 0 0
OFFSET 0 0
POSITION CC
SHADOWSIZE 1 1
TYPE TRUETYPE
END # LABEL
STYLE
COLOR 255 255 255
OUTLINECOLOR 0 0 0
END # STYLE
TEMPLATE "query.html"
END # CLASS
END # LAYER

@tbonfort
Member

Well, as I said, expressions inside an annotation layer are not supported. The ticket could be changed to " render 'Az' string in legend icon" when layer contains no styles or label styles.

@szekerest
Member

The title you mention would apply for another ticket as it would provide a new feature. I just wanted to fix a problem which have been working before the label->status thing was introduced.
We may probably rename the issue as "Legend icons for annotation layers are not always drawn". This also applies to mapscript when calling drawLegendIcon for the layer having label expressions.

@tbonfort
Member

label->status is not used in maplegend.c, so the problem is probably elsewhere

@szekerest
Member

Fix committed. I think the problem is less than we made such amount of efforts for it.

@tbonfort
Member

So instead of adding the same functionality to point layers that have no markers defined , you/we now have a reason to fight against the deprecation of annotation layers, that I have the pleasure to keep maintaining ...

@szekerest
Member

Adding the new option you mentioned would require more consideration and testing. Now I just wanted to fix an issue a client has reported. Later I'll probably find some more time to provide a more sophisticated solution.

@tbonfort
Member

fixed for annotation layers in 6.4 by tamas, and implemented for point layers with no symbols in the rfc98 branch for 7.0 (#4673) . c.f. tbonfort/msautotest@0594325 tbonfort/msautotest@918e6b6

@tbonfort tbonfort closed this Jul 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment