Changes made to wxs.threejs to drape WMTS and TMS tiles

Inspired by the project from Labs Kartverket we have customized their code starting from the simplified fork by atlefren to create our own “3D scene generator


WCS service
In order to use the 5x5m terrain model from the ICGC (Institut Cartogràfic i Geològic de Catalunya) we have setup a WCS service in Minnesota Mapserver 6.4.

Since the WMTS and TMS services we will be using are expressed in EPSG:3857 we got rid of the GetCapabilities request and the parsing of the XML response, and in its place we have “hardcoded” the description, tiling and resolutions of these Google compatible pyramids.


Wxs.tree.js and Univers.js
We modified the original interrogation method of the WMTS from KVP to make it RESTful in order to query data from ICGC servers. On one side we have created a new variable to carry the URL parameters of a WMTS service, and on the other side we have created another variable to collect the changing parameters of resolution, column and row coming from the Google compatible pyramids.

wmtsUrl1: getQueryVariable("WMTS1") || '',
var cache_WMTS ="/"+activeMatrix.Identifier+"/"+tileCol+"/"+tileRow+"."+this.dim.extUrl;

We have also migrated from the original OpenLayers client to Leaflet  with the “” plugin.
This client allows us to pass as parameters the current coordinates of the active boundingbox along with the URL of the chosen WMTS service. This way we can create a 3D model of any of the available WMTS or TMS services in 3857.

You may also like...