[Mapguide_users] FW: Remove layers at runtime
Shane.Buscher at nngco.com
Tue Jan 9 17:48:50 EST 2007
I've run into issues with removing all layers from the map at runtime.
See the code snippet below. All the layers get removed from the
layerCollection, but the layers still display. I've successfully used
the same code to insert layers, except I execute the
layerCollection.Insert(index, layer) method. I don't know why the same
code wouldn't work for clearing layers.
I have multiple layers stored in a library repository that users need to
add and remove at runtime. Do I need to copy each layer in indvidual
session repositories to add and reomove them? If I don't, will one user
adding/removing layers affect other user sessions? I know this is the
case when you edit data, but these layers are view only.
'Connect to site server, set resource service, and open map
'Clear all layers in the map
Dim layerCollection As MgLayerCollection = map.GetLayers()
If layerCollection.GetCount > 0 Then
Dim scriptKey As String = "ForceRefresh"
If Not Page.ClientScript.IsStartupScriptRegistered(Me.GetType,
Northern Natural Gas
We think in generalities, but live in detail.
-Alred North Whitehead
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mapguide-users