# Cesium.js and WMTS

**URL:** <https://community.cesium.com/t/cesium-js-and-wmts/21956>\
**Category:** CesiumJS\
**Created:** [January 16, 2023, 7:21pm UTC](https://community.cesium.com/t/cesium-js-and-wmts/21956 "2023-01-16T19:21:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![T.T](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/t.t/32/11994_2.png) [@T.T](https://community.cesium.com/u/T.T)\
**Post date:** [January 16, 2023, 7:21pm UTC](https://community.cesium.com/t/cesium-js-and-wmts/21956/1 "2023-01-16T19:21:59Z")

</div>

hello i can’t view my wmts layer that i propagate through geoserver on cesium.js. where am i doing wrong

```auto
   <script >
        var viewer = new Cesium.Viewer("cesiumContainer",{
                         Geocoder: false,
                         Animation: true,
                         CreditsDisplay: false,
                         Timeline: false,
                         FullscreenButton: false
        });
       viewer.scene.primitives.add(Cesium.createOsmBuildings());
      
var wmtsImageryProvider = new Cesium.WebMapTileServiceImageryProvider({
    url : 'http://localhost:8084/geoserver/gwc/service/wmts',
    layer : 'osm_water',
    style : 'default',
    format : 'image/png',
    tileMatrixSetID : 'EPSG:4326',
    
    //maximumLevel:5
});

viewer.imageryLayers.addImageryProvider(wmtsImageryProvider);

</script>

```

---

<div class="post-metadata">

**Author:** ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)\
**Post date:** [January 17, 2023, 8:31pm UTC](https://community.cesium.com/t/cesium-js-and-wmts/21956/2 "2023-01-17T20:31:55Z")

</div>

Hi there,

[This example](https://sandcastle.cesium.com/?src=Web%20Map%20Tile%20Service%20with%20Time.html) may help by incorporating the current viewer time into your WMTS requests.

---

<div class="post-metadata">

**Author:** ![T.T](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/t.t/32/11994_2.png) [@T.T](https://community.cesium.com/u/T.T)\
**Post date:** [January 18, 2023, 2:19am UTC](https://community.cesium.com/t/cesium-js-and-wmts/21956/3 "2023-01-18T02:19:59Z")

</div>

![image](https://global.discourse-cdn.com/cesium/original/2X/0/06deefabfc1a3122c4317a167bfcf263876d74ba.png)

hi i keep getting error like this on cesium.wiever

---

<div class="post-metadata">

**Author:** ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)\
**Post date:** [January 23, 2023, 6:24pm UTC](https://community.cesium.com/t/cesium-js-and-wmts/21956/4 "2023-01-23T18:24:01Z")

</div>

It looks like CesiumJS is running into errors while requesting imagery tiles from the WMTS server. This is troubleshoot since we don’t have access to the locally running WMTS server, so I can’t be sure if the problem is with CesiumJS or the server configuration. I would recommend starting by checking the network tab and checking why the requests are failing. For instance, if you are seeing 404 errors I would check to make sure you have the correct URL and that the server is actually serving the tiles to the correct location.

---

<div class="post-metadata">

**Author:** ![lennart.imberg](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/lennart.imberg/32/9788_2.png) [@lennart.imberg](https://community.cesium.com/u/lennart.imberg)\
**Post date:** [January 26, 2023, 10:06am UTC](https://community.cesium.com/t/cesium-js-and-wmts/21956/5 "2023-01-26T10:06:35Z")

</div>

Hi @T.T,

maybe your Geoserver needs a “RESTful” request, so you could try the following url:

```auto
"http://localhost:8084/geoserver/gwc/service/wmts/osm_water/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png"

```

Best, Lennart
