1. Oliver Tonnhofer
  2. mapproxy

Commits

Marcel Radischat  committed 99919e5

only display the configured services and show an information, if the specific service is not available/configured

  • Participants
  • Parent commits 34439d7
  • Branches default

Comments (0)

Files changed (1)

File mapproxy/service/templates/demo/demo.html

View file
             <h2>About</h2>
             <p>MapProxy Version {{version}}</p>
             <h2>WMS</h2>
+            {{if 'wms' in services}}
             <div class="capabilities">
-            <span>Capabilities Document</span>
-            <span><a href="../service?REQUEST=GetCapabilities">(download as xml)</a></span>
-            <span><a href="../demo/?wms_capabilities">(view as html)</a></span>
+                <span>Capabilities Document</span>
+                <span><a href="../service?REQUEST=GetCapabilities">(download as xml)</a></span>
+                <span><a href="../demo/?wms_capabilities">(view as html)</a></span>
             </div>
             <table class="code">
                 <tr>
                     {{endfor}}
                 {{endfor}}
             </table>
+            {{else}}
+            <div class="capabilities">
+                <span>This service is not available with the current configuration</span>
+            </div>
+            {{endif}}
             <h2>WMS-C</h2>
+            {{if 'wms' in services}}
             <div class="capabilities">
-            <span>Capabilities Document</span>
-            <span><a href="../service?REQUEST=GetCapabilities&tiled=true">(download as xml)</a></span>
-            <span><a href="../demo/?wmsc_capabilities">(view as html)</a></span>
+                <span>Capabilities Document</span>
+                <span><a href="../service?REQUEST=GetCapabilities&tiled=true">(download as xml)</a></span>
+                <span><a href="../demo/?wmsc_capabilities">(view as html)</a></span>
             </div>
+            {{else}}
+            <div class="capabilities">
+                <span>This service is not available with the current configuration</span>
+            </div>
+            {{endif}}
+            <h2>WMTS</h2>
+            {{if 'wmts' in services}}
+            <div class="capabilities">
+                <span>Capabilities Document</span>
+                <span><a href="../wmts/1.0.0/WMTSCapabilities.xml">(download as xml)</a></span>
+                <span><a href="../demo/?wmts_capabilities">(view as html)</a></span>
+            </div>
+            <table class="code">
+                <tr>
+                    <th>Layer</th>
+                    <th>Coordinate-System</th>
+                    <th>Image-Format</th>
+                </tr>
+            {{for wmts_layer_name, wmts_layers in wmts_layers.items()}}
+            <tr><td rowspan="{{len(wmts_layers)}}">{{wmts_layer_name}}</td>
+                {{for loop, layer in looper(wmts_layers)}}
+                    {{if not loop.first}}
+                        <tr>
+                    {{endif}}
+                    <td class="value"><a href="../demo/?wmts_layer={{layer.name}}&format={{format}}&srs={{layer.grid.srs.srs_code | quote}}">{{layer.grid.srs.srs_code}}</a></td>
+                    <td class="value"><a href="../demo/?wmts_layer={{layer.name}}&format={{format}}&srs={{layer.grid.srs.srs_code | quote}}">{{layer.format}}</a></td>
+                {{endfor}}
+            {{endfor}}
+            </table>
+            {{else}}
+            <div class="capabilities">
+                <span>This service is not available with the current configuration</span>
+            </div>
+            {{endif}}
             <h2>TMS</h2>
+            {{if 'tms' in services}}
             <div class="capabilities">
-            <span>Capabilities Document</span>
-            <span><a href="../tms/1.0.0/">(download as xml)</a></span>
-            <span><a href="../demo/?tms_capabilities">(view as html)</a></span>
+                <span>Capabilities Document</span>
+                <span><a href="../tms/1.0.0/">(download as xml)</a></span>
+                <span><a href="../demo/?tms_capabilities">(view as html)</a></span>
             </div>
             <table class="code">
                 <tr>
                 {{endfor}}
             {{endfor}}
             </table>
+            {{else}}
+            <div class="capabilities">
+                <span>This service is not available with the current configuration</span>
+            </div>
+            {{endif}}