changeset 110:346cbc290aff

changable color for dots in map
author fknauft
date Tue, 01 Feb 2011 18:24:35 +0100
parents 9db303437b32
children 086e6a257e60
files zpt/KML_schema_table.zpt
diffstat 1 files changed, 41 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/zpt/KML_schema_table.zpt	Tue Feb 01 18:24:21 2011 +0100
+++ b/zpt/KML_schema_table.zpt	Tue Feb 01 18:24:35 2011 +0100
@@ -1,17 +1,53 @@
 <?xml version="1.0" encoding="utf-8"?>
 <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:tal="http://xml.zope.org/namespaces/tal" 
-  tal:define="gisIdField python:request.get('gis_id_field',None);
+  tal:define="gisIdField python:request.get('gis_id_field',None); colorField python:request.get('color_field',None);
   latField python:request.get('lat_field',None); lonField python:request.get('lon_field',None);
   sortBy python:request.get('sort_field',1);
   schema options/schema; table options/table; 
   data python:here.getKmlData(schema=schema,table=table,sortBy=sortBy,gisIdField=gisIdField,latField=latField,lonField=lonField); 
   withLine python:request.get('connect_line',None);">
   <Document>
-    <Style id="marker_icon">
+    <Style id="marker_icon_red">
+      <IconStyle>
+        <scale>1.2</scale>
+        <Icon>
+          <href>http://mappit.mpiwg-berlin.mpg.de/mappit/icons/dot_red.png</href>
+        </Icon>
+        <hotSpot x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
+      </IconStyle>
+    </Style>
+   <Style id="marker_icon_black">
       <IconStyle>
         <scale>1.2</scale>
         <Icon>
-          <href>http://chinagis.mpiwg-berlin.mpg.de/chinagis/images/dot_red.png</href>
+          <href>http://mappit.mpiwg-berlin.mpg.de/mappit/icons/dot_black.png</href>
+        </Icon>
+        <hotSpot x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
+      </IconStyle>
+    </Style>
+   <Style id="marker_icon_blue">
+      <IconStyle>
+        <scale>1.2</scale>
+        <Icon>
+          <href>http://mappit.mpiwg-berlin.mpg.de/mappit/icons/dot_blue.png</href>
+        </Icon>
+        <hotSpot x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
+      </IconStyle>
+    </Style>
+   <Style id="marker_icon_green">
+      <IconStyle>
+        <scale>1.2</scale>
+        <Icon>
+          <href>http://mappit.mpiwg-berlin.mpg.de/mappit/icons/dot_green.png</href>
+        </Icon>
+        <hotSpot x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
+      </IconStyle>
+    </Style>
+   <Style id="marker_icon_violett">
+      <IconStyle>
+        <scale>1.2</scale>
+        <Icon>
+          <href>http://mappit.mpiwg-berlin.mpg.de/mappit/icons/dot_violett.png</href>
         </Icon>
         <hotSpot x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
       </IconStyle>
@@ -29,7 +65,8 @@
       <description tal:content="place/description">
       ERD-0815: ERD-0815
       </description>
-      <styleUrl tal:content="place/icon">#marker_icon</styleUrl>
+#      <styleUrl tal:content="place/icon">#marker_icon</styleUrl>
+      <styleUrl tal:content="string:#marker_icon_${color_field">#marker_icon_red</styleUrl>
       <Point>
         <coordinates tal:content="string:${place/coord_x},${place/coord_y},${place/coord_z}">116.38,39.92,0</coordinates>
       </Point>