Add WMTS as default background layer

19 views
Skip to first unread message
Assigned to lorenzo...@geosolutionsgroup.com by tobia....@geosolutionsgroup.com

Alexandre Gacon

unread,
Sep 3, 2025, 11:45:18 AMSep 3
to mapstor...@googlegroups.com
Hello,

I am trying to change the default configuration files of MapStore to have a WMTS layer from France IGN in the background selectors.

First, I have made some attempts in changing the default_map_backgrounds array in the localConfig.json file before finding out that for a new map, I have to change the layer list in the new.json file.

Second, my changes raise an error when I try to create a new map:
TypeError: Cannot read properties of undefined (reading 'ows:Identifier')

The definition of my layer looks like this:
{
"format": "image/jpeg",
"group": "background",
"name": "ORTHOIMAGERY.ORTHOPHOTOS.BDORTHO",
"description": "Le produit BD ORTHO® est une collection de mosaïques d'orthophotographies numériques en couleurs ou en Infra Rouge couleurs, rectifiées dans la projection adaptée au territoire couvert.",
"style": "normal",
"title": "Ortho 50 cm",
"type": "wmts",
"bbox": {
"crs": "EPSG:4326",
"bounds": {
"minx": "-180",
"miny": "-80",
"maxx": "180",
"maxy": "80"
}
},
"visibility": false,
"singleTile": false,
"allowedSRS": {
"EPSG:3857": true
},
"requestEncoding": "KVP",
"dimensions": [],
"hideLoading": false,
"handleClickOnLayer": false,
"queryable": true,
"catalogURL": null,
"capabilitiesURL": "https://data.geopf.fr/wmts",
"useForElevation": false,
"hidden": false,
"expanded": false,
"params": {
"": ""
},
"credits": {
"title": "<p>IGN Ortho 50 cm | @IGN <a href=\"https://geoservices.ign.fr/cgu-licences\" target=\"_blank\">CGU</a></p>\n"
},
"availableTileMatrixSets": {
"PM_6_18": {
"crs": "EPSG:3857",
"limits": [
{
"identifier": "6",
"ranges": {
"cols": {
"min": "0",
"max": "63"
},
"rows": {
"min": "7",
"max": "56"
}
}
},
{
"identifier": "7",
"ranges": {
"cols": {
"min": "0",
"max": "127"
},
"rows": {
"min": "14",
"max": "113"
}
}
},
{
"identifier": "8",
"ranges": {
"cols": {
"min": "0",
"max": "255"
},
"rows": {
"min": "28",
"max": "227"
}
}
},
{
"identifier": "9",
"ranges": {
"cols": {
"min": "0",
"max": "511"
},
"rows": {
"min": "57",
"max": "454"
}
}
},
{
"identifier": "10",
"ranges": {
"cols": {
"min": "0",
"max": "1023"
},
"rows": {
"min": "114",
"max": "909"
}
}
},
{
"identifier": "11",
"ranges": {
"cols": {
"min": "0",
"max": "2047"
},
"rows": {
"min": "229",
"max": "1818"
}
}
},
{
"identifier": "12",
"ranges": {
"cols": {
"min": "0",
"max": "4095"
},
"rows": {
"min": "459",
"max": "3636"
}
}
},
{
"identifier": "13",
"ranges": {
"cols": {
"min": "0",
"max": "8191"
},
"rows": {
"min": "919",
"max": "7272"
}
}
},
{
"identifier": "14",
"ranges": {
"cols": {
"min": "0",
"max": "16383"
},
"rows": {
"min": "1839",
"max": "14544"
}
}
},
{
"identifier": "15",
"ranges": {
"cols": {
"min": "0",
"max": "32767"
},
"rows": {
"min": "3678",
"max": "29089"
}
}
},
{
"identifier": "16",
"ranges": {
"cols": {
"min": "0",
"max": "65535"
},
"rows": {
"min": "7357",
"max": "58178"
}
}
},
{
"identifier": "17",
"ranges": {
"cols": {
"min": "0",
"max": "131071"
},
"rows": {
"min": "14714",
"max": "116357"
}
}
},
{
"identifier": "18",
"ranges": {
"cols": {
"min": "0",
"max": "262143"
},
"rows": {
"min": "29428",
"max": "232715"
}
}
}
],
}
}
}

To get it, I have added it as a background in an existing map and I went into the database to fetch the definition in JSON.

What did I miss?

Regards

--
Alexandre Gacon

Alexandru Bobu

unread,
Sep 4, 2025, 4:35:57 AMSep 4
to mapstore-users
  "credits": {
          "title": "<p>IGN Ortho 50 cm | @IGN <a href=\"https://geoservices.ign.fr/cgu-licences\" target=\"_blank\">CGU</a></p>\n"
        },




 "tileMatrixSetLink": "sources['https://data.geopf.fr/wmts'].tileMatrixSet['PM_6_18']"


Check these 2 + https://data.geopf.fr/wmts returns a 400 error



https://data.geopf.fr/api    --->
"root":{
2 items
"error":
"Unauthorized"
"errorDescription":[
1 item
0
:
"Utilisateur non identifié"
]
}

Lorenzo Natali

unread,
Sep 8, 2025, 3:50:33 AMSep 8
to mapstore-users
Hi all, 
I tried it to add from the UI and it worked.
So I suggest to use the UI to properly generate the background, then export the object if you want to copy the configuration in new.json

Here I attach a video about the procedure, and the json exported. 
I'm using the recent master to do so, also stable should be good.
Let 
map (1).json
Screencast from 2025-09-08 09-47-27.webm

Lorenzo Natali

unread,
Sep 8, 2025, 3:51:47 AMSep 8
to mapstore-users
I sent an incomplete message :|
I was writing "let us know if this works for you".
Reply all
Reply to author
Forward
0 new messages