Function: RenderKmlSingle

Parameters

Implementation

%STARTINCLUDE%
~~~ %STARTALIASAREA%
~~~ %DBQUERY{topic="%NAME%" format="
~~~ <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>$expand(Einstiegskoordinate_x)</longitude>
         <latitude>$expand(Einstiegskoordinate_y)</latitude>
         <altitude>0</altitude>
         <range>6000</range>
         <tilt>0</tilt>
         <heading>1.4</heading>
      </LookAt>
$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>500</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>%3C![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/>
         ]]%3E</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
</Document>
</kml>
"}%
%STOPALIASAREA%
<!--
%ALIASES{"CanyonAliases" merge="on"}%
-->
%STOPINCLUDE%

Test

CWiki Canyons normal #sn_parking_lot highlight #sh_parking_lot normal #sn_red-circle highlight #sh_red-circle normal #sn_blu-circle highlight #sh_blu-circle 9.34104 46.83877 6000 1.4 Val Turnigla %3C![CDATA[
FlussnameTurnigla
SchluchtnameVal Turnigla
Aliasname
Bewertungv4,a5,V
AbsicherungAbsicherung2
Höhendiff.255 m
Gesamtzeit04h 45'

Val Turnigla auf https://canyon.carto.net/
]]%3E
9.34104 46.83877 500 50 relativeToGround #msn_red-circle 9.34104,46.83877,0
Val Turnigla Ausstieg 9.34013 46.83348 6000 50 relativeToGround #msn_blu-circle 9.34013,46.83348,0

-- PeterSykora - 15 Jan 2013

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