mirror of https://gitee.com/antv-l7/antv-l7
fix: 修复加载高德地图判断加载导致的缓存问题 (#1301)
* fix: 去除 amap 加载的判断 * style: lint style Co-authored-by: shihui <yiqianyao.yqy@alibaba-inc.com>
This commit is contained in:
parent
cb6dd27471
commit
ae1aa59879
|
@ -392,21 +392,11 @@ export default class AMapService
|
|||
}
|
||||
amapLoaded = true;
|
||||
plugin.push('Map3D');
|
||||
if(window.AMap) {
|
||||
Promise.resolve().then(() => {
|
||||
resolveMap();
|
||||
|
||||
if (pendingResolveQueue.length) {
|
||||
pendingResolveQueue.forEach((r) => r());
|
||||
pendingResolveQueue = [];
|
||||
}
|
||||
})
|
||||
} else {
|
||||
AMapLoader.load({
|
||||
key: token, // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
version: AMAP_VERSION, // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||
plugins: plugin, // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
||||
})
|
||||
AMapLoader.load({
|
||||
key: token, // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
version: AMAP_VERSION, // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||
plugins: plugin, // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
||||
})
|
||||
.then((AMap) => {
|
||||
resolveMap();
|
||||
|
||||
|
@ -418,7 +408,6 @@ export default class AMapService
|
|||
.catch((e) => {
|
||||
throw new Error(e);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if ((amapLoaded && window.AMap) || mapInstance) {
|
||||
resolveMap();
|
||||
|
|
|
@ -503,21 +503,11 @@ export default class AMapService
|
|||
}
|
||||
amapLoaded = true;
|
||||
plugin.push('Map3D');
|
||||
if(window.AMap) {
|
||||
Promise.resolve().then(() => {
|
||||
resolveMap();
|
||||
|
||||
if (pendingResolveQueue.length) {
|
||||
pendingResolveQueue.forEach((r) => r());
|
||||
pendingResolveQueue = [];
|
||||
}
|
||||
})
|
||||
} else {
|
||||
AMapLoader.load({
|
||||
key: token, // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
version: AMAP_VERSION, // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||
plugins: plugin, // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
||||
})
|
||||
AMapLoader.load({
|
||||
key: token, // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
version: AMAP_VERSION, // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||
plugins: plugin, // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
||||
})
|
||||
.then((AMap) => {
|
||||
resolveMap();
|
||||
|
||||
|
@ -529,7 +519,6 @@ export default class AMapService
|
|||
.catch((e) => {
|
||||
throw new Error(e);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if ((amapLoaded && window.AMap) || mapInstance) {
|
||||
resolveMap();
|
||||
|
|
Loading…
Reference in New Issue