[mapguide-users] change layer definition runtime

Jackie Ng jumpinjackie at gmail.com
Tue Sep 6 21:03:01 PDT 2016


You have to manipulate MgMap/MgLayer objects, so you have to use a
server-side script. It doesn't have to be .net. It could be in Java or PHP.
But it has to be one of the 3 languages which can work with the MapGuide Web
API.

Your script needs to take in mapname/sessionid and do the following:

 - Opens the MgMap from the mapname
 - Finds the matching MgLayer in the map's layer collection by its layer
name
 - Make a new MgLayer that points to your new layer definition
 - Replace the matching MgLayer with your new MgLayer
   - Insert the new MgLayer to the layer collection at the matching index of
the old MgLayer
   - Remove the old MgLayer from the layer collection
 - Save the map state and trigger a map refresh back on the client-side

- Jackie



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/change-layer-definition-runtime-tp5284382p5284422.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list