diff --git a/dist/vue-mapbox.common.js b/dist/vue-mapbox.common.js index 6406d9a1..37728008 100644 --- a/dist/vue-mapbox.common.js +++ b/dist/vue-mapbox.common.js @@ -3823,8 +3823,8 @@ module.exports = /******/ (function(modules) { Marker_component.options.__file = "Marker.vue"; /* harmony default export */ var Marker = Marker_component.exports; - // 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/UI/Popup.vue?vue&type=template&id=6abc114a& - var Popupvue_type_template_id_6abc114a_render = function() { + // 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/UI/Popup.vue?vue&type=template&id=6e79a273& + var Popupvue_type_template_id_6e79a273_render = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; @@ -3835,9 +3835,9 @@ module.exports = /******/ (function(modules) { 2 ); }; - var Popupvue_type_template_id_6abc114a_staticRenderFns = []; + var Popupvue_type_template_id_6e79a273_staticRenderFns = []; - // CONCATENATED MODULE: ./src/components/UI/Popup.vue?vue&type=template&id=6abc114a& + // CONCATENATED MODULE: ./src/components/UI/Popup.vue?vue&type=template&id=6e79a273& // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/UI/Popup.vue?vue&type=script&lang=js& @@ -3970,6 +3970,21 @@ module.exports = /******/ (function(modules) { } } }, + watch: { + coordinates: function coordinates(lngLat) { + if (this.initial) return; + this.popup.setLngLat(lngLat); + }, + showed: function showed(next, prev) { + if (next !== prev) { + this.open = next; + + if (this.marker) { + this.marker.togglePopup(); + } + } + } + }, created: function created() { this.popup = new this.mapbox.Popup(this.$props); }, @@ -3983,12 +3998,6 @@ module.exports = /******/ (function(modules) { this.$_emitEvent("removed"); } }, - watch: { - coordinates: function coordinates(lngLat) { - if (this.initial) return; - this.popup.setLngLat(lngLat); - } - }, methods: { $_addPopup: function $_addPopup() { this.popup = new this.mapbox.Popup(this.$props); @@ -4049,8 +4058,8 @@ module.exports = /******/ (function(modules) { var Popup_component = normalizeComponent( UI_Popupvue_type_script_lang_js_, - Popupvue_type_template_id_6abc114a_render, - Popupvue_type_template_id_6abc114a_staticRenderFns, + Popupvue_type_template_id_6e79a273_render, + Popupvue_type_template_id_6e79a273_staticRenderFns, false, null, null, diff --git a/dist/vue-mapbox.umd.js b/dist/vue-mapbox.umd.js index c7c77b59..3b577d9b 100644 --- a/dist/vue-mapbox.umd.js +++ b/dist/vue-mapbox.umd.js @@ -3871,8 +3871,8 @@ Marker_component.options.__file = "Marker.vue"; /* harmony default export */ var Marker = Marker_component.exports; - // 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/UI/Popup.vue?vue&type=template&id=6abc114a& - var Popupvue_type_template_id_6abc114a_render = function() { + // 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/UI/Popup.vue?vue&type=template&id=6e79a273& + var Popupvue_type_template_id_6e79a273_render = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; @@ -3883,9 +3883,9 @@ 2 ); }; - var Popupvue_type_template_id_6abc114a_staticRenderFns = []; + var Popupvue_type_template_id_6e79a273_staticRenderFns = []; - // CONCATENATED MODULE: ./src/components/UI/Popup.vue?vue&type=template&id=6abc114a& + // CONCATENATED MODULE: ./src/components/UI/Popup.vue?vue&type=template&id=6e79a273& // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/UI/Popup.vue?vue&type=script&lang=js& @@ -4020,6 +4020,21 @@ } } }, + watch: { + coordinates: function coordinates(lngLat) { + if (this.initial) return; + this.popup.setLngLat(lngLat); + }, + showed: function showed(next, prev) { + if (next !== prev) { + this.open = next; + + if (this.marker) { + this.marker.togglePopup(); + } + } + } + }, created: function created() { this.popup = new this.mapbox.Popup(this.$props); }, @@ -4033,12 +4048,6 @@ this.$_emitEvent("removed"); } }, - watch: { - coordinates: function coordinates(lngLat) { - if (this.initial) return; - this.popup.setLngLat(lngLat); - } - }, methods: { $_addPopup: function $_addPopup() { this.popup = new this.mapbox.Popup(this.$props); @@ -4099,8 +4108,8 @@ var Popup_component = normalizeComponent( UI_Popupvue_type_script_lang_js_, - Popupvue_type_template_id_6abc114a_render, - Popupvue_type_template_id_6abc114a_staticRenderFns, + Popupvue_type_template_id_6e79a273_render, + Popupvue_type_template_id_6e79a273_staticRenderFns, false, null, null, diff --git a/dist/vue-mapbox.umd.min.js b/dist/vue-mapbox.umd.min.js index 87822b56..f7def2e3 100644 --- a/dist/vue-mapbox.umd.min.js +++ b/dist/vue-mapbox.umd.min.js @@ -747,11 +747,11 @@ ); } catch (r) {} })(), - T = function(t) { + P = function(t) { var e; return !(!d(t) || "function" != typeof (e = t.then)) && e; }, - P = function(t, e) { + T = function(t, e) { if (!t._n) { t._n = !0; var n = t._c; @@ -777,7 +777,7 @@ f && (f.exit(), (a = !0))), n === e.promise ? u(I("Promise-chain cycle")) - : (i = T(n)) + : (i = P(n)) ? i.call(n, c, u) : c(n)) : u(r); @@ -834,7 +834,7 @@ (e._v = t), (e._s = 2), e._a || (e._a = e._c.slice()), - P(e, !0)); + T(e, !0)); }, N = function(t) { var e, @@ -843,7 +843,7 @@ (n._d = !0), (n = n._w || n); try { if (n === t) throw I("Promise can't be resolved itself"); - (e = T(t)) + (e = P(t)) ? g(function() { var r = { _w: n, _d: !1 }; try { @@ -852,7 +852,7 @@ R.call(r, o); } }) - : ((n._v = t), (n._s = 1), P(n, !1)); + : ((n._v = t), (n._s = 1), T(n, !1)); } catch (r) { R.call({ _w: n, _d: !1 }, r); } @@ -885,7 +885,7 @@ (n.domain = M ? w.domain : void 0), this._c.push(n), this._a && this._a.push(n), - this._s && P(this, !1), + this._s && T(this, !1), n.promise ); }, @@ -2349,7 +2349,7 @@ this.$_addControl(); } }, - T = { + P = { name: "ScaleControl", mixins: [L], props: { @@ -2372,7 +2372,7 @@ this.$_addControl(); } }, - P = function() { + T = function() { var t = this, e = t.$createElement, n = t._self._c || e; @@ -2461,7 +2461,7 @@ } }, R = A, - N = $(R, P, B, !1, null, null, null); + N = $(R, T, B, !1, null, null, null); N.options.__file = "Marker.vue"; var z = N.exports, U = function() { @@ -2529,6 +2529,15 @@ } } }, + watch: { + coordinates: function(t) { + this.initial || this.popup.setLngLat(t); + }, + showed: function(t, e) { + t !== e && + ((this.open = t), this.marker && this.marker.togglePopup()); + } + }, created: function() { this.popup = new this.mapbox.Popup(this.$props); }, @@ -2538,11 +2547,6 @@ beforeDestroy: function() { this.map && (this.popup.remove(), this.$_emitEvent("removed")); }, - watch: { - coordinates: function(t) { - this.initial || this.popup.setLngLat(t); - } - }, methods: { $_addPopup: function() { if ( @@ -3197,7 +3201,7 @@ dt = j, pt = k, ht = C, - mt = T, + mt = P, vt = Q, yt = tt, gt = et, diff --git a/package-lock.json b/package-lock.json index 4083af28..fe2475f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vue-mapbox", - "version": "0.3.0", + "version": "0.3.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f9390911..c46ba2ad 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-mapbox", - "version": "0.3.0", + "version": "0.3.1", "author": { "name": "soal", "email": "sorrrow.about.alice@gmail.com", diff --git a/src/components/UI/Popup.vue b/src/components/UI/Popup.vue index e9ddb739..7655f507 100644 --- a/src/components/UI/Popup.vue +++ b/src/components/UI/Popup.vue @@ -130,6 +130,22 @@ export default { } }, + watch: { + coordinates(lngLat) { + if (this.initial) return; + this.popup.setLngLat(lngLat); + }, + + showed(next, prev) { + if (next !== prev) { + this.open = next; + if (this.marker) { + this.marker.togglePopup(); + } + } + } + }, + created() { this.popup = new this.mapbox.Popup(this.$props); }, @@ -146,13 +162,6 @@ export default { } }, - watch: { - coordinates(lngLat) { - if (this.initial) return; - this.popup.setLngLat(lngLat); - } - }, - methods: { $_addPopup() { this.popup = new this.mapbox.Popup(this.$props);