Function: RenderKml

Parameters

Implementation

%STARTINCLUDE%
~~~ %STARTALIASAREA%
%~~ DBQUERY{"Typ='Parkplatz' OR Typ='Abschnitt' OR Typ='Canyon'"
~~~ header="<kml xmlns=\"http://earth.google.com/kml/2.2\">
<Document>
   <name>CWiki Canyons</name>
   <Style id=\"sn_red-circle\">
      <IconStyle>
         <Icon>
            <href>http://maps.google.com/mapfiles/kml/paddle/red-circle.png</href>
         </Icon>
         <hotSpot x=\"32\" y=\"1\" xunits=\"pixels\" yunits=\"pixels\"/>
      </IconStyle>
      <ListStyle>
         <ItemIcon>
            <href>http://maps.google.com/mapfiles/kml/paddle/red-circle-lv.png</href>
         </ItemIcon>
      </ListStyle>
   </Style>
   <Style id=\"sh_blu-circle\">
      <IconStyle>
         <scale>0.8</scale>
         <Icon>
            <href>http://maps.google.com/mapfiles/kml/paddle/blu-circle.png</href>
         </Icon>
         <hotSpot x=\"32\" y=\"1\" xunits=\"pixels\" yunits=\"pixels\"/>
      </IconStyle>
      <ListStyle>
         <ItemIcon>
            <href>http://maps.google.com/mapfiles/kml/paddle/blu-circle-lv.png</href>
         </ItemIcon>
      </ListStyle>
   </Style>
   <Style id=\"sh_parking_lot\">
      <IconStyle>
         <scale>0.8</scale>
         <Icon>
            <href>http://maps.google.com/mapfiles/kml/shapes/parking_lot.png</href>
         </Icon>
         <hotSpot x=\"0.5\" y=\"0\" xunits=\"fraction\" yunits=\"fraction\"/>
      </IconStyle>
      <ListStyle>
      </ListStyle>
   </Style>
   <Style id=\"sn_parking_lot\">
      <IconStyle>
         <scale>0.7</scale>
         <Icon>
            <href>http://maps.google.com/mapfiles/kml/shapes/parking_lot.png</href>
         </Icon>
         <hotSpot x=\"0.5\" y=\"0\" xunits=\"fraction\" yunits=\"fraction\"/>
      </IconStyle>
      <ListStyle>
      </ListStyle>
   </Style>
   <Style id=\"sh_red-circle\">
      <IconStyle>
         <scale>1</scale>
         <Icon>
            <href>http://maps.google.com/mapfiles/kml/paddle/red-circle.png</href>
         </Icon>
         <hotSpot x=\"32\" y=\"1\" xunits=\"pixels\" yunits=\"pixels\"/>
      </IconStyle>
      <ListStyle>
         <ItemIcon>
            <href>http://maps.google.com/mapfiles/kml/paddle/red-circle-lv.png</href>
         </ItemIcon>
      </ListStyle>
   </Style>
   <StyleMap id=\"msn_parking_lot\">
      <Pair>
         <key>normal</key>
         <styleUrl>#sn_parking_lot</styleUrl>
      </Pair>
      <Pair>
         <key>highlight</key>
         <styleUrl>#sh_parking_lot</styleUrl>
      </Pair>
   </StyleMap>
   <StyleMap id=\"msn_red-circle\">
      <Pair>
         <key>normal</key>
         <styleUrl>#sn_red-circle</styleUrl>
      </Pair>
      <Pair>
         <key>highlight</key>
         <styleUrl>#sh_red-circle</styleUrl>
      </Pair>
   </StyleMap>
   <Style id=\"sn_blu-circle\">
      <IconStyle>
         <scale>0.7</scale>
         <Icon>
            <href>http://maps.google.com/mapfiles/kml/paddle/blu-circle.png</href>
         </Icon>
         <hotSpot x=\"32\" y=\"1\" xunits=\"pixels\" yunits=\"pixels\"/>
      </IconStyle>
      <ListStyle>
         <ItemIcon>
            <href>http://maps.google.com/mapfiles/kml/paddle/blu-circle-lv.png</href>
         </ItemIcon>
      </ListStyle>
   </Style>
   <StyleMap id=\"msn_blu-circle\">
      <Pair>
         <key>normal</key>
         <styleUrl>#sn_blu-circle</styleUrl>
      </Pair>
      <Pair>
         <key>highlight</key>
         <styleUrl>#sh_blu-circle</styleUrl>
      </Pair>
   </StyleMap>
      <LookAt>
         <longitude>12.34532847627182</longitude>
         <latitude>45.66349150813077</latitude>
         <altitude>0</altitude>
         <range>1611925.486068646</range>
         <tilt>0</tilt>
         <heading>3.541948587532645</heading>
      </LookAt>
"
~~~ footer="</Document>
</kml>"
*~~ format="
$percntIFDEFINEDTHEN{\"$formfield(Einstiegskoordinate_x)\"}$percnt
      <Placemark>
         <name>$percntDBCALL{\"RenderCanyonName\" name=\"$topic\"}$percnt</name>
         <description>%3C![CDATA[
<table style='margin:0px' cellspacing='0'>
<tr bgcolor='#eeeeee'><th>Flussname</th><td>$formfield(Flussname)</td></tr>
<tr bgcolor='#dddddd'><th>Schluchtname</th><td>$formfield(Schluchtname)</td></tr>
<tr bgcolor='#eeeeee'><th>Aliasname</th><td>$formfield(Aliasname)</td></tr>
<tr bgcolor='#dddddd'><th>Bewertung</th><td>v$formfield(Vertikalitaet),a$formfield(Aquatik),Risiko$formfield(Gesamtrisiko)</td></tr>
<tr  bgcolor='#eeeeee'><th>Absicherung</th><td>Absicherung$formfield(Absicherung)</td></tr>
<tr  bgcolor='#dddddd'><th>Höhendiff.</th><td>$percntCALC{$SUM($formfield(Einstiegshoehe), -$formfield(Ausstiegshoehe))}$percnt m</td></tr>
<tr  bgcolor='#eeeeee'><th>Gesamtzeit</th><td>$percntCALC{$FORMATGMTIME($EVAL( ($formfield(Zustiegszeit) + $formfield(Routenzeit) + $formfield(Rueckwegszeit)) * 60 ), $hourh $minute') }$percnt</td></tr>
</table>
<br/>
<a href='https://canyon.carto.net/%SCRIPTURLPATH{"view"}%/Canyons/$topic' target='_parent'>$percntDBCALL{\"RenderCanyonName\" name=\"$topic\"}$percnt</a> auf https://canyon.carto.net/
<br/>
]]%3E</description>
         <LookAt>
            <longitude>$expand(Einstiegskoordinate_x)</longitude>
            <latitude>$expand(Einstiegskoordinate_y)</latitude>
            <altitude>0</altitude>
            <range>6000</range>
            <tilt>50</tilt>
            <heading>0</heading>
            <altitudeMode>relativeToGround</altitudeMode>
         </LookAt>
         <styleUrl>#msn_red-circle</styleUrl>
         <Point>
            <coordinates>$expand(Einstiegskoordinate_x),$expand(Einstiegskoordinate_y),0</coordinates>
         </Point>
      </Placemark>
$percntFIDEFINED$percnt
$percntIFDEFINEDTHEN{\"$formfield(Ausstiegskoordinate_x)\"}$percnt
      <Placemark>
         <name>$percntDBCALL{\"RenderCanyonName\" name=\"$topic\"}$percnt Ausstieg</name>
         <LookAt>
            <longitude>$expand(Ausstiegskoordinate_x)</longitude>
            <latitude>$expand(Ausstiegskoordinate_y)</latitude>
            <altitude>0</altitude>
            <range>6000</range>
            <tilt>50</tilt>
            <heading>0</heading>
            <altitudeMode>relativeToGround</altitudeMode>
         </LookAt>
         <styleUrl>#msn_blu-circle</styleUrl>
         <Point>
            <coordinates>$expand(Ausstiegskoordinate_x),$expand(Ausstiegskoordinate_y),0</coordinates>
         </Point>
      </Placemark>
$percntFIDEFINED$percnt
$percntIFDEFINEDTHEN{\"$formfield(Koordinate_x)\"}$percnt
      <Placemark>
         <name>$topic</name>
         <description><![CDATA[  Ausgangspunkt zu $percntDBCALL{\"RenderCanyonLinkList\" list=\"$formfield(Canyons)\"}$percnt
<br/>
<br/>
<a href='https://canyon.carto.net/%SCRIPTURLPATH{"view"}%/Canyons/$topic' target='_parent'>$topic</a> auf https://canyon.carto.net/
<br/>
         ]]></description>
         <LookAt>
            <longitude>$expand(Ausstiegskoordinate_x)</longitude>
            <latitude>$expand(Ausstiegskoordinate_y)</latitude>
            <altitude>0</altitude>
            <range>6000</range>
            <tilt>50</tilt>
            <heading>0</heading>
            <altitudeMode>relativeToGround</altitudeMode>
         </LookAt>
         <styleUrl>#msn_parking_lot</styleUrl>
         <Point>
            <coordinates>$expand(Koordinate_x),$expand(Koordinate_y),0</coordinates>
         </Point>
      </Placemark>
$percntFIDEFINED$percnt
"}%
%STOPALIASAREA%
<!--
%ALIASES{"CanyonAliases" merge="on"}%
-->
%STOPINCLUDE%

Test

-- PeterSykora - 17 Sep 2008

Topic revision: r9 - 2013-01-15 - PeterSykora