A LayerStore is what you are looking for.
I customized the GeoExt LayerStore to read some metadata that I include in
the layer records.
Here is what I am doing.
MG.Mapper.layerConfigs = function(){
return [{
layer record config object
},
...
]
}
MG.Map = {map configuration options object};
MG.Layers = new MG.LayerStore({
map: MG.Map,
initDir: GeoExt.data.LayerStore.STORE_TO_MAP,
layers: MG.Mapper.layerConfigs()
});
I put the layerConfigs in a separate file and include it before the
initialization code which creates the MG.Map & MG.Layers objects
Matt Priour
Kestrel Computer Consulting
--------------------------------------------------
From: "Dan Ramage" <[email protected]>
Sent: Friday, September 03, 2010 9:43 AM
To: <[email protected]>
Subject: [Users] Configuration File
> Since the maps I've been working on are mostly the same GUI but just
> different layers and map areas, I've started working on a JSON
> configuration
> file. I thought having some base map code that pulls in its configuration
> would speed things up for me. Looks like using the ExtJS JSON Reader would
> be the way to go, and I see GeoExt implements a FeatureStore, so I thought
> maybe someone had implemented something similar for the initial map setup.
>
> Dan
>
> _______________________________________________
> Users mailing list
> [email protected]
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users