我正在使用 Cordova、AngularJs 和 OnsenUI 开发一个应用程序, 我正在使用 Google Maps Api 来显示我的当前位置和大约 200 个其他位置标记,
Google map 在所有其他设备上工作正常,但当我仅使用 Iphone X 放大 IOS-11.3 时应用程序崩溃,
Cordova :6.5.0 Angular 1 npm: 2.14.0
我添加了 firebase 崩溃报告插件,它报告崩溃的 OOM(内存不足)报告,
标记图像大小只有 1kb,大约有 200 个标记。 这是我的代码
var mapProp = {
center: new google.maps.LatLng(userlocation.latitude, userlocation.longitude),
zoom: 12,
mapTypeId: google.maps.MapTypeId.ROADMAP,
disableDefaultUI: true,
MapOptions: {
zoomControl: false,
mapTypeControl: false,
scaleControl: false,
streetViewControl: false,
rotateControl: false,
fullscreenControl: false
}
};
var map = new google.maps.Map(document.getElementById("mapNearByBreweries"), mapProp);
var usermarker = new google.maps.Marker({
position: new google.maps.LatLng(userlocation.latitude, userlocation.longitude),
icon: {
path: google.maps.SymbolPath.CIRCLE,
scale: 7,
strokeColor: "#0000FF",
},
draggable: false,
map: map
});
for (var i = 0; i < breweries.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(breweries[i].Latitude, breweries[i].Longitude),
map: map,
icon: 'images/blue-dot.png'
//animation: google.maps.Animation.BOUNCE
});
那么,ios 11.3(IphoneX) 中的哪些新功能会导致 google map api 缩放时内存不足?
我该怎么做才能解决这个问题?
最佳答案
我们遇到了这个确切的问题,回滚到 Google map 3.31 版对我们有用:)
您可以在此处查看可用的不同版本:
https://developers.google.com/maps/documentation/javascript/releases#321
显然,他们在 3.32 中切换到了实验性渲染器,它为我们打破了使用自定义标记的快速缩放。
希望这对您有所帮助!
关于android - IOS : Cordova App Crash on Google Map api zoom in ios 11. 3 iphone x,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50968769/