FWIW, I added similar functionality to my fork of GeoNode last year by tweaking the map viewer configuration produced by the viewer_json method of the Maps class and adding a new setting called 'DEFAULT_MAP_WMS':
https://github.com/cspanring/geonode/commit/096da0b67430e67a1e022bcb30888149ecb0aca6 I scratched it later again because its performance wasn't ideal and I think similar functionality is on GeoNode's roadmap anyways, if I remember correctly. Christian -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Andreas Hocevar Sent: Tuesday, September 06, 2011 7:39 AM To: [email protected] Subject: Re: [geonode] Add predefined WMS to geonode On Sep 6, 2011, at 10:52 , Andreas Hocevar wrote: > Hi, > > On Sep 5, 2011, at 17:05 , Patrick Krejci wrote: > >> Hi David, >> sorry but I don't understand it, I thought that the MAP_BASELAYERSOURCES are >> to set the sources of the MAP_BASELAYERS which are visible on the LayerTree >> on the left side. > > Yes, but these sources are also used for the Available Layers dropdown in the > Add Layers dialog. Actually scratch that. Only sources from MAP_BASELAYERSOURCES that are used by one of the layers in MAP_BASELAYERS show up in the Available Layers dropdown. The only other way for adding a permanent layer source right now is to modify geonode/maps/models.py and add it in the uniquify method (see https://github.com/GeoNode/geonode/blob/master/src/GeoNodePy/geonode/maps/models.py#L1281). Andreas. > >> I hope you understand my description above. But I want to add a Server to >> the Available Layers Dialog which pops up if you create a new map oder press >> the add new layer button. For that purpose the same variable >> MAP_BASELAYERSOURCES is also responsible? > > Yes indeed. > >> Can you explain to me, what the ptype property does? > > The ptype references a gxp plugin. See > http://gxp.opengeo.org/master/doc/lib/plugins.html. And the default ptype is > "gxp_wmscsource". So look at the "capra" source: > >> MAP_BASELAYERSOURCES = { >> "any": { >> "ptype":"gx_olsource" >> }, >> "capra": { >> "url":"/geoserver/wms" >> }, >> "google":{ >> "ptype":"gx_googlesource", >> "apiKey": GOOGLE_API_KEY >> } >> } > > You can define an arbitrary WMS source the same way, e.g. > > "my_wms": { > "url": "http://my-wms/geoserver/wms" > } > > Andreas. > > -- > Andreas Hocevar > OpenGeo - http://opengeo.org/ > Expert service straight from the developers. > -- Andreas Hocevar OpenGeo - http://opengeo.org/ Expert service straight from the developers. Please be advised that the Massachusetts Secretary of State considers e-mail to be a public record, and therefore subject to the Massachusetts Public Records Law, M.G.L. c. 66 ยง 10.
