r95623 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95622‎ | r95623 | r95624 >
Date:14:15, 28 August 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
some google earth related fixes
Modified paths:
  • /trunk/extensions/Maps/includes/services/GoogleMaps3/jquery.googlemap.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/includes/services/GoogleMaps3/jquery.googlemap.js
@@ -231,7 +231,9 @@
232232 if ( google.earth.isSupported() ) {
233233 var ge = new GoogleEarth( map );
234234 var setTilt = function() {
 235+
235236 if ( ge.getInstance() !== undefined ) {
 237+
236238 var center = map.getCenter();
237239 var lookAt = ge.instance_.createLookAt('');
238240 var range = Math.pow(2, GoogleEarth.MAX_EARTH_ZOOM_ - map.getZoom());
@@ -254,14 +256,20 @@
255257 window.setTimeout(function() {
256258 ge.instance_.getOptions().setFlyToSpeed(1);
257259 }, 250);
 260+
258261 }
259262 else {
260 - setTimeout( this, 100 );
 263+ setTimeout( function() { setTilt(); }, 100 );
261264 }
262265 };
263266
264 - map.setMapTypeId( GoogleEarth.MAP_TYPE_ID );
265 - setTilt();
 267+ if ( options.type == 'earth' ) {
 268+ map.setMapTypeId( GoogleEarth.MAP_TYPE_ID );
 269+ setTilt();
 270+ }
 271+ else {
 272+ google.maps.event.addListenerOnce( map, 'maptypeid_changed', function() { setTilt(); } );
 273+ }
266274 }
267275
268276 _this.addOverlays();