[mapguide-internals] Fix for low performance while generating legend

Bruno Scott bscott at geomapgis.com
Wed Jul 15 08:43:19 EDT 2009

Hi Arthur
Great patch, thanks a lot for sharing it with us.
I was about to do something similar but little simpler.
Yours is more flexible.
I've tested it and it works well.

Thanks again
Bruno Scott

Arthur Liu wrote:
> Hi all,
> I've fixed the issue for the low performance while generating
> legend(Ticket #1023<https://trac.osgeo.org/mapguide/ticket/1023>). Would
> you please review it at
> https://trac.osgeo.org/mapguide/attachment/ticket/1023/Dynamic%20Legend.patch?
> Thanks.
> Some comments:
> The original implementation is generate all legend images for layers in
> the legend after the map loaded at one time. This will bring some
> performance issue(too many http requests).
> To resolve this problem, we could generate the legend on demand. Generate
> a legend picture only when
> 1. The corresponding layer is visible in current scale.
> 2. The legend node is visible in the legend tree. (If any parent node of a
> legend node is collapsed, then the legend node is invisible).
> I added a new property " iconWasRequested" for LayerItem and
> ScaleRangeItem (used for organize theme) in legend.js.  This is a flag to
> mark whether the legend image has been requested or not. The default value
> is false.  If the item displayed in the legend, the value will be set to
> true.  If the  item's legend image changed but the item is in a collapsed
> item, then the value will be set back to false, the HTTP request to
> generate the legend image will be sent out while the parent node expanded.
> Arthur Liu
> Software Development Engineer,
> Autodesk(r)
> Office: 86-21-38664317
> Mobile: 86-138-1658-3400
> Address: No 399, Pudian Road,  Pudong New District,
> Shanghai, 200122 China
> _______________________________________________
> mapguide-internals mailing list
> mapguide-internals at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-internals

View this message in context: http://n2.nabble.com/Fix-for-low-performance-while-generating-legend-tp3260862p3262948.html
Sent from the MapGuide Internals mailing list archive at Nabble.com.

More information about the mapguide-internals mailing list