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

Legend icons for annotation layers are not always drawn #4641

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

Legend icons for annotation layers are not always drawn #4641

szekerest opened this issue Apr 29, 2013 · 13 comments
Assignees

Comments

@szekerest
Copy link
Member

@szekerest szekerest commented Apr 29, 2013

No description provided.

@ghost ghost assigned szekerest Apr 29, 2013
@tbonfort
Copy link
Member

@tbonfort tbonfort commented Apr 29, 2013

@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
Copy link
Member Author

@szekerest szekerest commented Apr 29, 2013

@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
Copy link
Member

@tbonfort tbonfort commented Apr 29, 2013

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

@szekerest
Copy link
Member Author

@szekerest szekerest commented Apr 29, 2013

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

@tbonfort
Copy link
Member

@tbonfort tbonfort commented Apr 29, 2013

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

@szekerest
Copy link
Member Author

@szekerest szekerest commented Apr 29, 2013

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
Copy link
Member

@tbonfort tbonfort commented Apr 29, 2013

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
Copy link
Member Author

@szekerest szekerest commented Apr 29, 2013

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
Copy link
Member

@tbonfort tbonfort commented Apr 29, 2013

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

@szekerest
Copy link
Member Author

@szekerest szekerest commented Apr 29, 2013

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

@tbonfort
Copy link
Member

@tbonfort tbonfort commented Apr 29, 2013

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
Copy link
Member Author

@szekerest szekerest commented Apr 29, 2013

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
Copy link
Member

@tbonfort tbonfort commented Jul 23, 2013

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.