Select to view content in your preferred language

Incorporating a WMTS layer from Geoserver into a SceneView.

142
1
07-23-2025 03:27 PM
AliMahdian
New Contributor

I have a WMTS layer from GeoServer that has been successfully added to a MapView and works correctly. However, when I try to add this layer to the SceneView, it does not appear. Can anyone help me?

require([
      "esri/Map",
      "esri/views/MapView",
      "esri/layers/WMTSLayer",
      "esri/geometry/SpatialReference"
    ], function(Map, MapView, WMTSLayer, SpatialReference) {

      const wm = new SpatialReference({ wkid: 3857 });

      const wmtsLayer = new WMTSLayer({
        url: "http://localhost:8080/geoserver/gwc/service/wmts",
        activeLayer: {
          id: "SurfaceGroup",
          tileMatrixSetId: "EPSG:900913"
        },
        serviceMode: "KVP",
        spatialReference: wm
      });

      const map = new Map({
        basemap: "topo-vector",
        layers: [wmtsLayer]
      });

      const view = new MapView({
        container: "viewDiv",
        map: map,
        spatialReference: wm,
        center: [-80.3, 43.4], // Longitude, Latitude for Cambridge, Canada
        zoom: 12
      });

    });
Tags (2)
0 Kudos
1 Reply
ThomasKnabl
Esri Contributor

Hi AliMahdian,
Not clear to me why this doesn't work. To look further into it, could you share a link to the publicly available WMTS? Can you see any errors in the console? Maybe an issue with the not identical spatialReference identifier being set to 3857 but on the other hand the tileMatrixSetId being EPSG:900913?

0 Kudos