Hi Trond,
Trond Michelsen wrote:
> I'm looking at OpenLayers.Format.WMC, and I'm a little bit confused
> about the mergeContextToMap function.
>
>     mergeContextToMap: function(context, map) {
>         map.addLayers(context.layers);
>         return map;
>     },
>
> Is this even useful? Just adding layers to the map without checking if
> they're already there? Shouldn't merge alter the state of existing
> layers, and then add whatever new layers the context document offers?
>   

Web Map Context is a standard to persist or exchange a map view. Given 
the use case that you populate a map with the layers from a context, 
change the context externally and want to update the map, it would 
probably be useful to change the method.

Since mergeContextToMap is not an APIMethod, it should be no problem to 
change it.

Regards,
Andreas.


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

_______________________________________________
Dev mailing list
Dev@openlayers.org
http://openlayers.org/mailman/listinfo/dev

Reply via email to