[Users] Configuration File

Dan Ramage dan at inlet.geol.sc.edu
Fri Sep 3 19:17:27 CEST 2010


Matt,

Thanks for the suggestion.

Dan

-----Original Message-----
From: Matt Priour [mailto:mpriour at kestrelcomputer.com] 
Sent: Friday, September 03, 2010 12:43 PM
To: Dan Ramage; users at geoext.org
Subject: Re: [Users] Configuration File

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" <dan at inlet.geol.sc.edu>
Sent: Friday, September 03, 2010 9:43 AM
To: <users at geoext.org>
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
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
> 



More information about the Users mailing list