[mapguide-internals] Fwd: Feature stylization draw order question
Traian Stanev
traian.stanev at autodesk.com
Sun Nov 22 18:42:29 EST 2009
You could reduce the cost of the second (non-label) draw by drawing an almost transparent rectangle instead of the symbol geometry in the rendering pass that's used for tooltips -- drawing the same symbol on top of itself can also have undesirable side effects on edge antialiasing.
Traian
________________________________________
From: mapguide-internals-bounces at lists.osgeo.org [mapguide-internals-bounces at lists.osgeo.org] On Behalf Of Walt Welton-Lair [walt.welton-lair at autodesk.com]
Sent: Sunday, November 22, 2009 4:21 PM
To: MapGuide Internals Mail List
Subject: RE: [mapguide-internals] Fwd: Feature stylization draw order question
I think tooltips are missing because nothing is being drawn during the regular rendering pass. Tooltips are not generated against labels.
Another side affect to using a symbol label alone is that nothing is drawn in the legend for that layer - label symbols are not included in legend icons.
I think you can fix both issues by adding a second non-label version of your symbol to the composite symbolization (a second symbol instance). The non-label symbol is configured with DrawLast and AddToExclusionRegion set to false - it will be used for the legend icon and tooltips. You want AddToExclusionRegion false so it doesn't affect labels on other layers. And no need to specify CheckExclusionRegion - it doesn't apply since it's not a label. The label symbol - the one you already have - is configured with DrawLast / AddToExclusionRegion set to true and CheckExclusionRegion set to false. This one should draw exactly on top of the first one to give you the final visual effect you want. It will be a little slower because you're rendering two symbols, but as long as you don't have gobs of point features it shouldn't be noticeable.
Walt
________________________________________
From: mapguide-internals-bounces at lists.osgeo.org [mapguide-internals-bounces at lists.osgeo.org] On Behalf Of Jason Birch [jason at jasonbirch.com]
Sent: Sunday, November 22, 2009 5:23 AM
To: MapGuide Internals Mail List
Subject: Re: [mapguide-internals] Fwd: Feature stylization draw order question
Thanks very much for the fix and the detailed explanation; it really does
help to understand how this stuff interacts. And sorry for not spotting the
DrawLast property myself. I must have been staring at the .xsd for too long
or something.
I had to put the new-style point layer below the old-style layers in the map
definition in order for it to be rendered on top of them. This makes sense
as you've describe the rendering process; graphics first in layer order,
then labels in reverse order. I was just a bit fuzzy on the instructions.
There does appear to be a nasty side-effect which I think derails this for
me: the new symbol, when rendered as a label, no longer appears to
participate in tooltip generation. Is this expected behaviour?
I've uploaded a package which demonstrates this (only contains the street
numbers and emergency services points) here:
http://www.jasonbirch.com/temp/JasonSymbolProblem.mgp
If you comment out the DrawLast property in the emergency services layer
definition and then reload the test map, the tooltips on the fire admin
building show up properly.
If this isn't expected, I'll file a defect report. Otherwise maybe an
enhancement report to allow "label" layers to have tooltips :)
I really appreciate the time you took to look into this for me initially,
and please don't feel obligated to continue down this path if you don't have
the time.
Thanks again,
Jason
2009/11/21 Walt Welton-Lair
> Fix has been submitted.
>
> I attached a small image as an example (it may get dropped by the osgeo
> email server):
> * the yellow triangles are a regular old stylization point layer
> * the grey text boxes are regular feature labels for the previous layer
> * the orange squares are for a different point layer, configured using the
> new stylization as below
> The orange squares draw nicely on top of the text labels.
>
>
_______________________________________________
mapguide-internals mailing list
mapguide-internals at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
_______________________________________________
mapguide-internals mailing list
mapguide-internals at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
More information about the mapguide-internals
mailing list