﻿<?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="CO2 forbrug tog kontra bil fra Kbh. H til Aalborg St." directory_title="Dansk Earth Wave" author="Søren Johannessen" author_email="soren.johannessen+danskearthwavegadget@gmail.com" author_affiliation="Private" width="850" height="750"> 
    <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 type="text/javascript">
  
  var ge;
  var tour = null;
   var fileOne = null;
  
  google.load("earth", "1");

  function init() {
    google.earth.createInstance('map3d', initCB, failureCB);
  }
  
  function initCB(instance) {
    ge = instance;
    ge.getWindow().setVisibility(true);

fileOne = getNL('http://www.microformats.dk/kort/co2togtur/co2imagege5.kmz');

    
    // add a navigation control
    ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);

var la = ge.createLookAt('');
  la.set( 55.672301, 12.566810, 13, ge.ALTITUDE_RELATIVE_TO_GROUND, 
         106, 43, 1120);
  ge.getView().setAbstractView(la); 
    
    // create the tour by fetching it out of a KML file
    var href = 'http://www.microformats.dk/kort/co2togtur/co2turge5.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;
      }
    
      tour = kmlObject;
      ge.getFeatures().appendChild(tour);
    });

function getNL(kmlURL){
  var nl = ge.createNetworkLink("");
  var link = ge.createLink("");
  link.setHref(kmlURL);
  nl.setLink(link);
  ge.getGlobe().getFeatures().appendChild(nl);
  return nl;
}

ge.getOptions().setStatusBarVisibility(true);
ge.getLayerRoot().enableLayerById(ge.LAYER_TERRAIN,true);
      

function updateOptions() {
  fileOne.setVisibility(document.options.file1.checked);
 
}
    
    document.getElementById('installed-plugin-version').innerHTML =
      ge.getPluginVersion().toString();
  }
  
  function failureCB(errorCode) {
  }
  
  function enterTour() {
    ge.getTourPlayer().setTour(tour);
  }
  
  function playTour() {
    ge.getTourPlayer().play();
  }
  
  function pauseTour() {
    ge.getTourPlayer().pause();
  }
  
  function resetTour() {
    ge.getTourPlayer().reset();
  }
  
  function exitTour() {
    // just like setBalloon(null)
    ge.getTourPlayer().setTour(null);
  }
  

  </script>
</head>
<body onload='init()' onunload="GUnload()">




<p><input type="button" onclick="enterTour()" value="Indlæs tur"/>
  <input type="button" onclick="playTour()" value="Start tur"/>
  <input type="button" onclick="pauseTour()" value="Pause"/>

  <input type="button" onclick="resetTour()" value="Stop"/>
  <input type="button" onclick="exitTour()" value="Forlad tur"/></p>
 <div id="map3d_container" style='border: 1px solid black; height: 650px; width:750px;'>
<div id='map3d' style='height: 100%;'></div>
</div>


  

<div style="display:none" id='options_container'>
    <form name="options" action='javascript:updateOptions();'>
      <input type="checkbox" onclick='updateOptions()' name="file1" checked />Fil 1
      <br />

      
    </form>
  </div>
</div>


 
]]></Content> 
</Module>
