Include KML in tutorial

With the Google Earth API that can be used in web pages, it is possible to interactively include kml files in the tutorials or other webpages on the OpenEarth wiki. This tutorial explaines how to include a google earth API in a web page.

Contents

Google earth API licence key

How to include a google Earth API in a html file is described in the Google Earth API documentation. Keys are freely available, but they only work at child pages of the base url for which it was registered. At this moment there are two keys registered that can be used to include google earth on the wiki:

Key Useage
ABQIAAAA9KO06BPsmsvzw4PogoawhRSy_gnlezoEvdu0tA7HZgv5qdaupRRCGAytCifAIns0R25EQD_uP7lUDw This key can be used directly in all OpenEarth wiki pages whereas it was registered for http://public.deltares.nl (which actually is the base url of the server that hosts the OpenEarth wiki)
ABQIAAAA9KO06BPsmsvzw4PogoawhRRxYg1slSMvxuda9W0Kolc-SbeLlhQGHwE9W-XlCfe8WtZh74R56zOChQ This key needs to be used in order to get the tutorials working. The key was registered for http://crucible.deltgeosystems.nl (which is used to host all files that are in the repository - including version info etc. -)

Google Earth in OpenEarth matlab tutorials

To make life easier the code necessary to run the google api in a html page is included in the openearth tutorial template. It is enough to include the following code in your tutorial:

%
% <html>
%    <div class="geapi" url="http://dtvirt5.deltares.nl/kml/Examples/Ameland - Jarkus Raaien.kmz"
%         id="testGeApi"
%         style="height: 600px; width: 800px;"
%         lon=53.44
%         lat=5.69
%         rot=210
%         tilt=70
%         alt=15418>
%    </div>
% </html>
%

In this example:

Attribute Value Explanation
class "geapi" The class of the div must always be "geapi". This is used to identify all divs that have to be converted to a google earth api.
id a unique name (string) The id of the div (unique name) is used by the code to create an instance of the google earth api and therefore must be included (and be unique in the html page)
style Any valid style string The style determines the look of the div that contains the google api. Style can also be specified using css (to determine the style of all .geapi at once.).
url full url to the kml or kmz file that must be shown This must be the full url to the kml or kmz file that must be shown. The google api does not support relative url's at this moment.
lon double longitude at which the camera position aims (decimal notation)
lat double latitude at which the camera position aims (decimal notation)
rot double rotation of the camera
tilt double tilt of the camera
alt double altitude of the camera

Next to the relative url's that do not work the API cannot be hidden at this point. therefore the openearth tutorial forces any chapter that contains a GE-API to be opened at all times.

Example

Lets include the API according to the code explained in the previous chapter

Have fun playing with it.....