-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
高德地图在子应用中轨迹回放时报removeChild异常 #524
Comments
我也遇到了同样的问题,拉源代码调试依然没解决。目前对于轨迹回放的部分只能先用iframe降级处理了。 |
断点调试一下到底是什么原因,可以借鉴以下思路 |
@yiludege 我找到了原因,但无法解决。 因为加载高德地图插件时有这样一个函数执行: function F(t, i) {
var n = document.createElement("script");
(n.type = "text/javascript"),
(document.body
? ((n.onload = function () {
document.body.removeChild(n), i();
}),
(n.src = t),
document.body)
: ((n.onload = function () {
document.head.removeChild(n), i();
}),
(n.src = t),
document.head)
).appendChild(n);
} 对一个新的script标签做了增删操作。 我用两个js文件( // a.js
const script = document.createElement("script");
script.type = "text/javascript";
script.src = "/b.js";
script.onload = function () {
document.body.removeChild(script);
};
document.body.appendChild(script); 在 在子应用中加载 const script = document.createElement("script");
script.type = "text/javascript";
script.src = "/a.js";
document.body.appendChild(script); 通过上述步骤就可以复现问题。 我调试无界源码时,发现 |
这个问题我遇到并解决了,子应用用到高德地图的界面,捕获这个异常,然后重新实例化地图对象就可以解决这个问题
|
|
高德地图在子应用中轨迹回放时卡顿明显,无动画效果;在主应用中正常;
The text was updated successfully, but these errors were encountered: