[OpenLayers-Users] [OpenLayers-Dev] Permalink doesn't update on addlayer/removelayer

Andreas Hocevar ahocevar at opengeo.org
Tue Aug 24 08:49:34 EDT 2010


Hi,

first of all, please don't cross-post dev and users.

I am not sure if a permalink as provided by OpenLayers is what you really want for applications where the user can add or remove layers. The permalink only stores the visible/invisible state of the available layers in their order. It does not know anything about what these layers are. So a permalink will look exactly the same for any map with the same extent with let's say 3 layers that are all visible.

If you want to store information on what layers are actually configured, you should look into Format.WMC, Format.OWS or solutions like the OpenGeo Suite's GeoExplorer (http://suite.opengeo.org/geoexplorer), which stores layer configurations in a database and provides a permalink with a map id.

Regards,
Andreas.

On Aug 24, 2010, at 14:31 , Marc Jansen wrote:

> Hi Slawomir,
> 
> I'd consider this a bug with a (on first sight) reasonable easy fix:
> 
> In the Permalinks draw-method:
> 
>         this.map.events.on({
>             'moveend': this.updateLink,
>             'changelayer': this.updateLink,
>             'changebaselayer': this.updateLink,
>             'addlayer': this.updateLink,
>             'removelayer': this.updateLink,
>             scope: this
>         });
> 
> Or one could think of triggering a changelayer event when a layer has 
> been added/removed in Map.js.
> 
> I am unsure which design is better, so I'd suggest opening up a ticket 
> (I cc'ed the developer list so the core developers notice this discussion).
> 
> Regards,
> Marc
> 
> 
> 
> 
> On 24.08.2010 13:53, Slawomir Messner wrote:
>>   Hello,
>> Does anyone know why Permalink doesn't listen to addlayer/removelayer?
>> Every time I add a new layer I have to change a property(i.e.
>> visibility) to refresh the link. It's a bug or a feature?
>> Regards,
>> Slawomir
>> 
> 
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev

-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.




More information about the Users mailing list