/*
MAPSTRACTION   v2.0.17   http://www.mapstraction.com

Copyright (c) 2011 Tom Carden, Steve Coast, Mikel Maron, Andrew Turner, Henri Bergius, Rob Moran, Derek Fowler, Gary Gale
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
 * Neither the name of the Mapstraction nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
mxn.register("googleearth",{Mapstraction:{init:function(b,c){var d=this;this.maps[c]=null;google.earth.createInstance(b,function a(f){d.maps[c]=f;d.maps[c].getWindow().setVisibility(true);initMap()},function e(f){throw"Failed to create Google Earth map"})},applyOptions:function(){var a=this.maps[this.api]},resizeTo:function(b,a){},addControls:function(a){var b=this.maps[this.api]},addSmallControls:function(){var a=this.maps[this.api]},addLargeControls:function(){var a=this.maps[this.api]},addMapTypeControls:function(){var a=this.maps[this.api]},dragging:function(a){var b=this.maps[this.api]},setCenterAndZoom:function(a,b){var d=this.maps[this.api];var c=a.toProprietary(this.api);var e=d.getView().copyAsLookAt(d.ALTITUDE_RELATIVE_TO_GROUND);e.setLatitude(a.lat);e.setLongitude(a.lon);e.setRange(e.getRange()/7);d.getView().setAbstractView(e)},addMarker:function(b,a){var d=this.maps[this.api];var c=b.toProprietary(this.api);return c},removeMarker:function(a){var b=this.maps[this.api]},removeAllMarkers:function(){var a=this.maps[this.api]},declutterMarkers:function(a){var b=this.maps[this.api]},addPolyline:function(b,a){var d=this.maps[this.api];var c=b.toProprietary(this.api);return c},removePolyline:function(a){var b=this.maps[this.api]},getCenter:function(){var a;var b=this.maps[this.api];var c=b.getView().copyAsLookAt(b.ALTITUDE_RELATIVE_TO_GROUND);a=new mxn.LatLonPoint(c.getLatitude(),c.getLongitude());return a},setCenter:function(a,b){var d=this.maps[this.api];var c=a.toProprietary(this.api);if(b&&b.pan){}else{}},setZoom:function(a){var b=this.maps[this.api]},getZoom:function(){var b=this.maps[this.api];var a=5;return a},getZoomLevelForBoundingBox:function(e){var d=this.maps[this.api];var c=e.getNorthEast();var a=e.getSouthWest();var b;return b},setMapType:function(a){var b=this.maps[this.api];switch(a){case mxn.Mapstraction.ROAD:break;case mxn.Mapstraction.SATELLITE:break;case mxn.Mapstraction.HYBRID:break;default:}},getMapType:function(){var a=this.maps[this.api]},getBounds:function(){var a=this.maps[this.api]},setBounds:function(b){var d=this.maps[this.api];var a=b.getSouthWest();var c=b.getNorthEast()},addImageOverlay:function(c,a,e,i,f,g,d,h){var b=this.maps[this.api]},setImagePosition:function(e,b){var d=this.maps[this.api];var c;var a},addOverlay:function(a,b){var c=this.maps[this.api]},addTileLayer:function(g,a,c,e,f){var d=this.maps[this.api];var b=this;google.earth.fetchKml(d,g,function(h){if(h){d.getFeatures().appendChild(h);b.tileLayers.push([g,h,true])}else{throw"Invalid KML file"}})},toggleTileLayer:function(c){var b=this.maps[this.api];for(var a=0;a<this.tileLayers.length;a++){if(this.tileLayers[a][0]==c){if(this.tileLayers[a][2]){b.getFeatures().removeChild(this.tileLayers[a][1]);this.tileLayers[a][2]=false}else{b.getFeatures().appendChild(this.tileLayers[a][1]);this.tileLayers[a][2]=true}}}},getPixelRatio:function(){var a=this.maps[this.api]},mousePosition:function(a){var b=this.maps[this.api]}},LatLonPoint:{toProprietary:function(){},fromProprietary:function(a){}},Marker:{toProprietary:function(){},openBubble:function(){},hide:function(){},show:function(){},update:function(){}},Polyline:{toProprietary:function(){},show:function(){},hide:function(){}}});