I'm not sure what exactly you are trying to do, but I can assure you that you are doing wrong.

map.destroy();

NO! Never destroy the map unless you want it really and truly gone for good.

var jsonFormat = new OpenLayers.Format.JSON();

var mapOptions = jsonFormat.read('{"allOverlays": true}');

OL.Format.JSON is for reading JSON "encoded" vector features into a layer. You do NOT need this to simply set options. mapOptions = {allOverlays:true}; instead of the 2 lines and quoted strings you have used. However, again, you should only be setting that once and creating the map once, NOT attempting to fully destroy the map and recreate it everytime you want to read or refresh a data source.

map   = wmcFormat.read(context, {map: mapOptions});

Instead of this you should use:
map.setOptions(wmcFormat.read(context,{map:mapOptions});

The FireFox error is : layers is null in MapPanel.js (ligne 301)

And do I have to re-build all the GeoExt widgets (ScaleStore, LegendPanel, OverviewMap...) which are bind to my map ??


Thanks for the help

Arno



_______________________________________________
Users mailing list
Users@geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users


No virus found in this message.
Checked by AVG - www.avg.com <http://www.avg.com>
Version: 2012.0.1901 / Virus Database: 2109/4732 - Release Date: 01/09/12

_______________________________________________
Users mailing list
Users@geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users

Reply via email to