Skip to content

Commit eaa5359

Browse files
author
Mike LP
committed
Updated the index page to display the KML examples, minor tweaks to the Basic Parsing example for additional readability and removed entity from sample KML file for simplicity.
1 parent 3bb9c8b commit eaa5359

File tree

5 files changed

+43
-20
lines changed

5 files changed

+43
-20
lines changed

examples/kmlParse.html

+11-2
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,14 @@
173173
'</kml>', "application/xml");
174174

175175
//Load the KML object and move camera to point to it.
176-
viewer.flyTo(viewer.dataSources.add(Cesium.KmlDataSource.load(kmlDocument)));
176+
viewer.flyTo(
177+
viewer.dataSources.add(
178+
Cesium.KmlDataSource.load(kmlDocument)
179+
)
180+
);
177181

178182
function relevantSource() {
183+
//sample KML polygon box with an interior boundary
179184
var kmlDocument = new DOMParser().parseFromString(
180185
'<?xml version="1.0" encoding="UTF-8"?>' +
181186
'<kml xmlns="http://www.opengis.net/kml/2.2">' +
@@ -209,7 +214,11 @@
209214
'</kml>', "application/xml");
210215

211216
//Load the KML object and move camera to point to it.
212-
viewer.flyTo(viewer.dataSources.add(Cesium.KmlDataSource.load(kmlDocument)));
217+
viewer.flyTo(
218+
viewer.dataSources.add(
219+
Cesium.KmlDataSource.load(kmlDocument)
220+
)
221+
);
213222
}
214223
showSource('cesiumSource', relevantSource);
215224

examples/static/thumbs/kmlFetch.png

25.9 KB
Loading

examples/static/thumbs/kmlParsing.png

25.5 KB
Loading

index.html

+32-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@
136136
<p class="smallFont">(Google Earth <a href="http://earth-api-samples.googlecode.com/svn/trunk/demos/multiple/index.html" target="_blank">version</a>)</p>
137137
</td>
138138
</tr>
139-
</tr>
140139
<tr>
141140
<td>
142141
<a href="demos/draw/" target="_blank"><img src="demos/draw/thumb.png" width="162" height="130"></a>
@@ -146,6 +145,38 @@
146145
<p class="smallFont">(Google Earth <a href="http://earth-api-samples.googlecode.com/svn/trunk/demos/draw/index.html" target="_blank">version</a>)</p>
147146
</td>
148147
</tr>
148+
<tr>
149+
<td>
150+
<img src="examples/static/thumbs/kmlFetch.png" title="KML Fetch" alt="KML Fetch" />
151+
</td>
152+
<td>
153+
<p><strong>KML Fetching</strong></p>
154+
<p>
155+
<a href="examples/kmlFetchGood.html">KML Fetch</a>
156+
<span style="white-space: nowrap;" class="smallFont">(Google Earth <a href="http://earth-api-samples.googlecode.com/svn/trunk/examples/kml-fetch-good.html" target="_blank">version</a>)</span>
157+
</p>
158+
<p>
159+
<a href="examples/kmlFetchInteractive.html">KML Fetch: Interactive</a>
160+
<span style="white-space: nowrap;" class="smallFont">(Google Earth <a href="http://earth-api-samples.googlecode.com/svn/trunk/examples/kml-fetch-interactive.html" target="_blank">version</a>)</span>
161+
</p>
162+
</td>
163+
</tr>
164+
<tr>
165+
<td>
166+
<img src="examples/static/thumbs/kmlParsing.png" title="KML Parsing" alt="KML Parsing" />
167+
</td>
168+
<td>
169+
<p><strong>KML Parsing</strong></p>
170+
<p>
171+
<a href="examples/kmlParse.html">KML Parsing</a>
172+
<span style="white-space: nowrap;" class="smallFont">(Google Earth <a href="http://earth-api-samples.googlecode.com/svn/trunk/examples/kml-parse.html" target="_blank">version</a>)</span>
173+
</p>
174+
<p>
175+
<a href="examples/kmlParseTimeSpan.html">Parsing KML: Time Span</a>
176+
<span style="white-space: nowrap;" class="smallFont">(Google Earth <a href="http://earth-api-samples.googlecode.com/svn/trunk/examples/kml-parse-timespan.html" target="_blank">version</a>)</span>
177+
</p>
178+
</td>
179+
</tr>
149180
<tr>
150181
<td>
151182
<a href="examples/groundoverlay.html" target="_blank"><img src="examples/static/thumbs/groundoverlay.png" width="162" height="130"></a>

sampleData/kml/MaineScubaDiving.kml

-17
Original file line numberDiff line numberDiff line change
@@ -88,23 +88,6 @@ Free parking</description>
8888
<coordinates>-70.21297525869396,43.6254352929708,0</coordinates>
8989
</Point>
9090
</Placemark>
91-
<Placemark>
92-
<name>Monkey Skull Cove (Ram Island)</name>
93-
<LookAt>
94-
<longitude>-70.1887695109051</longitude>
95-
<latitude>43.63590892046476</latitude>
96-
<altitude>0</altitude>
97-
<heading>34.76987477618307</heading>
98-
<tilt>23.98349809652515</tilt>
99-
<range>199.6765255762913</range>
100-
<gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
101-
</LookAt>
102-
<styleUrl>#msn_water</styleUrl>
103-
<Point>
104-
<gx:drawOrder>1</gx:drawOrder>
105-
<coordinates>-70.1887695109051,43.63590892046476,0</coordinates>
106-
</Point>
107-
</Placemark>
10891
<Placemark>
10992
<name>Biddeford Pool</name>
11093
<LookAt>

0 commit comments

Comments
 (0)