[mapguide-users] Trouble Adding Existing Layers Programmatically

Jason Birch Jason.Birch at nanaimo.ca
Wed Dec 20 10:18:19 EST 2006


Code might help with diagnosis.
 
You're saving the map back to the session repository after adding the layer, right?
 
Jason
 

________________________________

From: Buscher, Shane
Sent: Wed 2006-12-20 5:48 AM
To: users at mapguide.osgeo.org
Subject: [mapguide-users] Trouble Adding Existing Layers Programmatically 



I have some layers that exist in my repository, but aren't added to the published map with Studio.   Instead, I want end users to be able to add and remove these layers from the repository at runtime.  I'm using the MgLayerCollection.Add method to display layers, but they don't show up in the map.  According to the developers guide, firing this method should automatically add a layer to the map (p. 48).  The layers I'm trying to add do get added to the collection, but don't display even after performing a MgLayer.Visible=True and MgLayer.ForceRefresh.  I am also calling the Viewer API to refresh: parent.mapFrame.Refresh(). 

Anyone have any suggestions or sample code?  

Regards,

Shane

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 5610 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapguide-users/attachments/20061220/0b9060c4/attachment.bin


More information about the Mapguide-users mailing list