[Users] storing extra properties on layers
Andreas Hocevar
ahocevar at opengeo.org
Tue Feb 17 19:03:10 CET 2009
Hi,
Bart van den Eijnden (OSGIS) wrote:
> I had a discussion with Patrick Valsecchi on the MapFish list a while
> back about storing extra properties on an OpenLayers.Layer object (in my
> case OpenLayers.Layer.WMS). I currently do this a lot, like metadataURL,
> legendURL, the result of a WMS DescribeLayer request, or the result of a
> WFS DescribeFeatureType request (i.e. the structure returned by the parser).
>
> He says it's not done to store extra properties on an object from a
> different library, and I can see his point.
I agree that it is important to have this metadata available somewhere,
and I also have bad feelings about tagging properties to objects of
foreign libraries.
> How do we plan to handle this in GeoExt? Do we create a Layers widget
> which will hold this extra info and keep it up to synch?
Two alternatives come to my mind:
1) a LayerStore that is always in sync with the map's layers array. Its
recors have a reference to a leayer, plus all this required information.
It would also make things like LayerTree more convenient to develop/use,
because we don't always need a reference to the map, just to our LayerStore.
2) a metadata property added to the OpenLayers Layer API, where everyone
can store what they want.
Personally, I'd be in favor of 1).
Regards,
Andreas.
>
> I'd love to hear some opinions on this. TIA.
>
> Best regards,
> Bart
>
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list