@@ -2530,7 +2530,7 @@ module.exports = /******/ (function(modules) {
25302530 // Indicate to webpack that this file can be concatenated
25312531 /* harmony default export */ var setPublicPath = null ;
25322532
2533- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"47f5d000-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/map/GlMap.vue?vue&type=template&id=177ac976 &
2533+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"47f5d000-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/map/GlMap.vue?vue&type=template&id=a6b1c212 &
25342534 var render = function ( ) {
25352535 var _vm = this ;
25362536 var _h = _vm . $createElement ;
@@ -2551,7 +2551,7 @@ module.exports = /******/ (function(modules) {
25512551 }
25522552 ] ;
25532553
2554- // CONCATENATED MODULE: ./src/components/map/GlMap.vue?vue&type=template&id=177ac976 &
2554+ // CONCATENATED MODULE: ./src/components/map/GlMap.vue?vue&type=template&id=a6b1c212 &
25552555
25562556 // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom.iterable.js
25572557 var web_dom_iterable = __webpack_require__ ( "ac6a" ) ;
@@ -3320,7 +3320,11 @@ module.exports = /******/ (function(modules) {
33203320 } ) ;
33213321 } ,
33223322 beforeDestroy : function beforeDestroy ( ) {
3323- if ( this . map ) this . map . remove ( ) ;
3323+ var _this2 = this ;
3324+
3325+ this . $nextTick ( function ( ) {
3326+ if ( _this2 . map ) _this2 . map . remove ( ) ;
3327+ } ) ;
33243328 }
33253329 } ;
33263330 // CONCATENATED MODULE: ./src/components/map/GlMap.vue?vue&type=script&lang=js&
@@ -3482,6 +3486,7 @@ module.exports = /******/ (function(modules) {
34823486 var _this2 = this ;
34833487
34843488 if ( events . length === 0 ) return ;
3489+ if ( ! emitter ) return ;
34853490 events . forEach ( function ( eventName ) {
34863491 emitter . off ( eventName , _this2 . $_emitSelfEvent ) ;
34873492 } ) ;
@@ -3501,7 +3506,7 @@ module.exports = /******/ (function(modules) {
35013506 }
35023507 } ,
35033508 beforeDestroy : function beforeDestroy ( ) {
3504- if ( this . map ) {
3509+ if ( this . map && this . control ) {
35053510 this . map . removeControl ( this . control ) ;
35063511 }
35073512 } ,
@@ -4233,7 +4238,7 @@ module.exports = /******/ (function(modules) {
42334238 }
42344239 } ,
42354240 beforeDestroy : function beforeDestroy ( ) {
4236- if ( this . map ) {
4241+ if ( this . map && this . map . loaded ( ) ) {
42374242 try {
42384243 this . map . removeLayer ( this . layerId ) ;
42394244 } catch ( err ) {
@@ -4277,13 +4282,15 @@ module.exports = /******/ (function(modules) {
42774282 $_unbindEvents : function $_unbindEvents ( events ) {
42784283 var _this2 = this ;
42794284
4280- events . forEach ( function ( eventName ) {
4281- _this2 . map . off (
4282- eventName ,
4283- _this2 . layerId ,
4284- _this2 . $_emitLayerMapEvent
4285- ) ;
4286- } ) ;
4285+ if ( this . map ) {
4286+ events . forEach ( function ( eventName ) {
4287+ _this2 . map . off (
4288+ eventName ,
4289+ _this2 . layerId ,
4290+ _this2 . $_emitLayerMapEvent
4291+ ) ;
4292+ } ) ;
4293+ }
42874294 } ,
42884295 $_watchSourceLoading : function $_watchSourceLoading ( data ) {
42894296 if ( data . dataType === "source" && data . sourceId === this . sourceId ) {
@@ -4485,7 +4492,7 @@ module.exports = /******/ (function(modules) {
44854492 this . $_addLayer ( ) ;
44864493 this . $_bindLayerEvents ( layerEvents ) ;
44874494 this . map . off ( "dataloading" , this . $_watchSourceLoading ) ;
4488- this . initial = false ; // payload.component.$off("load", this.$_deferredMount);
4495+ this . initial = false ;
44894496 } ,
44904497 $_addLayer : function $_addLayer ( ) {
44914498 var existed = this . map . getLayer ( this . layerId ) ;
0 commit comments