iOS:谷歌地图api上的Cordova应用程序崩溃ios 11.3 iPhone X放大 [英] IOS : Cordova App Crash on Google Map api zoom in ios 11.3 iphone x

查看:134
本文介绍了iOS:谷歌地图api上的Cordova应用程序崩溃ios 11.3 iPhone X放大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用Cordova,AngularJs和OnsenUI开发一个应用程序, 我正在使用Google Maps Api显示我的当前位置以及大约200个其他位置标记,

I am developing one application with Cordova, AngularJs and OnsenUI, I am using Google Maps Api to show my current location and around 200 other locations marker,

Google地图在所有其他设备上都可以正常工作,但是当我仅使用Iphone X放大IOS-11.3时,应用程序会崩溃

Google maps works fine in all other devices but app crashes when i zoom in IOS-11.3 with Iphone X only,

科尔多瓦:6.5.0 AngularJs 1 npm:2.14.0

Cordova : 6.5.0 AngularJs 1 npm: 2.14.0

我添加了Firebase崩溃报告插件,并且它报告了崩溃的OOM(内存不足)报告,

I have added firebase crash report plugin and it reported OOM(Out Of Memory) report for crash,

标记图像大小仅为1kb,并且大约有200个标记. 这是我的代码

Marker image size is only 1kb and around 200 markers are there. Here is my code

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中的内存不足?

So, which new things in ios 11.3(IphoneX) can cause out of memory in google map api on zoom?

我该怎么做才能解决此问题?

and what can i do to resolve this issue?

推荐答案

我们遇到了这个确切的问题,并回滚到适用于我们的Google Maps版本3.31:)

We had this exact issue and rolling back to Google Maps version 3.31 worked for us :)

您可以在此处查看可用的不同版本:

You can check out the different versions available here:

https://developers.google.com/maps/documentation/javascript/releases#321

显然,他们在3.32中切换到了实验性渲染器,它为我们打破了使用自定义标记的快速缩放的功能.

Apparently they switched to an experimental renderer in 3.32 and it broke the fast zoom with custom markers for us.

希望这会有所帮助!

这篇关于iOS:谷歌地图api上的Cordova应用程序崩溃ios 11.3 iPhone X放大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆