Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

baidu-map-track-render-vue

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baidu-map-track-render-vue - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

41

dist/BaiduMapTrackRender.common.js
/*!
* baidu-map-track-render-vue v1.0.8
* baidu-map-track-render-vue v1.0.10
* phphe <phphe@outlook.com> (https://github.com/phphe)

@@ -78,19 +78,3 @@ * https://github.com/phphe/baidu-map-track-render-vue.git

if (_this.points) {
_this.convertPoints(_this.points, BMap).then(function (_ref) {
var points = _ref.points;
var map = new BMap.Map(_this.id);
var center = _this.getCenter(points, BMap);
map.centerAndZoom(center, 15);
map.enableScrollWheelZoom();
for (var i = 0; i < points.length; i++) {
var prev = points[i - 1];
if (prev) {
var current = points[i];
var polyline = new BMap.Polyline([prev, current], { strokeColor: 'blue', strokeWeight: 2, strokeOpacity: 0.5 }); // 创建折线
map.addOverlay(polyline); // 增加折线
}
}
});
_this.ready(BMap, _this.points);
}

@@ -102,2 +86,23 @@ });

methods: {
ready: function ready(BMap, points) {
var _this2 = this;
this.convertPoints(points, BMap).then(function (_ref) {
var points = _ref.points;
var map = new BMap.Map(_this2.id);
var center = _this2.getCenter(points, BMap);
map.centerAndZoom(center, 15);
map.enableScrollWheelZoom();
for (var i = 0; i < points.length; i++) {
var prev = points[i - 1];
if (prev) {
var current = points[i];
var polyline = new BMap.Polyline([prev, current], { strokeColor: 'blue', strokeWeight: 2, strokeOpacity: 0.5 }); // 创建折线
map.addOverlay(polyline); // 增加折线
}
}
});
},
getCenter: function getCenter(points, BMap) {

@@ -104,0 +109,0 @@ var maxX = points[0].lng;

/*!
* baidu-map-track-render-vue v1.0.8
* baidu-map-track-render-vue v1.0.10
* phphe <phphe@outlook.com> (https://github.com/phphe)

@@ -76,19 +76,3 @@ * https://github.com/phphe/baidu-map-track-render-vue.git

if (_this.points) {
_this.convertPoints(_this.points, BMap).then(function (_ref) {
var points = _ref.points;
var map = new BMap.Map(_this.id);
var center = _this.getCenter(points, BMap);
map.centerAndZoom(center, 15);
map.enableScrollWheelZoom();
for (var i = 0; i < points.length; i++) {
var prev = points[i - 1];
if (prev) {
var current = points[i];
var polyline = new BMap.Polyline([prev, current], { strokeColor: 'blue', strokeWeight: 2, strokeOpacity: 0.5 }); // 创建折线
map.addOverlay(polyline); // 增加折线
}
}
});
_this.ready(BMap, _this.points);
}

@@ -100,2 +84,23 @@ });

methods: {
ready: function ready(BMap, points) {
var _this2 = this;
this.convertPoints(points, BMap).then(function (_ref) {
var points = _ref.points;
var map = new BMap.Map(_this2.id);
var center = _this2.getCenter(points, BMap);
map.centerAndZoom(center, 15);
map.enableScrollWheelZoom();
for (var i = 0; i < points.length; i++) {
var prev = points[i - 1];
if (prev) {
var current = points[i];
var polyline = new BMap.Polyline([prev, current], { strokeColor: 'blue', strokeWeight: 2, strokeOpacity: 0.5 }); // 创建折线
map.addOverlay(polyline); // 增加折线
}
}
});
},
getCenter: function getCenter(points, BMap) {

@@ -102,0 +107,0 @@ var maxX = points[0].lng;

/*!
* baidu-map-track-render-vue v1.0.8
* baidu-map-track-render-vue v1.0.10
* phphe <phphe@outlook.com> (https://github.com/phphe)

@@ -82,19 +82,3 @@ * https://github.com/phphe/baidu-map-track-render-vue.git

if (_this.points) {
_this.convertPoints(_this.points, BMap).then(function (_ref) {
var points = _ref.points;
var map = new BMap.Map(_this.id);
var center = _this.getCenter(points, BMap);
map.centerAndZoom(center, 15);
map.enableScrollWheelZoom();
for (var i = 0; i < points.length; i++) {
var prev = points[i - 1];
if (prev) {
var current = points[i];
var polyline = new BMap.Polyline([prev, current], { strokeColor: 'blue', strokeWeight: 2, strokeOpacity: 0.5 }); // 创建折线
map.addOverlay(polyline); // 增加折线
}
}
});
_this.ready(BMap, _this.points);
}

@@ -106,2 +90,23 @@ });

methods: {
ready: function ready(BMap, points) {
var _this2 = this;
this.convertPoints(points, BMap).then(function (_ref) {
var points = _ref.points;
var map = new BMap.Map(_this2.id);
var center = _this2.getCenter(points, BMap);
map.centerAndZoom(center, 15);
map.enableScrollWheelZoom();
for (var i = 0; i < points.length; i++) {
var prev = points[i - 1];
if (prev) {
var current = points[i];
var polyline = new BMap.Polyline([prev, current], { strokeColor: 'blue', strokeWeight: 2, strokeOpacity: 0.5 }); // 创建折线
map.addOverlay(polyline); // 增加折线
}
}
});
},
getCenter: function getCenter(points, BMap) {

@@ -108,0 +113,0 @@ var maxX = points[0].lng;

/*!
* baidu-map-track-render-vue v1.0.8
* baidu-map-track-render-vue v1.0.10
* phphe <phphe@outlook.com> (https://github.com/phphe)

@@ -8,3 +8,3 @@ * https://github.com/phphe/baidu-map-track-render-vue.git

!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.BaiduMapTrackRender=t()}(this,function(){"use strict";function n(){return new Promise(function(n,t){document&&"complete"===document.readyState?n():window.addEventListener("load",function t(){n(),window.removeEventListener("load",t)})})}function t(n,t){n[t]=void 0;try{delete n[t]}catch(n){}}function e(r){if(window.BMap)return Promise.resolve(window.BMap);var o=e;return n().then(function(){if(o.loaded)return window.BMap;if(!o.requested){o.requested=!0,window._BaiduMapLoadedCallback=function(){o.loaded=!0,t(window,"_BaiduMapLoadedCallback")};var n=document.createElement("script");return n.src="http://api.map.baidu.com/api?v=2.0&ak="+r+"&callback=_BaiduMapLoadedCallback",document.body.appendChild(n),new Promise(function(n,t){var e=window.setInterval(function(){o.loaded&&(window.clearInterval(e),n(window.BMap))},10)})}})}return{render:function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",{staticClass:"baidu-map-track-render-vue"},[e("div",{staticClass:"baidu-map-track-render-vue__map",attrs:{id:n.id}})])},staticRenderFns:[],props:{points:{},ak:{},coordinateConversionLimit:{default:10}},data:function(){return{id:"BaiduMap_"+this._uid}},mounted:function(){var n=this;this.$nextTick(function(){e(n.ak).then(function(t){n.points&&n.convertPoints(n.points,t).then(function(e){var r=e.points,o=new t.Map(n.id),a=n.getCenter(r,t);o.centerAndZoom(a,15),o.enableScrollWheelZoom();for(var i=0;i<r.length;i++){var d=r[i-1];if(d){var l=r[i],u=new t.Polyline([d,l],{strokeColor:"blue",strokeWeight:2,strokeOpacity:.5});o.addOverlay(u)}}})})})},methods:{getCenter:function(n,t){var e=n[0].lng,r=n[0].lat,o=n[0].lng,a=n[0].lat,i=!0,d=!1,l=void 0;try{for(var u,c=n[Symbol.iterator]();!(i=(u=c.next()).done);i=!0){var s=u.value;s.lng<o&&(o=s.lng),s.lng>e&&(e=s.lng),s.lat<a&&(a=s.lat),s.lat>r&&(r=s.lat)}}catch(n){d=!0,l=n}finally{try{!i&&c.return&&c.return()}finally{if(d)throw l}}return new t.Point((e+o)/2,(r+a)/2)},convertPoints:function(n,t){for(var e=new t.Convertor,r=n.map(function(n){return new t.Point(n.lng,n.lat)}),o=[],a=this.coordinateConversionLimit;r.length>0;)o.push(new Promise(function(n,t){e.translate(r.splice(0,a),1,5,function(t){n(t)})}));return Promise.all(o).then(function(n){var t=[],e=!0,r=!1,o=void 0;try{for(var a,i=n[Symbol.iterator]();!(e=(a=i.next()).done);e=!0){var d=a.value,l=!0,u=!1,c=void 0;try{for(var s,f=d.points[Symbol.iterator]();!(l=(s=f.next()).done);l=!0){var v=s.value;t.push(v)}}catch(n){u=!0,c=n}finally{try{!l&&f.return&&f.return()}finally{if(u)throw c}}}}catch(n){r=!0,o=n}finally{try{!e&&i.return&&i.return()}finally{if(r)throw o}}return{points:t,dataArr:n}})}}}});
!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){if(window.BMap)return Promise.resolve(window.BMap);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,e=t._self._c||n;return e("div",{staticClass:"baidu-map-track-render-vue"},[e("div",{staticClass:"baidu-map-track-render-vue__map",attrs:{id:t.id}})])},staticRenderFns:[],props:{points:{},ak:{},coordinateConversionLimit:{default:10}},data:function(){return{id:"BaiduMap_"+this._uid}},mounted:function(){var t=this;this.$nextTick(function(){e(t.ak).then(function(n){t.points&&t.ready(n,t.points)})})},methods:{ready:function(t,n){var e=this;this.convertPoints(n,t).then(function(n){var r=n.points,o=new t.Map(e.id),a=e.getCenter(r,t);o.centerAndZoom(a,15),o.enableScrollWheelZoom();for(var i=0;i<r.length;i++){var d=r[i-1];if(d){var l=r[i],u=new t.Polyline([d,l],{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,d=!1,l=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>e&&(e=s.lng),s.lat<a&&(a=s.lat),s.lat>r&&(r=s.lat)}}catch(t){d=!0,l=t}finally{try{!i&&c.return&&c.return()}finally{if(d)throw l}}return new n.Point((e+o)/2,(r+a)/2)},convertPoints:function(t,n){for(var e=new n.Convertor,r=t.map(function(t){return new n.Point(t.lng,t.lat)}),o=[],a=this.coordinateConversionLimit;r.length>0;)o.push(new Promise(function(t,n){e.translate(r.splice(0,a),1,5,function(n){t(n)})}));return Promise.all(o).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 d=a.value,l=!0,u=!1,c=void 0;try{for(var s,f=d.points[Symbol.iterator]();!(l=(s=f.next()).done);l=!0){var v=s.value;n.push(v)}}catch(t){u=!0,c=t}finally{try{!l&&f.return&&f.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}})}}}});
//# sourceMappingURL=BaiduMapTrackRender.min.js.map
{
"name": "baidu-map-track-render-vue",
"version": "1.0.9",
"version": "1.0.10",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/BaiduMapTrackRender.common.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc