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

Arthur Liu arthur.liu at autodesk.com
Wed Jul 15 21:29:20 EDT 2009


I am afraid not. If a parent folder is unchecked but expanded, the sub-items' legend image should displayed in the legend, right?

Regards,
Arthur

-----Original Message-----
From: mapguide-internals-bounces at lists.osgeo.org [mailto:mapguide-internals-bounces at lists.osgeo.org] On Behalf Of Rock Beans
Sent: Thursday, July 16, 2009 1:37 AM
To: MapGuide Internals Mail List
Subject: Re: [mapguide-internals] Fix for low performance while generating legend

Does this also fix the redundant requests when parent item is unchecked?

On Tue, Jul 14, 2009 at 10:25 PM, Arthur Liu<arthur.liu at autodesk.com> 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,
> ACRD AEC IM,
> 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
>
_______________________________________________
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