view zpt/KML_schema_table.zpt @ 220:733f0561d9f8

implement Google Search
author fknauft
date Fri, 01 Apr 2011 10:52:37 +0200
parents 769866d9d96d
children bdab16f83512
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','red');
  latField python:request.get('lat_field',None); lonField python:request.get('lon_field',None); geomField python:request.get('geometry_field','poly');
  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,geomField=geomField,colorField=colorField ); 
  withLine python:request.get('connect_line',None);">
  <Document>
    <Style id="marker_icon_red">
      <IconStyle>
        <size>"10"</size>
        <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>
        <size>"0.2"</size>
        <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>"0.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>"0.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>"0.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="marker_icon_red_big">
      <IconStyle>
        <size>"10"</size>
        <Icon>
          <href>http://mappit.mpiwg-berlin.mpg.de/mappit/icons/dot_red_big.png</href>
        </Icon>
        <hotSpot x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
      </IconStyle>
    </Style>
   <Style id="marker_icon_black_big">
      <IconStyle>
        <size>"0.2"</size>
        <Icon>
          <href>http://mappit.mpiwg-berlin.mpg.de/mappit/icons/dot_black_big.png</href>
        </Icon>
        <hotSpot x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
      </IconStyle>
    </Style>
   <Style id="marker_icon_blue_big">
      <IconStyle>
        <scale>"0.2"</scale>
        <Icon>
          <href>http://mappit.mpiwg-berlin.mpg.de/mappit/icons/dot_blue_big.png</href>
        </Icon>
        <hotSpot x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
      </IconStyle>
    </Style>
   <Style id="marker_icon_green_big">
      <IconStyle>
        <scale>"0.2"</scale>
        <Icon>
          <href>http://mappit.mpiwg-berlin.mpg.de/mappit/icons/dot_green_big.png</href>
        </Icon>
        <hotSpot x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
      </IconStyle>
    </Style>
   <Style id="marker_icon_violett_big">
      <IconStyle>
        <scale>"0.2"</scale>
        <Icon>
          <href>http://mappit.mpiwg-berlin.mpg.de/mappit/icons/dot_violett_big.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" tal:condition="python:here.trydatahas_key(data,0,'icon')">
      <description tal:content="place/description" >
      ERD-0815: ERD-0815
      </description>
      <styleUrl tal:content="place/icon" >#marker_icon_red</styleUrl>
      <Point tal:condition="python:place.has_key('icon')">
        <coordinates tal:content="string:${place/coord_x},${place/coord_y},${place/coord_z}">116.38,39.92,0</coordinates>
      </Point>
    </Placemark>
    <Placemark tal:repeat="place data" tal:condition="python:here.trydatahas_key(data,0,'LinearRing')">
      <description tal:content="place/description" >
      ERD-0815: ERD-0815
      </description>
      <Style> <PolyStyle><color tal:content="place/LineColor">#80800000</color><fill>0.1</fill><outline>1</outline></PolyStyle></Style>
      <Polygon><outerBoundaryIs><LinearRing><coordinates tal:content="string:${place/LinearRing}">116.38,39.92,0</coordinates>
          </LinearRing></outerBoundaryIs></Polygon>
    </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>