Index: trunk/extensions/Maps/includes/services/GoogleMaps3/jquery.googlemap.js |
— | — | @@ -231,7 +231,9 @@ |
232 | 232 | if ( google.earth.isSupported() ) { |
233 | 233 | var ge = new GoogleEarth( map ); |
234 | 234 | var setTilt = function() { |
| 235 | + |
235 | 236 | if ( ge.getInstance() !== undefined ) { |
| 237 | + |
236 | 238 | var center = map.getCenter(); |
237 | 239 | var lookAt = ge.instance_.createLookAt(''); |
238 | 240 | var range = Math.pow(2, GoogleEarth.MAX_EARTH_ZOOM_ - map.getZoom()); |
— | — | @@ -254,14 +256,20 @@ |
255 | 257 | window.setTimeout(function() { |
256 | 258 | ge.instance_.getOptions().setFlyToSpeed(1); |
257 | 259 | }, 250); |
| 260 | + |
258 | 261 | } |
259 | 262 | else { |
260 | | - setTimeout( this, 100 ); |
| 263 | + setTimeout( function() { setTilt(); }, 100 ); |
261 | 264 | } |
262 | 265 | }; |
263 | 266 | |
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 | + } |
266 | 274 | } |
267 | 275 | |
268 | 276 | _this.addOverlays(); |