Exportländer

  • Argentinien
  • Australien
  • Belgien
  • Dominikanische Rep.
  • Finnland
  • Frankreich
  • Griechenland
  • Israel
  • Italien
  • Kanada
  • Mexiko
  • Neuseeland
  • Niederlande
  • Norwegen
  • Österreich
  • Polen
  • Portugal
  • Rumänien
  • Schweden
  • Schweiz
  • Spanien
  • Südkorea
  • Tschechien
  • Türkei
  • Ungarn
  • USA
  • Ver. Arabische Emirate
  • Vereinigtes Königreich
  • Zypern
var sunAngle = 30;

window.addEventListener( "earthjsload", function() {

	myearth = new Earth( document.getElementById('myearth'), {
		location: { lat: 21, lng: 30 },
		
		sunLocation: { lat: 0, lng: 360 - sunAngle },
		zoom: 1,
		
		light: 'sun',
		sunDirection : { x: 0, y: 0.25 },
		lightColor: '#FFFCE8' ,
		shadows: false,
		lightAmbience: 0.6,
		shininess: 0.1,
		
		autoRotate: true,
		autoRotateSpeed: 0.4,
		transparent: true,		
		mapLandColor:  '#5b646b',
		mapSeaColor: 'rgba(45,170,255,0.9)',
		mapBorderColor: 'rgba(230,230,230,0.9)',
		mapBorderWidth: 0.2,
		mapStyles: '#ES, #PT, #FR, #IT, #TR, #NL, #BE, #PL, #CZ, #AT, #CH, #HU, #RO, #GR, #CY, #IL, #AE, #KR, #AU, #MX, #US, #CA, #DO, #GB, #NO, #SE, #FI, #AR, #NZ { fill: rgba(29,37,45,0.8); } #DE { fill: rgba(29,37,45,1); }',
	} );
	
	
	// setup
	
	myearth.addEventListener( "ready", function() {
	
		// add tooltip overlay
		
		tooltip = this.addOverlay( {
			className : 'tooltip',
			visible : false,
			containerScale : 0.2,
			depthScale : 0.4
		} );
		
		photo_overlay = this.addOverlay( {
			content: '<div id="photo"><div id="close-photo" onclick="closePhoto(); event.stopPropagation();"></div></div>',
			visible: false,
			containerScale: 1,
			depthScale: 0.5
		} );
		
		
		// add markers
		for ( var i=0; i < markers.length; i++ ) {

				var marker = myearth.addMarker( {
					mesh: ["Pin", "Needle"],
					color: '#FFA300',
					location : markers[i].location,
					scale: 0.4,
					hotspot: true,
					hotspotRadius : 0.75,
					hotspotHeight : 0.2,
					
					// custom properties
					title : markers[i].title,
					link : markers[i].link
					
				} );

				marker.addEventListener('mouseover', enterMarker);	
				marker.addEventListener('mouseout',  leaveMarker);						
		}

		var photos = [
			{ location: { lat: 51.07079729, lng: 10.97979517 }, src: 'https://enfold.webers-webdesign.de/wp-content/uploads/schmale-logtec-firmengebaeude-warburg.jpg' },
		];

		// add photo pins
		for ( var j=0; j < photos.length; j++ ) {
		
			var myMarker = this.addMarker( {
			
				mesh: ["Pin", "Needle"],
				color: '#FFA300',
				title: 'Deutschland',
				location : photos[j].location,
				scale: 0.01,
				offset: 1.6,
				visible: false,
				transparent: true,
				hotspot: true,
				hotspotRadius : 0.75,
				hotspotHeight : 0.9,						
				
				// custom property
				photo_info: photos[j]
				
			} );
			
			myMarker.addEventListener('click', openPhoto);
			myMarker.addEventListener('mouseover', enterMarker);	
			myMarker.addEventListener('mouseout',  leaveMarker);	
			
			// animate marker
			setTimeout( (function() {
				this.visible = true;
				this.animate( 'scale', 0.7, { duration: 140 } );
				this.animate( 'offset', 0, { duration: 1100, easing: 'bounce' } );
			}).bind(myMarker), 280 * j );
			
		}	
	});


	// close photo overlay when navigating away
	myearth.addEventListener( "change", function() {	
		if ( ! current_marker || auto_rotate ) return;
		if ( Earth.getAngle( myearth.location, current_marker.location ) > 45 ) {
			closePhoto();
		}
	} );

});


function enterMarker() {
	tooltip.location = this.location;
	tooltip.content = this.title;
	tooltip.element.style.marginTop = '-' + String(this.scale*0.5 + 0.75) + 'em';
	tooltip.visible = true;
}

function leaveMarker() {
	tooltip.visible = false;
}

var current_marker, auto_rotate;


function openPhoto() {

	// close current photo
	if ( current_marker ) {
		
		closePhoto();
		window.setTimeout( openPhoto.bind(this), 120 );
		
		return;
	}
	
	// rotate earth if needed
	if ( myearth.goTo( this.location, { relativeDuration: 100, approachAngle: 12, end: function(){auto_rotate=false;} } ) ) {
		auto_rotate = true;
	}
	
	document.getElementById('photo').style.backgroundImage = "url("+ this.photo_info.src +")";
	
	photo_overlay.location = this.location;
	photo_overlay.visible = true;
	
	setTimeout( function(){
		document.getElementById('photo').className = 'photo-appear';
	}, 120);
	
	this.animate( 'scale', 0.001, { duration: 150 } );
	current_marker = this;
	
}

function closePhoto() {
	if ( ! current_marker ) return;
	document.getElementById('photo').className = '';
	
	setTimeout( (function(){
		document.getElementById('photo').style.backgroundImage = 'none';
		photo_overlay.visible = false;
		this.opacity = 0.9;
		this.animate( 'scale', 0.7, { duration: 150 } );
	}).bind(current_marker), 100 );
	current_marker = false;
}
markers = [
	{
		title: 'Frankreich',
	    location: {
	        lat: 46.493889,
	        lng: 2.602778
	    }
	},
	{
		title: 'Vereinigtes Königreich',
	    location: {
	        lat: 52.625210,
	        lng: -1.423190
	    }
	},
	{
		title: 'USA',
	    location: {
	        lat: 39.810556,
	        lng: -98.556111
	    },
		hotspot: true
	},
	{
		title: 'Kanada',
	    location: {
	        lat: 58.5249683,
	        lng: -104.647884
	    }
	},
	{
	    title: 'Spanien',
	    location: {
	        lat: 40.43208831726528,
	        lng: -3.6898478082840724
	    }
	},
	{
	    title: 'Portugal',
	    location: {
	        lat: 39.36786000461932,
	        lng: -8.239752021818955
	    }
	},
	{
	    title: 'Belgien',
	    location: {
	        lat: 50.81474889917562,
	        lng: 4.3421794345724125
	    }
	},
	{
	    title: 'Niederlande',
	    location: {
	        lat: 52.03024505924047,
	        lng: 5.4985870215317
	    }
	},
	{
	    title: 'Polen',
	    location: {
	        lat: 52.03460637767226,
	        lng: 19.520314861297916
	    }
	},
	{
	    title: 'Australien',
	    location: {
	        lat: -25.15128632494953,
	        lng: 133.12064260097242
	    }
	},
	{
	    title: 'Dom. Republik',
	    location: {
	        lat: 18.874508916172207,
	        lng: -70.37797321977125
	    }
	},
	{
	    title: 'Finnland',
	    location: {
	        lat: 63.07341643853194,
	        lng: 26.64475624474629
	    }
	},
	{
	    title: 'Schweden',
	    location: {
	        lat: 64.49229479374382,
	        lng: 17.007162646072366
	    }
	},
	{
	    title: 'Norwegen',
	    location: {
	        lat: 61.84731516866261,
	        lng: 9.151686224034336
	    }
	},
	{
	    title: 'Griechenland',
	    location: {
	        lat: 39.454904056721745,
	        lng: 22.263003849923305
	    }
	},
	{
	    title: 'Zypern',
	    location: {
	        lat: 35.03527539453545,
	        lng: 33.194828427154484
	    }
	},
	{
	    title: 'Israel',
	    location: {
	        lat: 30.986259825548206,
	        lng: 34.86002490213336
	    }
	},
	{
	    title: 'Italien',
	    location: {
	        lat: 42.99101648982305,
	        lng: 12.373515881607476
	    }
	},
	{
	    title: 'Türkei',
	    location: {
	        lat: 38.88196815608004,
	        lng: 35.20341185096104
	    }
	},
	{
	    title: 'Mexiko',
	    location: {
	        lat: 23.82270614659003,
	        lng: -102.52731263529388
	    }
	},
	{
	    title: 'Österreich',
	    location: {
	        lat: 47.54706983253276,
	        lng: 14.76429593336605
	    }
	},
	{
	    title: 'Rumänien',
	    location: {
	        lat: 45.78024677301113,
	        lng: 25.076015027305882
	    }
	},
	{
	    title: 'Schweiz',
	    location: {
	        lat: 46.76694017021209,
	        lng: 8.10723956300506
	    }
	},
	{
	    title: 'Süd Korea',
	    location: {
	        lat: 36.532060059724806,
	        lng: 127.92577894465849
	    }
	},
	{
	    title: 'Tschechien',
	    location: {
	        lat: 49.610128189091114,
	        lng: 15.155234801119775
	    }
	},
	{
	    title: 'Ungarn',
	    location: {
	        lat: 47.01608934187564,
	        lng: 19.420581609981948
	    }
	},
	{
	    title: 'Vereinigte Arab. Emirate',
	    location: {
	        lat: 23.559115038672715,
	        lng: 54.19182540615663
	    }
	},
];