我有一个Ionic 3应用程序,并将其更新为IONIC 4。因此,当我使用xcode 10编译ios 12的应用程序时,谷歌地图折线不会渲染并抛出错误。在IONIC 3和ios 11.3上它渲染得非常完美,但在升级后停止显示:
我的代码如下:
for (const path of dashedlinePaths) {
const lineSymbol = {
path: 'M 0,-1 0,1',
strokeOpacity: 1,
scale: 4
};
let dashedPath = new google.maps.Polyline({
path: path,
geodesic: true,
strokeOpacity: 0,
strokeColor: '#ff883c',
icons: [{
icon: lineSymbol,
offset: '0',
repeat: '20px'
}]
});
dashedPath.setMap(this.googleMap);
}
for (const path of linePaths) {
let linePath = new google.maps.Polyline({
path: path,
geodesic: true,
strokeColor: '#ff883c',
strokeOpacity: 1.0,
strokeWeight: 4
});
linePath.setMap(this.googleMap);
}
错误信息通常会显示类似于以下内容:
TypeError: null is not an object (evaluating 'e.lineJoin="round"')
runTask — polyfills.js:3880
invokeTask — polyfills.js:4017
n — polyfills.js:3457
runTask — polyfills.js:3880
同时它显示了警告信息,例如:
Total canvas memory use exceeds the maximum limit (224 MB).lW — poly.js:52:321
当我尝试缩放地图时,出现错误:
TypeError: null is not an object (evaluating 'a.scale')
runTask — polyfills.js:3880
invokeTask — polyfills.js:4017
n — polyfills.js:3457
runTask — polyfills.js:3880