view zpt/KML_schema_table.zpt @ 112:aac0c59c41d6

changable color for dots in map
author fknauft
date Tue, 01 Feb 2011 18:32:19 +0100
parents 346cbc290aff
children 3369c21b66e0
line wrap: on
line source

<?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); 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_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://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>
    </Style>
    <Style id="red_line">
      <LineStyle>
        <color>ff0000ff</color>
        <width>4</width>
      </LineStyle>
      <PolyStyle>
        <color>ff0000ff</color>
      </PolyStyle>
    </Style>
    <Placemark tal:repeat="place data">
      <description tal:content="place/description">
      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>
      </Point>
    </Placemark>
    <Placemark tal:condition="withLine">
      <name>Path</name>
      <description>Red line visualizes path between locations</description>
      <styleUrl>#red_line</styleUrl>
      <LineString>
        <extrude>1</extrude>
        <tessellate>1</tessellate>
        <altitudeMode>clampToGround</altitudeMode>
        <coordinates>
          <tal:span tal:repeat="place data" tal:content="string:${place/coord_x},${place/coord_y},${place/coord_z}">116.38,39.92,0</tal:span>
        </coordinates>
      </LineString>
    </Placemark>
  </Document>
</kml>