@@ -411,7 +411,7 @@ const defaultOptions: Readonly<Partial<MapOptions>> = {
411411 maxTileCacheZoomLevels : config . MAX_TILE_CACHE_ZOOM_LEVELS ,
412412 transformRequest : null ,
413413 transformCameraUpdate : null ,
414- fadeDuration : 300 ,
414+ fadeDuration : 0 ,
415415 crossSourceCollisions : true ,
416416 clickTolerance : 3 ,
417417 localIdeographFontFamily : 'sans-serif' ,
@@ -661,8 +661,17 @@ export class Map extends Camera {
661661 this . _setupContainer ( ) ;
662662 this . _setupPainter ( ) ;
663663
664- this . on ( 'move' , ( ) => this . _update ( false ) )
665- . on ( 'moveend' , ( ) => this . _update ( false ) )
664+ this . on ( 'moveend' , ( ) => {
665+ if ( ! this . style || ! this . style . sourceCaches || ! this . transform ) {
666+ return ;
667+ }
668+ for ( const id in this . style . sourceCaches ) {
669+ this . style . sourceCaches [ id ] . update ( this . transform , this . terrain ) ;
670+ }
671+ if ( this . areTilesLoaded ( ) ) {
672+ this . _update ( false ) ;
673+ }
674+ } )
666675 . on ( 'zoom' , ( ) => this . _update ( true ) )
667676 . on ( 'terrain' , ( ) => {
668677 this . painter . terrainFacilitator . dirty = true ;
@@ -729,6 +738,9 @@ export class Map extends Camera {
729738 }
730739 } ) ;
731740 this . on ( 'data' , ( event : MapDataEvent ) => {
741+ if ( ! this . areTilesLoaded ( ) ) {
742+ return ;
743+ }
732744 this . _update ( event . dataType === 'style' ) ;
733745 this . fire ( new Event ( `${ event . dataType } data` , event ) ) ;
734746 } ) ;
@@ -3204,6 +3216,11 @@ export class Map extends Camera {
32043216
32053217 this . _placementDirty = this . style && this . style . _updatePlacement ( this . transform , this . showCollisionBoxes , fadeDuration , this . _crossSourceCollisions , transformUpdateResult . forcePlacementUpdate ) ;
32063218
3219+ if ( this . _placementDirty ) {
3220+ this . triggerRepaint ( ) ;
3221+ return this ;
3222+ }
3223+
32073224 if ( transformUpdateResult . fireProjectionEvent ) {
32083225 this . fire ( new Event ( 'projectiontransition' , transformUpdateResult . fireProjectionEvent ) ) ;
32093226 }
0 commit comments