[GeoNode-users] Adding TMS ase layer to GeoNode

Daniel Victoria daniel.victoria at gmail.com
Mon Feb 6 09:41:00 PST 2017


OK, after the help of a much smarter friend, I was able to get this
working...

The baselayer that I added to settings.py was:

{
    "source": {"ptype": "gxp_olsource"},
    "type": "OpenLayers.Layer.TMS",
    "args": ["ms2014_tms", "http://virt0026.cnptia.embrapa.br:8000/",
              {"layername":"ms2014_tms", "type":"png"}],
    "visibility": True,
    "fixed": True,
    "group": "background"
}

On Mon, Feb 6, 2017 at 2:37 PM, Daniel Victoria <daniel.victoria at gmail.com>
wrote:

> Hi List,
>
> I'm trying to add a new TMS baselayer to my GeoNode but I'm quite stuck. I
> generated the TMS file structure using gdal2tiles command. I then placed
> the files in the geonode apache webserver, using a different port (8000)
> and added the following to geonode settings.py
>
> MAP_BASELAYERS = [{
>     "source": {"ptype": "gxp_olsource"},
>     "type": "OpenLayers.Layer",
>     "args": ["No background"],
>     "visibility": False,
>     "fixed": True,
>     "group":"background"
> }, {
>     "source": {"ptype": "gxp_osmsource"},
>     "type": "OpenLayers.Layer.OSM",
>     "name": "mapnik",
>     "visibility": True,
>     "fixed": True,
>     "group": "background"
> },{
>     "source": {"ptype": "gxp_tmssource",
>     "name": "ms2014_tms",
>     "url": "http://virt0026.cnptia.embrapa.br:8000/1.0.0/"},
>     "visibility": True,
>     "fixed": True,
>     "group": "background"
> }]
>
> However, when I try yo load the GeoNode map page (geoexplorer), I get an
> Internal Server Error. I looked at apache error and access logs but I could
> no find anything.
>
> I know that my TMS is working because I can load the layer using the
> sample html openlayers page that is created by gdal2tiles.py. There, it's
> done by the lines:
>
>         var tmsoverlay = new OpenLayers.Layer.TMS("RapidEye 2014", "
> http://virt0026.cnptia.embrapa.br:8000/",
>                   {
>                       serviceVersion: '1.0.0',
>                       layername: 'ms2014_tms',
>                       alpha: true,
>                       type: 'png',
>                       isBaseLayer: false,
>                       getURL: getURL
>                   });
>
> Any ideas of what could be wrong?
>
> Notice: both geonode and tms server are not accessible outside my local
> network
>
> Cheers
> Daniel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20170206/88f02d0a/attachment-0001.html>


More information about the geonode-users mailing list