﻿<?xml version="1.0" encoding="UTF-8"?>
<Module> 
<!--
Copyright 2009 Google Inc.
 
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
 
     http://www.apache.org/licenses/LICENSE-2.0
 
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Danish version by Søren Johannessen http://www.microformats.dk
--> 
<!--
thumbnail="http://code.google.com/apis/kml/embed/res/embedkmlgadget-thumb.png"
screenshot="http://code.google.com/apis/kml/embed/res/embedkmlgadget-screen.png"
description="Embed a KML file in your page using Google Earth or Google Maps!"
--> 
  <ModulePrefs title="Karl Friedrich von Münchhausens Vej" directory_title="Dansk Earth Wave" author="Søren Johannessen" author_email="soren.johannessen+danskearthwavegadget@gmail.com" author_affiliation="Private" width="850" height="650"> 
    <Locale lang="da" country="dk"></Locale> 
    <Require feature="minimessage"></Require> 
    <Require feature="wave"></Require> 
  </ModulePrefs> 
  
  
  
  <Content type="html"><![CDATA[
<script type="text/javascript" src="http://www.google.com/jsapi?hl=en&key=ABQIAAAAKkfkHb2nXsD0o1OX2TbdkRTZdFmpiU8vv3PBIA-hr88t-5BzzxQjEeEmKaZUy66ADwTlY8x2M14hHg"></script> 
<script src="http://earth-api-samples.googlecode.com/svn/trunk/lib/kmldomwalk.js" type="text/javascript"></script>
<script type="text/javascript">

  var ge;
  var photoOverlay = null;
  
  google.load("earth", "1");

  function init() {
    google.earth.createInstance('map3d', initCB, failureCB);
  }
  
  function initCB(instance) {
    ge = instance;
    ge.getWindow().setVisibility(true);

    
    // add a navigation control
    ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);
    
    // add some layers
   
 
var la = ge.createLookAt('');
  la.set(55.648511, 12.630444, 13, ge.ALTITUDE_RELATIVE_TO_GROUND, 
         29, 57, 200);
  ge.getView().setAbstractView(la); 


   
 ge.getOptions().setStatusBarVisibility(true);
ge.getLayerRoot().enableLayerById(ge.LAYER_TERRAIN,true); 

 

    // create the photo overlay by fetching it out of a KML file
    var href = 'http://www.microformats.dk/kort/diverse' + '/';
    href += 'geohoax.kml';
    
   
 google.earth.fetchKml(ge, href, function(kmlObject) {
      if (!kmlObject) {
        // wrap alerts in API callbacks and event handlers
        // in a setTimeout to prevent deadlock in some browsers
        setTimeout(function() {
          alert('Bad or null KML.');
        }, 0);
        return;
      }
    
      // Show the entire KML file in the plugin.
      ge.getFeatures().appendChild(kmlObject);
    
      // Walk the DOM looking for a KmlPhotoOverlay
      walkKmlDom(kmlObject, function() {
        if (this.getType() == 'KmlPhotoOverlay') {
          photoOverlay = this;
          return false; // stop the DOM walk here.
        }
      });
    });
    
    document.getElementById('installed-plugin-version').innerHTML =
      ge.getPluginVersion().toString();
  }
  
  function failureCB(errorCode) {
  }
  
  function enterPhotoOverlay() {
    if (!photoOverlay) {
      alert('No photo overlay found!');
      return;
    }
  
    ge.getPhotoOverlayViewer().setPhotoOverlay(photoOverlay);
  }
  
  function exitPhotoOverlay() {
    // just like setBalloon(null)
    ge.getPhotoOverlayViewer().setPhotoOverlay(null);
  }

  
 
  </script>



 
</head>
<body onload='init()' onunload="GUnload()">




<input type="button" onclick="enterPhotoOverlay()" value="Træd ind i 3D panorama"/>
      <input type="button" onclick="exitPhotoOverlay()" value="Forlad 3D panorama"/>

 <div id="map3d_container" style='border: 1px solid black; height: 600px; width:100%px;'>
<div id='map3d' style='height: 100%;'></div>
</div>


  
</div>



 
]]></Content> 
</Module>
