【问题标题】:Ionic 5 Google Map Marker breaking animations on IOSIonic 5 Google Map Marker 在 IOS 上破坏动画
【发布时间】:2020-01-08 11:08:50
【问题描述】:

我正在使用 google maps javascript api 3 在 ionic 应用程序上添加 google map。该地图工作正常,但是当我在地图上添加标记时,cordova 动画停止在 ios 上运行,在 android 上一切正常。例如点击 ion-select 或添加 Alert 会产生以下错误

Unhandled Promise 拒绝:-“undefined is not a function (near '...element.animate...')" – ";区域:“-”“-”;任务:” - "Promise.then" – "; Value:" (2) TypeError: undefined is not a function (靠近'...element.animate...') -

 animation-5559213c.js:652 (anonymous function) — 
 animation-5559213c.js:652 forEach initializeWebAnimation — 
 animation-5559213c.js:651   initializeAnimation —
 animation-5559213c.js:674 play — animation 5559213c.js:950 (anonymous
 function) — 
 animation-5559213c.js:961 forEach play —
 animation-5559213c.js:960 (anonymous function) —
 animation-5559213c.js:852 ZoneAwarePromise — zone.js:910 playAsync —
 animation-5559213c.js:850 (anonymous function) —
 overlays-10cf2041.js:202 step — tslib.es6.js:99 fulfilled —
 tslib.es6.js:70 run — zone.js:150 (anonymous function) — zone.js:889
 runTask — zone.js:195 drainMicroTaskQueue — 
 zone.js:601 promiseReactionJob

我的应用的 ionic 版本是 5.2.3。任何帮助将不胜感激。

【问题讨论】:

  • 您可能需要为其添加 polyfill。运行npm install --save web-animations-js,然后在polyfills.ts 文件中取消注释// import 'web-animations-js';
  • 你的解决方案对我有用,兄弟。如果您可以发布答案,我会接受:)

标签: ios angular animation ionic-framework google-maps-api-3


【解决方案1】:

导入 web-animations-js polyfill.

在终端中运行npm install --save web-animations-js,然后在src/polyfills.ts中取消注释以下行:

import 'web-animations-js';

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-10-10
    • 2021-01-31
    • 1970-01-01
    • 1970-01-01
    • 2015-02-08
    • 2021-09-22
    • 2016-12-29
    • 1970-01-01
    相关资源
    最近更新 更多