[Users] MapPanel refresh after a wmcFormat.read()

Matt Priour mpriour at kestrelcomputer.com
Mon Jan 9 17:41:39 CET 2012


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 at 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20120109/60eb93af/attachment.htm 


More information about the Users mailing list