[Users] Changing the map part of a mappanel

Febin T T febin at sblgis.com
Thu Jun 24 08:23:01 CEST 2010


Adding and removing individual layers works for me...
like.......
   mapPanel.map.removeLayer(wfsEditableLayer);
    wfsEditableLayer = new OpenLayers.Layer.Vector(layer_name, {
        strategies: [new OpenLayers.Strategy.Fixed(),saveStrategy],
        protocol: new OpenLayers.Protocol.WFS({
            url        : "http://localhost:8081/geoserver/wfs",
                version        : "1.1.0",
                featureType    : layer_name,
                featureNS    : "http://www.openplans.org/topp",
                srsName        : "EPSG:4326"
            })
        });
    mapPanel.map.addLayer(wfsEditableLayer);

will it help u?



On Thu, Jun 24, 2010 at 6:47 AM, Phil Scadden <p.scadden at gns.cri.nz> wrote:

> Getting desperate here. I had given up on changing layers in a map
> because it just doesnt work when adding a set of layers with a google
> map to when previous set of layers didnt contain one.
>
> Changed tack completely, set map to null and created a brand new map.
> Problem I replace in mapPanel with this code.
>             mapPanel.map = null;
>             l = new GeoExt.data.LayerStore({
>                 map:map
>             });
>             mapPanel.layers = l;
>             mapPanel.map = map;
>             mapPanel.map.zoomToExtent(fullBounds);
>
> It doesnt work. The image in the browser stays the same but no
> responding to mouse-clicks etc. Obviously the map object is not actually
> active in mapPanel.  HELP!!!
>
>
> --
> Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St,
> Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232
>
> 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.
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20100624/9662e4be/attachment-0001.htm 


More information about the Users mailing list