[mapguide-users] Re: Refresh Default Layer States w/o Refresh Map

Hans Milling hm at geograf.dk
Mon Apr 2 01:35:20 EDT 2012


Are you using the MaestroAPI?
If so, do this:

When the application initializes (or page_load) do this:
Dictionary<string, bool>initial_states = new Dictionary<string, bool>();

foreach (RuntimeMapLayer l in map.Layers)
{
  initial_states.add(l.ObjectId, l.Visible);
}

Now when the user presses your "reset layer visibility" button do this:

foreach (RuntimeMapLayer l in map.Layers)
{
  l.Visible = initial_states[l.ObjectId];
}

Then in javascript you need to go redraw all the layers I think, looping
trough the layers in your OpenLayers map and call the
.layers[i].redraw(true); method.

Best regards Hans Milling...

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Refresh-Default-Layer-States-w-o-Refresh-Map-tp4675693p4677927.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list