baidu-map-track-render-vue
Advanced tools
Comparing version 1.0.0 to 1.0.1
/*! | ||
* baidu-map-track-render-vue v1.0.0 | ||
* phphe <phphe@outlook.com> (https://github.com/phphe) | ||
* https://github.com/phphe/baidu-map-vue.git | ||
* https://github.com/phphe/baidu-map-track-render-vue.git | ||
* Released under the MIT License. | ||
@@ -57,3 +57,3 @@ */ | ||
var BaiduMapTrackRender = { render: function render() { | ||
var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "baidu-map baidu-map-vue", attrs: { "id": _vm.id } }); | ||
var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "baidu-map-track-render-vue" }, [_c('div', { staticClass: "baidu-map-track-render-vue__map", attrs: { "id": _vm.id } })]); | ||
}, staticRenderFns: [], | ||
@@ -60,0 +60,0 @@ props: { |
/*! | ||
* baidu-map-track-render-vue v1.0.0 | ||
* phphe <phphe@outlook.com> (https://github.com/phphe) | ||
* https://github.com/phphe/baidu-map-vue.git | ||
* https://github.com/phphe/baidu-map-track-render-vue.git | ||
* Released under the MIT License. | ||
@@ -55,3 +55,3 @@ */ | ||
var BaiduMapTrackRender = { render: function render() { | ||
var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "baidu-map baidu-map-vue", attrs: { "id": _vm.id } }); | ||
var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "baidu-map-track-render-vue" }, [_c('div', { staticClass: "baidu-map-track-render-vue__map", attrs: { "id": _vm.id } })]); | ||
}, staticRenderFns: [], | ||
@@ -58,0 +58,0 @@ props: { |
/*! | ||
* baidu-map-track-render-vue v1.0.0 | ||
* phphe <phphe@outlook.com> (https://github.com/phphe) | ||
* https://github.com/phphe/baidu-map-vue.git | ||
* https://github.com/phphe/baidu-map-track-render-vue.git | ||
* Released under the MIT License. | ||
@@ -61,3 +61,3 @@ */ | ||
var BaiduMapTrackRender = { render: function render() { | ||
var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "baidu-map baidu-map-vue", attrs: { "id": _vm.id } }); | ||
var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "baidu-map-track-render-vue" }, [_c('div', { staticClass: "baidu-map-track-render-vue__map", attrs: { "id": _vm.id } })]); | ||
}, staticRenderFns: [], | ||
@@ -64,0 +64,0 @@ props: { |
/*! | ||
* baidu-map-track-render-vue v1.0.0 | ||
* phphe <phphe@outlook.com> (https://github.com/phphe) | ||
* https://github.com/phphe/baidu-map-vue.git | ||
* https://github.com/phphe/baidu-map-track-render-vue.git | ||
* Released under the MIT License. | ||
*/ | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):t.BaiduMapTrackRender=n()}(this,function(){"use strict";function t(){return new Promise(function(t,n){document&&"complete"===document.readyState?t():window.addEventListener("load",function n(){t(),window.removeEventListener("load",n)})})}function n(t,n){t[n]=void 0;try{delete t[n]}catch(t){}}function e(r){var o=e;return t().then(function(){if(o.loaded)return window.BMap;if(!o.requested){o.requested=!0,window._BaiduMapLoadedCallback=function(){o.loaded=!0,n(window,"_BaiduMapLoadedCallback")};var t=document.createElement("script");return t.src="http://api.map.baidu.com/api?v=2.0&ak="+r+"&callback=_BaiduMapLoadedCallback",document.body.appendChild(t),new Promise(function(t,n){var e=window.setInterval(function(){o.loaded&&(window.clearInterval(e),t(window.BMap))},10)})}})}return{render:function(){var t=this,n=t.$createElement;return(t._self._c||n)("div",{staticClass:"baidu-map baidu-map-vue",attrs:{id:t.id}})},staticRenderFns:[],props:{points:{},ak:{}},data:function(){return{id:"BaiduMap_"+this._uid}},mounted:function(){var t=this;this.$nextTick(function(){e(t.ak).then(function(n){t.points&&t.convertPoints(t.points,n).then(function(e){var r=e.points,o=new n.Map(t.id),a=t.getCenter(r,n);o.centerAndZoom(a,15),o.enableScrollWheelZoom();for(var i=0;i<r.length;i++){var l=r[i-1];if(l){var d=r[i],u=new n.Polyline([l,d],{strokeColor:"blue",strokeWeight:2,strokeOpacity:.5});o.addOverlay(u)}}})})})},methods:{mapReady:function(t){var n=this;this.points&&this.convertPoints(this.points,t).then(function(e){var r=e.points,o=new t.Map("map"),a=n.getCenter(r,t);o.centerAndZoom(a,15),o.enableScrollWheelZoom();for(var i=0;i<r.length;i++){var l=r[i-1];if(l){var d=r[i],u=new t.Polyline([l,d],{strokeColor:"blue",strokeWeight:2,strokeOpacity:.5});o.addOverlay(u)}}})},getCenter:function(t,n){var e=t[0].lng,r=t[0].lat,o=t[0].lng,a=t[0].lat,i=!0,l=!1,d=void 0;try{for(var u,c=t[Symbol.iterator]();!(i=(u=c.next()).done);i=!0){var f=u.value;f.lng<o&&(o=f.lng),f.lng>e&&(e=f.lng),f.lat<a&&(a=f.lat),f.lat>r&&(r=f.lat)}}catch(t){l=!0,d=t}finally{try{!i&&c.return&&c.return()}finally{if(l)throw d}}return new n.Point((e+o)/2,(r+a)/2)},convertPoints:function(t,n){var e=new n.Convertor,r=[],o=!0,a=!1,i=void 0;try{for(var l,d=t[Symbol.iterator]();!(o=(l=d.next()).done);o=!0){var u=l.value;r.push(new n.Point(u[0],u[1]))}}catch(t){a=!0,i=t}finally{try{!o&&d.return&&d.return()}finally{if(a)throw i}}for(var c=[],f=0,s=0;s<t.length;f++,s+=100)!function(t,n){c.push(new Promise(function(n,o){var a=100*t,i=a+100;e.translate(r.slice(a,i),1,5,function(t){n(t)})}))}(f);return Promise.all(c).then(function(t){var n=[],e=!0,r=!1,o=void 0;try{for(var a,i=t[Symbol.iterator]();!(e=(a=i.next()).done);e=!0){var l=a.value,d=!0,u=!1,c=void 0;try{for(var f,s=l.points[Symbol.iterator]();!(d=(f=s.next()).done);d=!0){var v=f.value;n.push(v)}}catch(t){u=!0,c=t}finally{try{!d&&s.return&&s.return()}finally{if(u)throw c}}}}catch(t){r=!0,o=t}finally{try{!e&&i.return&&i.return()}finally{if(r)throw o}}return{points:n,dataArr:t}})}}}}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.BaiduMapTrackRender=e()}(this,function(){"use strict";function t(){return new Promise(function(t,e){document&&"complete"===document.readyState?t():window.addEventListener("load",function e(){t(),window.removeEventListener("load",e)})})}function e(t,e){t[e]=void 0;try{delete t[e]}catch(t){}}function n(r){var o=n;return t().then(function(){if(o.loaded)return window.BMap;if(!o.requested){o.requested=!0,window._BaiduMapLoadedCallback=function(){o.loaded=!0,e(window,"_BaiduMapLoadedCallback")};var t=document.createElement("script");return t.src="http://api.map.baidu.com/api?v=2.0&ak="+r+"&callback=_BaiduMapLoadedCallback",document.body.appendChild(t),new Promise(function(t,e){var n=window.setInterval(function(){o.loaded&&(window.clearInterval(n),t(window.BMap))},10)})}})}return{render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"baidu-map-track-render-vue"},[n("div",{staticClass:"baidu-map-track-render-vue__map",attrs:{id:t.id}})])},staticRenderFns:[],props:{points:{},ak:{}},data:function(){return{id:"BaiduMap_"+this._uid}},mounted:function(){var t=this;this.$nextTick(function(){n(t.ak).then(function(e){t.points&&t.convertPoints(t.points,e).then(function(n){var r=n.points,o=new e.Map(t.id),a=t.getCenter(r,e);o.centerAndZoom(a,15),o.enableScrollWheelZoom();for(var i=0;i<r.length;i++){var l=r[i-1];if(l){var d=r[i],u=new e.Polyline([l,d],{strokeColor:"blue",strokeWeight:2,strokeOpacity:.5});o.addOverlay(u)}}})})})},methods:{mapReady:function(t){var e=this;this.points&&this.convertPoints(this.points,t).then(function(n){var r=n.points,o=new t.Map("map"),a=e.getCenter(r,t);o.centerAndZoom(a,15),o.enableScrollWheelZoom();for(var i=0;i<r.length;i++){var l=r[i-1];if(l){var d=r[i],u=new t.Polyline([l,d],{strokeColor:"blue",strokeWeight:2,strokeOpacity:.5});o.addOverlay(u)}}})},getCenter:function(t,e){var n=t[0].lng,r=t[0].lat,o=t[0].lng,a=t[0].lat,i=!0,l=!1,d=void 0;try{for(var u,c=t[Symbol.iterator]();!(i=(u=c.next()).done);i=!0){var s=u.value;s.lng<o&&(o=s.lng),s.lng>n&&(n=s.lng),s.lat<a&&(a=s.lat),s.lat>r&&(r=s.lat)}}catch(t){l=!0,d=t}finally{try{!i&&c.return&&c.return()}finally{if(l)throw d}}return new e.Point((n+o)/2,(r+a)/2)},convertPoints:function(t,e){var n=new e.Convertor,r=[],o=!0,a=!1,i=void 0;try{for(var l,d=t[Symbol.iterator]();!(o=(l=d.next()).done);o=!0){var u=l.value;r.push(new e.Point(u[0],u[1]))}}catch(t){a=!0,i=t}finally{try{!o&&d.return&&d.return()}finally{if(a)throw i}}for(var c=[],s=0,f=0;f<t.length;s++,f+=100)!function(t,e){c.push(new Promise(function(e,o){var a=100*t,i=a+100;n.translate(r.slice(a,i),1,5,function(t){e(t)})}))}(s);return Promise.all(c).then(function(t){var e=[],n=!0,r=!1,o=void 0;try{for(var a,i=t[Symbol.iterator]();!(n=(a=i.next()).done);n=!0){var l=a.value,d=!0,u=!1,c=void 0;try{for(var s,f=l.points[Symbol.iterator]();!(d=(s=f.next()).done);d=!0){var v=s.value;e.push(v)}}catch(t){u=!0,c=t}finally{try{!d&&f.return&&f.return()}finally{if(u)throw c}}}}catch(t){r=!0,o=t}finally{try{!n&&i.return&&i.return()}finally{if(r)throw o}}return{points:e,dataArr:t}})}}}}); | ||
//# sourceMappingURL=BaiduMapTrackRender.min.js.map |
{ | ||
"name": "baidu-map-track-render-vue", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/BaiduMapTrackRender.common.js", |
@@ -21,3 +21,3 @@ # BaiduMapTrackRender.vue 百度地图轨迹绘制 | ||
```html | ||
<BaiduMap ak="your key" :points="points" :style="{width: '680px', height: '480x'}"></BaiduMap> | ||
<BaiduMap ak="your key" :points="points"></BaiduMap> | ||
``` | ||
@@ -36,6 +36,6 @@ The ponit type is WGS84. Example points: | ||
2. 此组件将转换坐标为BD09,所以仅能接受中国地区坐标 | ||
3. 一定要指定高度, 否则高度为0, 组件将不可见 | ||
3. 一定要注意高度, 高度为0时组件将不可见 | ||
1. This component will only render given points to track | ||
2. This component will convert the coordinates to BD09, so can only accept the coordinates of the Chinese region | ||
3. Be sure to specify the height, otherwise the height is 0, the component will not be visible | ||
3. Pay attention on height, when height is 0, the component will not be visible |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42341
771