Merge pull request #307 from spatialillusions/master
Add support for WMTS capabilities
This commit is contained in:
commit
58168eb0a5
5 changed files with 431 additions and 17 deletions
|
@ -21,6 +21,10 @@ Rendered tiles
|
||||||
|
|
||||||
* The rendered tiles are not available in the ``tileserver-gl-light`` version.
|
* The rendered tiles are not available in the ``tileserver-gl-light`` version.
|
||||||
|
|
||||||
|
WMTS Capabilities
|
||||||
|
==============
|
||||||
|
* WMTS Capabilities are served at ``/styles/{id}/wmts.xml``
|
||||||
|
|
||||||
Static images
|
Static images
|
||||||
=============
|
=============
|
||||||
* Several endpoints:
|
* Several endpoints:
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
"@mapbox/sphericalmercator": "1.0.5",
|
"@mapbox/sphericalmercator": "1.0.5",
|
||||||
"@mapbox/vector-tile": "1.3.0",
|
"@mapbox/vector-tile": "1.3.0",
|
||||||
"advanced-pool": "0.3.3",
|
"advanced-pool": "0.3.3",
|
||||||
"base64url": "2.0.0",
|
|
||||||
"canvas": "1.6.8",
|
"canvas": "1.6.8",
|
||||||
"clone": "2.1.1",
|
"clone": "2.1.1",
|
||||||
"color": "1.0.3",
|
"color": "1.0.3",
|
||||||
|
|
|
@ -40,8 +40,8 @@
|
||||||
{{#if serving_rendered}}
|
{{#if serving_rendered}}
|
||||||
{{#if serving_data}}| {{/if}}<a href="/styles/{{@key}}.json{{&../key_query}}">TileJSON</a>
|
{{#if serving_data}}| {{/if}}<a href="/styles/{{@key}}.json{{&../key_query}}">TileJSON</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if wmts_link}}
|
{{#if serving_rendered}}
|
||||||
| <a href="{{&wmts_link}}">WMTS</a>
|
| <a href="/styles/{{@key}}/wmts.xml{{&../key_query}}">WMTS</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if xyz_link}}
|
{{#if xyz_link}}
|
||||||
| <a href="#" onclick="return toggle_xyz('xyz_style_{{@key}}');">XYZ</a>
|
| <a href="#" onclick="return toggle_xyz('xyz_style_{{@key}}');">XYZ</a>
|
||||||
|
@ -110,4 +110,4 @@
|
||||||
</p>
|
</p>
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
407
public/templates/wmts.tmpl
Normal file
407
public/templates/wmts.tmpl
Normal file
|
@ -0,0 +1,407 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<Capabilities xmlns="http://www.opengis.net/wmts/1.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd" version="1.0.0">
|
||||||
|
<!-- Service Identification -->
|
||||||
|
<ows:ServiceIdentification>
|
||||||
|
<ows:Title>TileServer GL</ows:Title>
|
||||||
|
<ows:ServiceType>OGC WMTS</ows:ServiceType>
|
||||||
|
<ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
|
||||||
|
</ows:ServiceIdentification>
|
||||||
|
<!-- Operations Metadata -->
|
||||||
|
<ows:OperationsMetadata>
|
||||||
|
<ows:Operation name="GetCapabilities">
|
||||||
|
<ows:DCP>
|
||||||
|
<ows:HTTP>
|
||||||
|
<ows:Get xlink:href="{{baseUrl}}/wmts/{{id}}/">
|
||||||
|
<ows:Constraint name="GetEncoding">
|
||||||
|
<ows:AllowedValues>
|
||||||
|
<ows:Value>RESTful</ows:Value>
|
||||||
|
</ows:AllowedValues>
|
||||||
|
</ows:Constraint>
|
||||||
|
</ows:Get>
|
||||||
|
</ows:HTTP>
|
||||||
|
</ows:DCP>
|
||||||
|
</ows:Operation>
|
||||||
|
<ows:Operation name="GetTile">
|
||||||
|
<ows:DCP>
|
||||||
|
<ows:HTTP>
|
||||||
|
<ows:Get xlink:href="{{baseUrl}}/styles/">
|
||||||
|
<ows:Constraint name="GetEncoding">
|
||||||
|
<ows:AllowedValues>
|
||||||
|
<ows:Value>RESTful</ows:Value>
|
||||||
|
</ows:AllowedValues>
|
||||||
|
</ows:Constraint>
|
||||||
|
</ows:Get>
|
||||||
|
</ows:HTTP>
|
||||||
|
</ows:DCP>
|
||||||
|
</ows:Operation>
|
||||||
|
</ows:OperationsMetadata>
|
||||||
|
<Contents>
|
||||||
|
<Layer>
|
||||||
|
<ows:Title>{{name}}</ows:Title>
|
||||||
|
<ows:Identifier>{{id}}</ows:Identifier>
|
||||||
|
<ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
|
||||||
|
<ows:LowerCorner>-180 -85.051128779807</ows:LowerCorner>
|
||||||
|
<ows:UpperCorner>180 85.051128779807</ows:UpperCorner>
|
||||||
|
</ows:WGS84BoundingBox>
|
||||||
|
<Style isDefault="true">
|
||||||
|
<ows:Identifier>default</ows:Identifier>
|
||||||
|
</Style>
|
||||||
|
<Format>image/png</Format>
|
||||||
|
<TileMatrixSetLink>
|
||||||
|
<TileMatrixSet>GoogleMapsCompatible</TileMatrixSet>
|
||||||
|
</TileMatrixSetLink>
|
||||||
|
<ResourceURL format="image/png" resourceType="tile" template="{{baseUrl}}/styles/{{id}}/{TileMatrix}/{TileCol}/{TileRow}.png{{key_query}}"/>
|
||||||
|
</Layer><TileMatrixSet>
|
||||||
|
<ows:Title>GoogleMapsCompatible</ows:Title>
|
||||||
|
<ows:Abstract>GoogleMapsCompatible EPSG:3857</ows:Abstract>
|
||||||
|
<ows:Identifier>GoogleMapsCompatible</ows:Identifier>
|
||||||
|
<ows:SupportedCRS>urn:ogc:def:crs:EPSG::3857</ows:SupportedCRS>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>0</ows:Identifier>
|
||||||
|
<ScaleDenominator>559082264.02872</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>1</MatrixWidth>
|
||||||
|
<MatrixHeight>1</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>1</ows:Identifier>
|
||||||
|
<ScaleDenominator>279541132.01436</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>2</MatrixWidth>
|
||||||
|
<MatrixHeight>2</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>2</ows:Identifier>
|
||||||
|
<ScaleDenominator>139770566.00718</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>4</MatrixWidth>
|
||||||
|
<MatrixHeight>4</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>3</ows:Identifier>
|
||||||
|
<ScaleDenominator>69885283.00359</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>8</MatrixWidth>
|
||||||
|
<MatrixHeight>8</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>4</ows:Identifier>
|
||||||
|
<ScaleDenominator>34942641.501795</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>16</MatrixWidth>
|
||||||
|
<MatrixHeight>16</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>5</ows:Identifier>
|
||||||
|
<ScaleDenominator>17471320.750897</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>32</MatrixWidth>
|
||||||
|
<MatrixHeight>32</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>6</ows:Identifier>
|
||||||
|
<ScaleDenominator>8735660.3754487</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>64</MatrixWidth>
|
||||||
|
<MatrixHeight>64</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>7</ows:Identifier>
|
||||||
|
<ScaleDenominator>4367830.1877244</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>128</MatrixWidth>
|
||||||
|
<MatrixHeight>128</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>8</ows:Identifier>
|
||||||
|
<ScaleDenominator>2183915.0938622</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>256</MatrixWidth>
|
||||||
|
<MatrixHeight>256</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>9</ows:Identifier>
|
||||||
|
<ScaleDenominator>1091957.5469311</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>512</MatrixWidth>
|
||||||
|
<MatrixHeight>512</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>10</ows:Identifier>
|
||||||
|
<ScaleDenominator>545978.77346554</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>1024</MatrixWidth>
|
||||||
|
<MatrixHeight>1024</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>11</ows:Identifier>
|
||||||
|
<ScaleDenominator>272989.38673277</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>2048</MatrixWidth>
|
||||||
|
<MatrixHeight>2048</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>12</ows:Identifier>
|
||||||
|
<ScaleDenominator>136494.69336639</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>4096</MatrixWidth>
|
||||||
|
<MatrixHeight>4096</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>13</ows:Identifier>
|
||||||
|
<ScaleDenominator>68247.346683193</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>8192</MatrixWidth>
|
||||||
|
<MatrixHeight>8192</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>14</ows:Identifier>
|
||||||
|
<ScaleDenominator>34123.673341597</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>16384</MatrixWidth>
|
||||||
|
<MatrixHeight>16384</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>15</ows:Identifier>
|
||||||
|
<ScaleDenominator>17061.836670798</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>32768</MatrixWidth>
|
||||||
|
<MatrixHeight>32768</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>16</ows:Identifier>
|
||||||
|
<ScaleDenominator>8530.9183353991</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>65536</MatrixWidth>
|
||||||
|
<MatrixHeight>65536</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>17</ows:Identifier>
|
||||||
|
<ScaleDenominator>4265.4591676996</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>131072</MatrixWidth>
|
||||||
|
<MatrixHeight>131072</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>18</ows:Identifier>
|
||||||
|
<ScaleDenominator>2132.7295838498</ScaleDenominator>
|
||||||
|
<TopLeftCorner>-20037508.34 20037508.34</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>262144</MatrixWidth>
|
||||||
|
<MatrixHeight>262144</MatrixHeight>
|
||||||
|
</TileMatrix></TileMatrixSet><TileMatrixSet>
|
||||||
|
<ows:Title>WGS84</ows:Title>
|
||||||
|
<ows:Abstract>WGS84 EPSG:4326</ows:Abstract>
|
||||||
|
<ows:Identifier>WGS84</ows:Identifier>
|
||||||
|
<ows:SupportedCRS>urn:ogc:def:crs:EPSG::4326</ows:SupportedCRS>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>0</ows:Identifier>
|
||||||
|
<ScaleDenominator>279541132.01436</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>2</MatrixWidth>
|
||||||
|
<MatrixHeight>1</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>1</ows:Identifier>
|
||||||
|
<ScaleDenominator>139770566.00718</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>4</MatrixWidth>
|
||||||
|
<MatrixHeight>2</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>2</ows:Identifier>
|
||||||
|
<ScaleDenominator>69885283.00359</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>8</MatrixWidth>
|
||||||
|
<MatrixHeight>4</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>3</ows:Identifier>
|
||||||
|
<ScaleDenominator>34942641.501795</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>16</MatrixWidth>
|
||||||
|
<MatrixHeight>8</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>4</ows:Identifier>
|
||||||
|
<ScaleDenominator>17471320.750897</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>32</MatrixWidth>
|
||||||
|
<MatrixHeight>16</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>5</ows:Identifier>
|
||||||
|
<ScaleDenominator>8735660.3754487</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>64</MatrixWidth>
|
||||||
|
<MatrixHeight>32</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>6</ows:Identifier>
|
||||||
|
<ScaleDenominator>4367830.1877244</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>128</MatrixWidth>
|
||||||
|
<MatrixHeight>64</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>7</ows:Identifier>
|
||||||
|
<ScaleDenominator>2183915.0938622</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>256</MatrixWidth>
|
||||||
|
<MatrixHeight>128</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>8</ows:Identifier>
|
||||||
|
<ScaleDenominator>1091957.5469311</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>512</MatrixWidth>
|
||||||
|
<MatrixHeight>256</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>9</ows:Identifier>
|
||||||
|
<ScaleDenominator>545978.77346554</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>1024</MatrixWidth>
|
||||||
|
<MatrixHeight>512</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>10</ows:Identifier>
|
||||||
|
<ScaleDenominator>272989.38673277</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>2048</MatrixWidth>
|
||||||
|
<MatrixHeight>1024</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>11</ows:Identifier>
|
||||||
|
<ScaleDenominator>136494.69336639</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>4096</MatrixWidth>
|
||||||
|
<MatrixHeight>2048</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>12</ows:Identifier>
|
||||||
|
<ScaleDenominator>68247.346683193</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>8192</MatrixWidth>
|
||||||
|
<MatrixHeight>4096</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>13</ows:Identifier>
|
||||||
|
<ScaleDenominator>34123.673341597</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>16384</MatrixWidth>
|
||||||
|
<MatrixHeight>8192</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>14</ows:Identifier>
|
||||||
|
<ScaleDenominator>17061.836670798</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>32768</MatrixWidth>
|
||||||
|
<MatrixHeight>16384</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>15</ows:Identifier>
|
||||||
|
<ScaleDenominator>8530.9183353991</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>65536</MatrixWidth>
|
||||||
|
<MatrixHeight>32768</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>16</ows:Identifier>
|
||||||
|
<ScaleDenominator>4265.4591676996</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>131072</MatrixWidth>
|
||||||
|
<MatrixHeight>65536</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>17</ows:Identifier>
|
||||||
|
<ScaleDenominator>2132.7295838498</ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>262144</MatrixWidth>
|
||||||
|
<MatrixHeight>131072</MatrixHeight>
|
||||||
|
</TileMatrix>
|
||||||
|
<TileMatrix>
|
||||||
|
<ows:Identifier>18</ows:Identifier>
|
||||||
|
<ScaleDenominator></ScaleDenominator>
|
||||||
|
<TopLeftCorner>90 -180</TopLeftCorner>
|
||||||
|
<TileWidth>256</TileWidth>
|
||||||
|
<TileHeight>256</TileHeight>
|
||||||
|
<MatrixWidth>524288</MatrixWidth>
|
||||||
|
<MatrixHeight>262144</MatrixHeight>
|
||||||
|
</TileMatrix></TileMatrixSet>
|
||||||
|
</Contents>
|
||||||
|
<ServiceMetadataURL xlink:href="{{baseUrl}}/wmts/{{id}}/"/>
|
||||||
|
</Capabilities>
|
|
@ -7,8 +7,7 @@ process.env.UV_THREADPOOL_SIZE =
|
||||||
var fs = require('fs'),
|
var fs = require('fs'),
|
||||||
path = require('path');
|
path = require('path');
|
||||||
|
|
||||||
var base64url = require('base64url'),
|
var clone = require('clone'),
|
||||||
clone = require('clone'),
|
|
||||||
cors = require('cors'),
|
cors = require('cors'),
|
||||||
enableShutdown = require('http-shutdown'),
|
enableShutdown = require('http-shutdown'),
|
||||||
express = require('express'),
|
express = require('express'),
|
||||||
|
@ -269,6 +268,7 @@ function start(opts) {
|
||||||
data['key_query_part'] =
|
data['key_query_part'] =
|
||||||
req.query.key ? 'key=' + req.query.key + '&' : '';
|
req.query.key ? 'key=' + req.query.key + '&' : '';
|
||||||
data['key_query'] = req.query.key ? '?key=' + req.query.key : '';
|
data['key_query'] = req.query.key ? '?key=' + req.query.key : '';
|
||||||
|
if (template === 'wmts') res.set('Content-Type', 'text/xml');
|
||||||
return res.status(200).send(compiled(data));
|
return res.status(200).send(compiled(data));
|
||||||
});
|
});
|
||||||
resolve();
|
resolve();
|
||||||
|
@ -295,12 +295,7 @@ function start(opts) {
|
||||||
Math.floor(centerPx[0] / 256) + '/' +
|
Math.floor(centerPx[0] / 256) + '/' +
|
||||||
Math.floor(centerPx[1] / 256) + '.png';
|
Math.floor(centerPx[1] / 256) + '.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
var query = req.query.key ? ('?key=' + req.query.key) : '';
|
|
||||||
style.wmts_link = 'http://wmts.maptiler.com/' +
|
|
||||||
base64url('http://' + req.headers.host +
|
|
||||||
'/styles/' + id + '.json' + query) + '/wmts';
|
|
||||||
|
|
||||||
var tiles = utils.getTileUrls(
|
var tiles = utils.getTileUrls(
|
||||||
req, style.serving_rendered.tiles,
|
req, style.serving_rendered.tiles,
|
||||||
'styles/' + id, style.serving_rendered.format);
|
'styles/' + id, style.serving_rendered.format);
|
||||||
|
@ -325,11 +320,6 @@ function start(opts) {
|
||||||
Math.floor(centerPx[1] / 256) + '.' + data_.format;
|
Math.floor(centerPx[1] / 256) + '.' + data_.format;
|
||||||
}
|
}
|
||||||
|
|
||||||
var query = req.query.key ? ('?key=' + req.query.key) : '';
|
|
||||||
data_.wmts_link = 'http://wmts.maptiler.com/' +
|
|
||||||
base64url('http://' + req.headers.host +
|
|
||||||
'/data/' + id + '.json' + query) + '/wmts';
|
|
||||||
|
|
||||||
var tiles = utils.getTileUrls(
|
var tiles = utils.getTileUrls(
|
||||||
req, data_.tiles, 'data/' + id, data_.format, {
|
req, data_.tiles, 'data/' + id, data_.format, {
|
||||||
'pbf': options.pbfAlias
|
'pbf': options.pbfAlias
|
||||||
|
@ -374,6 +364,20 @@ function start(opts) {
|
||||||
return res.redirect(301, '/styles/' + req.params.id + '/');
|
return res.redirect(301, '/styles/' + req.params.id + '/');
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
|
serveTemplate('/styles/:id/wmts.xml', 'wmts', function(req) {
|
||||||
|
var id = req.params.id;
|
||||||
|
var wmts = clone((config.styles || {})[id]);
|
||||||
|
if (!wmts) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (wmts.hasOwnProperty("serve_rendered") && !wmts.serve_rendered) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
wmts.id = id;
|
||||||
|
wmts.name = (serving.styles[id] || serving.rendered[id]).name;
|
||||||
|
wmts.baseUrl = (req.get('X-Forwarded-Protocol')?req.get('X-Forwarded-Protocol'):req.protocol) + '://' + req.get('host');
|
||||||
|
return wmts;
|
||||||
|
});
|
||||||
|
|
||||||
serveTemplate('/data/:id/$', 'data', function(req) {
|
serveTemplate('/data/:id/$', 'data', function(req) {
|
||||||
var id = req.params.id;
|
var id = req.params.id;
|
||||||
|
|
Loading…
Reference in a new issue