Right now, that is really the only way to refresh the legend - it currently gets its information from the map widget about which layers make up the map. And the only way to tell the map to add a layer that was dynamically added from the server is to call reloadMap.

I agree that this is a performance problem. Currently, the Map widget retrieves a lot of potentially unnecessary information about the layers and it would be nice to refactor this to be a bit smarter. We would still need to call reloadMap I think but we could slim down what happens on the server side (in LoadMap.php) to just return the layer list rather than enumerate all the scale ranges and styles of each layer. Then the Legend can be a bit smarter about requesting the scale range and style information for just layers that have changed.

I've filed http://trac.osgeo.org/fusion/ticket/75 to track this change, but it won't be something we tackle for a while - patches graciously accepted if someone else wants to tackle it.

Cheers

Paul

On 6-Jun-08, at 4:44 AM, foolfish wrote:


i can use document.getElementById("Map").widget.aMaps[0].reloadMap() to
refresh both Legend and Map.but the problem is it's too slow~

i want to know how to refresh Legend alone.

Perhaps it's a bug of fusion, i guess~

Can anyone answer to me?:thinking:
--
View this message in context: 
http://www.nabble.com/how-to-refresh-legend-panel-when--create-a-dynamic-layer----tp17661588p17687425.html
Sent from the MapGuide Users mailing list archive at Nabble.com.

_______________________________________________
mapguide-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users

_______________________________________________
mapguide-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Reply via email to