[mapguide-users] Update legend information on runtime

Jackie Ng jumpinjackie at gmail.com
Wed Jan 30 04:33:13 PST 2019


864 layers !!!??? o_O

If you want to avoid a full legend rebuild, then your shortcut functions
that do the layer/group toggling should return some kind of changeset JSON
structure that the legend widget can use to update affected parts.

So just to spitball an example from your sample server-side code, you could
return a JSON structure like this:

{
    "show": {
        "layers": [<list of object ids of layers to set visible>],
        "groups": [<list of object ids of groups to set visible>]
    },
    "hide": {
        "layers": [<list of object ids of layers to set hidden>],
        "groups": [<list of object ids of layers to set hidden>]
    }
}

You'd then have to modify the legend widget so that you can pass this
structure to it, and using this information, update the widget's internal
representation of your map's layer/group data to match.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html


More information about the mapguide-users mailing list