polyline路线规划,ios正常,安卓闪退
路线规划,ios正常显示,安卓出现闪退现象
我使用了腾讯api和高德api做测试
测试:
1)备注掉路线规划的js,不闪退;(路线规划是官方代码)
2)延时加载路线规划,安卓出现闪退,ios正常;
3)保留路线规划的js,不在页面上进行渲染,不闪退
整个页面代码没有报错
是因为代码有bug,还是占用内存太大被干掉了?求各位大佬解惑
var that = this gdemap.getDrivingRoute({ origin: that.data.longitude + ',' + that.data.latitude, destination: that.data.end_lng + ',' + that.data.end_lat, success: function (data) { console.log(data) var points = []; if (data.paths && data.paths[0] && data.paths[0].steps) { var steps = data.paths[0].steps; for ( var i = 0; i < steps.length; i++) { var poLen = steps[i].polyline.split( ';' ); for ( var j = 0; j < poLen.length; j++) { points.push({ longitude: parseFloat(poLen[j].split( ',' )[0]), latitude: parseFloat(poLen[j].split( ',' )[1]) }) } } } that.setData({ polyline: [{ points: points, color: "#46B3FB" , width: 8, arrowLine: true , borderColor: "#2F85C9" , borderWidth: 4, }], jiazai: true , }) }, }) |