I'm trying to add some new basemap layers from a local mapping provider that are higher resolution than the default basemaps.
I have successfully added these as overlay layers using the Add Layers UI. The configuration for these is very simple, here is one example:
Type: TMS
Title: LINZ Aerial Basemap
Provider: Custom
Custom TMS Configuration:
{
"options": {
"maxZoom": 15,
"maxNativeZoom": 15
}
}
Now I want to add these layers to the default basemap list (or replace the defaults with these equivilents).
I was told the way to add basemaps is through code configutation, updating the MAPSTORE_BASELAYERS variable.
I spent the entire day yesterday trying to figure out which file to update and where it should be stored in which docker container. I finally managed to do it by creating a local_settings.py file and link that into the x-common-django docker container as a volume reference:
x-common-django:
...
volumes:
...
- ./conf/local_settings.py:/usr/src/geonode_groundtruth/geonode_groundtruth/local_settings.py
I know this is working because I have been able to delete some of the default layers in local_settings.py defaults and change their icons, and confirmed these changes are showing up when I restart the containers.
Unfortunately I have no idea what the new layer definition should look like. The only documentation I have found is here:
and here:
But none of the example base layer definitions are of type TMS, and I don't see TMS in the list of supported layer types in the documentation. Though I have been searching for baselyer and TMS and local_settings.py issues in github issues, and found comments to suggest that TMS is supported - and it obviously is supported as an overlay layer.
To add to that many of the layer definitions seem to be insufficient to completely describe a layer. e.g:
{
"type": "osm",
"title": "Open Street Map",
"name": "mapnik",
"source": "osm",
"group": "background",
"visibility": True,
},
There is not even a URL in this description, so how does the server know where to pull layer data from? That coupled with the last line in my local_settings.py file:
MAPSTORE_BASELAYERS_SOURCES = os.environ.get("MAPSTORE_BASELAYERS_SOURCES", {})