[GeoNode-users] Custom background layers not in Thumbnail

Simone Dalmasso simone.dalmasso at gmail.com
Thu Mar 16 02:21:35 PDT 2017


Hi, are you saving the thumbnail through the set thumbnail button in map
detail -> edit map?
This is the only way to get the background rendered in the thumbnail

2017-03-16 9:43 GMT+01:00 John, Steffen <s.john at atenekom.eu>:

> Hi,
> I created custom map base layers, which are added to every newly
> created map. When saving this map, the thumbnail is created without the
> basemap on it.
>
> To define the basemaps, i added a gxp plugin, correspondingly to the
> BingSource, based on a WMS. May be I missed something?
> Do you have any idea, what I have done wrong?
>
> Thank you so much for your help.
>
> Here is the code:
>
> gxp.plugins.WebAtlasFarbeSource = Ext.extend(gxp.plugins.LayerSource, {
>
>     ptype: "gxp_webatlasfarbesource",
>
>     title: "WebAtlasDE Farbe",
>
>     webAtlasFarbeTitle: "WebAtlasDEFarbe",
>     url: "https://sg.geodatenzentrum.de/wms_webatlasde__UUID",
>     attribution: "© GeoBasis-DE / <b>BKG</b> ("+year+")",
>     createStore: function() {
>
>         var layers = [
>              new OpenLayers.Layer.WMS(this.webAtlasFarbeTitle,
>                                    this.url,
>                                    {layers: ["webatlasde"],
>                                    format:"image/png",
>                                    tiled: true
>                                    },
>                                    {
>                                        attribution : this.attribution
>                                    })
>
>         ];
>
>         this.store = new GeoExt.data.LayerStore({
>             layers: layers,
>             fields: [
>                 {name: "source", type: "string"},
>                 {name: "name", type: "string", defaultValue:
> "webatlasdefarbe"},
>                 {name: "abstract", type: "string", mapping:
> "attribution"},
>                 {name: "group", type: "string", defaultValue:
> "background"},
>                 {name: "fixed", type: "boolean", defaultValue: true},
>                 {name: "selected", type: "boolean"}
>             ]
>         });
>         this.store.each(function(l) {
>             l.set("group", "background");
>         });
>         this.fireEvent("ready", this);
>
>     },
>
>     createLayerRecord: function(config) {
>         var record;
>         var index = this.store.findExact("name", config.name);
>         if (index > -1) {
>
>             record =
> this.store.getAt(index).copy(Ext.data.Record.id({}));
>             var layer = record.getLayer().clone();
>
>             // set layer title from config
>             if (config.title) {
>                 /**
>                  * Because the layer title data is duplicated, we have
>                  * to set it in both places.  After records have been
>                  * added to the store, the store handles this
>                  * synchronization.
>                  */
>                 layer.setName(config.title);
>                 record.set("title", config.title);
>             }
>
>             // set visibility from config
>             if ("visibility" in config) {
>                 layer.visibility = config.visibility;
>             }
>
>             record.set("selected", config.selected || false);
>             record.set("source", config.source);
>             record.set("name", config.name);
>             if ("group" in config) {
>                 record.set("group", config.group);
>             }
>
>             record.data.layer = layer;
>             record.commit();
>         }
>         return record;
>     }
>
> });
>
> Ext.preg(gxp.plugins.WebAtlasFarbeSource.prototype.ptype,
> gxp.plugins.WebAtlasFarbeSource);
>
>
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/geonode-users
>



-- 
Simone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20170316/3129b3f0/attachment-0001.html>


More information about the geonode-users mailing list