changeset 122:d7be76eb64e6

polygon-Layers
author fknauft
date Wed, 02 Feb 2011 14:14:49 +0100
parents 469e8a463df0
children f0a5a4e324ea
files RestDbGisApi.py zpt/KML_schema_table.zpt
diffstat 2 files changed, 12 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/RestDbGisApi.py	Wed Feb 02 13:59:01 2011 +0100
+++ b/RestDbGisApi.py	Wed Feb 02 14:14:49 2011 +0100
@@ -287,12 +287,13 @@
             #kmlPlace['description'] = "<![CDATA[%s]]>"%desc
             kmlPlace['description'] = desc
             if geometry=='point':
-               kmlPlace['icon'] = '#marker_icon'
+               kmlPlace['icon'] = '#marker_icon_'+color_field
                kmlPlace['coord_x'] = str(xCoord)
                kmlPlace['coord_y'] = str(yCoord)
                kmlPlace['coord_z'] = '0'
             if geometry=='poly':
                 kmlPlace['LinearRing']=geomdata.split('(')[4]
+                kmlPlace['LineColor']=color_field
             kmlData.append(kmlPlace)
     
         #logging.debug("kmlData=%s"%(repr(kmlData)))
--- a/zpt/KML_schema_table.zpt	Wed Feb 02 13:59:01 2011 +0100
+++ b/zpt/KML_schema_table.zpt	Wed Feb 02 14:14:49 2011 +0100
@@ -61,24 +61,19 @@
         <color>ff0000ff</color>
       </PolyStyle>
     </Style>
-    <Placemark tal:repeat="place data" tal:condition="${place/icon}">
-      <description tal:content="place/description">
+    <Placemark tal:repeat="place data" >
+      <description tal:content="place/description" tal:condition="place/icon">
       ERD-0815: ERD-0815
       </description>
-#      <styleUrl tal:content="place/icon">#marker_icon</styleUrl>
-      <styleUrl tal:content="string:#marker_icon_${colorField}">#marker_icon_red</styleUrl>
-      <Point>
-        <coordinates tal:content="string:${place/coord_x},${place/coord_y},${place/coord_z}">116.38,39.92,0</coordinates>
+#      <styleUrl tal:content="place/icon" >#marker_icon</styleUrl>
+      <styleUrl tal:content="place/icon" tal:condition="place/icon">#marker_icon_red</styleUrl>
+      <Point tal:condition="place/icon">
+        <coordinates tal:content="string:${place/coord_x},${place/coord_y},${place/coord_z}" tal:condition="place/icon">116.38,39.92,0</coordinates>
       </Point>
-    </Placemark>
-    <Placemark tal:repeat="place data" tal:condition="${place/LinearRing}">
-      <description tal:content="place/description">
-      ERD-0815: ERD-0815
-      </description>
-#      <styleUrl tal:content="place/icon">#marker_icon</styleUrl>
-      <Style><PolyStyle><color>#80800000</color><fill>1</fill><outline>1</outline></PolyStyle></Style>
-      <MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates> tal:content="string:${place/LinearRing}">116.38,39.92,0</coordinates>
-      </LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
+      <Style tal:condition="place/LinearRing">
+         <PolyStyle><color tal:content="place/LineColor">#80800000</color><fill>1</fill><outline>1</outline></PolyStyle></Style>
+      <MultiGeometry tal:condition="place/LinearRing"><Polygon><outerBoundaryIs><LinearRing><coordinates> tal:content="string:${place/LinearRing}">116.38,39.92,0</coordinates>
+          </LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
     </Placemark> 
     <Placemark tal:condition="withLine">
       <name>Path</name>