[OpenLayers-Users] Need an example of dynamically adding a layer from inside of OpenLayers??

Greg Allensworth gregor at greeninfo.org
Tue Apr 10 17:33:33 EDT 2012


> I just need to replicate an existing layer, but using parameters from a
> CGI call. I can reload the entire interface and add the layers, but is
> there an example of adding a layer to the layer sw3itcher from inside of
> an active OpenLayers map.

When you call map.addLayer(layer) it should automagically add the layer 
to the LayerSwitcher. Are you not seeing this behavior? Are you calling 
addLayer() and the new layer is not appearing in the LayerSwitcher ?

-- 
Greg Allensworth, Web GIS Developer
BS  A+  Network+  Security+  Linux+  Server+
GreenInfo Network - Information and Mapping in the Public Interest
564 Market Street, Suite 510  San Francisco CA 94104
PH: 415-979-0343 x302  FX: 415-979-0371    email: gregor at greeninfo.org
Web: www.GreenInfo.org     www.MapsPortal.org

Subscribe to MapLines, our e-newsletter, at www.GreenInfo.org


More information about the Users mailing list