Adding and removing individual layers works for me...<br>like.......<br> mapPanel.map.removeLayer(wfsEditableLayer);<br> wfsEditableLayer = new OpenLayers.Layer.Vector(layer_name, {<br> strategies: [new OpenLayers.Strategy.Fixed(),saveStrategy],<br>
protocol: new OpenLayers.Protocol.WFS({<br> url : "<a href="http://localhost:8081/geoserver/wfs">http://localhost:8081/geoserver/wfs</a>",<br> version : "1.1.0",<br>
featureType : layer_name,<br> featureNS : "<a href="http://www.openplans.org/topp">http://www.openplans.org/topp</a>",<br> srsName : "EPSG:4326"<br>
})<br> });<br> mapPanel.map.addLayer(wfsEditableLayer);<br><br>will it help u?<br><br><br><br><div class="gmail_quote">On Thu, Jun 24, 2010 at 6:47 AM, Phil Scadden <span dir="ltr"><<a href="mailto:p.scadden@gns.cri.nz">p.scadden@gns.cri.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Getting desperate here. I had given up on changing layers in a map<br>
because it just doesnt work when adding a set of layers with a google<br>
map to when previous set of layers didnt contain one.<br>
<br>
Changed tack completely, set map to null and created a brand new map.<br>
Problem I replace in mapPanel with this code.<br>
mapPanel.map = null;<br>
l = new GeoExt.data.LayerStore({<br>
map:map<br>
});<br>
mapPanel.layers = l;<br>
mapPanel.map = map;<br>
mapPanel.map.zoomToExtent(fullBounds);<br>
<br>
It doesnt work. The image in the browser stays the same but no<br>
responding to mouse-clicks etc. Obviously the map object is not actually<br>
active in mapPanel. HELP!!!<br>
<br>
<br>
--<br>
Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St,<br>
Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232<br>
<br>
Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
<a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div><br>