[mapguide-commits] r9247 - sandbox/jng/ogc/Server/src/Wms

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Nov 10 07:49:12 PST 2017


Author: jng
Date: 2017-11-10 07:49:12 -0800 (Fri, 10 Nov 2017)
New Revision: 9247

Modified:
   sandbox/jng/ogc/Server/src/Wms/1.1.0.xml.awd
   sandbox/jng/ogc/Server/src/Wms/1.1.1.xml.awd
Log:
- Port GeoJSON templates over to 1.1.0.xml.awd
- Port over base GetFeatureInfo HTML template from 1.1.0 template to 1.1.1 template (1.1.0 had html.stylesheet, 1.1.1 did not)


Modified: sandbox/jng/ogc/Server/src/Wms/1.1.0.xml.awd
===================================================================
--- sandbox/jng/ogc/Server/src/Wms/1.1.0.xml.awd	2017-11-10 15:24:48 UTC (rev 9246)
+++ sandbox/jng/ogc/Server/src/Wms/1.1.0.xml.awd	2017-11-10 15:49:12 UTC (rev 9247)
@@ -77,6 +77,7 @@
   <FeatureInfo>
   <?Endif?>
   <?EnumFeatureProperties using="&FeatureProperty.xml;" ?>
+  <?EnumFeatureGeometries using="&FeatureGeometry.xml;" ?>
   </FeatureInfo>
  </Define>
 
@@ -85,6 +86,7 @@
    <td>
     <table>
      <?EnumFeatureProperties using="&FeatureProperty.html;" ?>
+     <?EnumFeatureGeometries using="&FeatureGeometry.html;" ?>
     </table>
    </td>
   </tr>
@@ -93,9 +95,20 @@
  <Define item="FeatureInfo.text">
   FeatureInfo:
   <?EnumFeatureProperties using="&FeatureProperty.text;" ?>
+  <?EnumFeatureGeometries using="&FeatureGeometry.text;" ?>
 
  </Define>
 
+ <!-- 
+ Ugly, but we have to do 2 iteration passes to output the right
+ content in the right places for GeoJSON
+  -->
+ <Define item="FeatureInfo.json">{
+    "type": "Feature",
+    "properties": {<?EnumFeatureProperties using="&FeatureProperty.json;" ?>},
+    "geometry": <?EnumFeatureGeometries using="&FeatureGeometry.json;" ?>
+}</Define>
+
  <Define item="FeatureProperty.xml">
   <Property name="&FeatureProperty.Name;" value="&FeatureProperty.Value;"></Property>
  </Define>
@@ -123,6 +136,25 @@
   <item>EPSG:4326</item>
  </Define>
 
+ <!-- Output all non-geometry properties -->
+ <Define item="FeatureProperty.json">"&FeatureProperty.Name;": "&FeatureProperty.Value;"<?If l="&FeatureProperty.IsLast" op="eq" r="0"?>,<?Endif?></Define>
+
+ <!-- Only output if property name is the designated geometry -->
+ <Define item="FeatureGeometry.json">&FeatureGeometry.Value;</Define>
+
+ <!-- Only output if property name is the designated geometry -->
+ <Define item="FeatureGeometry.text">Geometry=&FeatureGeometry.Value;</Define>
+
+ <!-- Only output if property name is the designated geometry -->
+ <Define item="FeatureGeometry.html">
+  <tr><td class="name">Geometry</td><td>&FeatureGeometry.Value;</td></tr>
+ </Define>
+
+ <!-- Only output if property name is the designated geometry -->
+ <Define item="FeatureGeometry.xml">
+  <Property name="Geometry" value="&FeatureGeometry.Value;"></Property>
+ </Define>
+
  <!-- We're currently not supporting child layers... -->
  <Define item="Layer.Sublayers"></Define>
 
@@ -398,8 +430,16 @@
  <?EnumFeatureInfo using="&FeatureInfo.text;" ?>
 </Response>
 
+<!-- 
 
+  WMS GetFeatureInfo - (Geo)JSON
 
+-->
+<Response request="GetFeatureInfo" content-type="application/json">
+  <?EnumFeatureInfo using="&FeatureInfo.json;" ?>
+</Response>
+
+
 <!--
 
   Exception Format  - XML

Modified: sandbox/jng/ogc/Server/src/Wms/1.1.1.xml.awd
===================================================================
--- sandbox/jng/ogc/Server/src/Wms/1.1.1.xml.awd	2017-11-10 15:24:48 UTC (rev 9246)
+++ sandbox/jng/ogc/Server/src/Wms/1.1.1.xml.awd	2017-11-10 15:49:12 UTC (rev 9247)
@@ -78,6 +78,7 @@
   <FeatureInfo>
   <?Endif?>
   <?EnumFeatureProperties using="&FeatureProperty.xml;" ?>
+  <?EnumFeatureGeometries using="&FeatureGeometry.xml;" ?>
   </FeatureInfo>
  </Define>
 
@@ -96,6 +97,7 @@
   FeatureInfo:
   <?EnumFeatureProperties using="&FeatureProperty.text;" ?>
   <?EnumFeatureGeometries using="&FeatureGeometry.text;" ?>
+
  </Define>
 
  <!-- 
@@ -134,6 +136,11 @@
   <tr><td class="name">Geometry</td><td>&FeatureGeometry.Value;</td></tr>
  </Define>
 
+ <!-- Only output if property name is the designated geometry -->
+ <Define item="FeatureGeometry.xml">
+  <Property name="Geometry" value="&FeatureGeometry.Value;"></Property>
+ </Define>
+
  <!-- We're currently not supporting child layers... -->
  <Define item="Layer.Sublayers"></Define>
 
@@ -383,9 +390,10 @@
 <html>
 <head>
 <title>GetFeatureInfo</title>
+&html.stylesheet;
 </head>
 <body>
-<table border="1">
+<table>
  <?EnumFeatureInfo using="&FeatureInfo.html;" ?>
 </table>
 </body>
@@ -411,6 +419,7 @@
   <?EnumFeatureInfo using="&FeatureInfo.json;" ?>
 </Response>
 
+
 <!--
 
   Exception format - XML



More information about the mapguide-commits mailing list