diff --git a/src/ui/map.js b/src/ui/map.js index 5145c48befe..ee4af8426d3 100755 --- a/src/ui/map.js +++ b/src/ui/map.js @@ -8,13 +8,13 @@ import {getImage, getJSON, ResourceType} from '../util/ajax.js'; import { RequestManager, mapSessionAPI, + mapLoadEvent, getMapSessionAPI, postPerformanceEvent, postMapLoadEvent, AUTH_ERR_MSG, storeAuthState, - removeAuthState, - mapLoadEvent_ + removeAuthState } from '../util/mapbox.js'; import Style from '../style/style.js'; import EvaluationParameters from '../style/evaluation_parameters.js'; @@ -3901,6 +3901,7 @@ class Map extends Camera { } } }); + postMapLoadEvent(this._getMapId(), this._requestManager._skuToken, this._requestManager._customAccessToken, () => {}); } @@ -4024,7 +4025,7 @@ class Map extends Camera { removeAuthState(this.painter.context.gl); mapSessionAPI.remove(); - mapLoadEvent_.remove(); + mapLoadEvent.remove(); this._removed = true; this.fire(new Event('remove')); diff --git a/src/util/mapbox.js b/src/util/mapbox.js index 08f32eb9528..6d388dd6471 100644 --- a/src/util/mapbox.js +++ b/src/util/mapbox.js @@ -662,9 +662,9 @@ const turnstileEvent_ = new TurnstileEvent(); // $FlowFixMe[method-unbinding] export const postTurnstileEvent: (tileUrls: Array, customAccessToken?: ?string) => void = turnstileEvent_.postTurnstileEvent.bind(turnstileEvent_); -export const mapLoadEvent_ = new MapLoadEvent(); +export const mapLoadEvent = new MapLoadEvent(); // $FlowFixMe[method-unbinding] -export const postMapLoadEvent: (number, string, ?string, EventCallback) => void = mapLoadEvent_.postMapLoadEvent.bind(mapLoadEvent_); +export const postMapLoadEvent: (number, string, ?string, EventCallback) => void = mapLoadEvent.postMapLoadEvent.bind(mapLoadEvent); export const performanceEvent_: PerformanceEvent = new PerformanceEvent(); // $FlowFixMe[method-unbinding]