Skip to content
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

高德自定义地图加载失败 #1950

Closed
linquememe opened this issue Oct 24, 2023 · 5 comments · Fixed by #1952
Closed

高德自定义地图加载失败 #1950

linquememe opened this issue Oct 24, 2023 · 5 comments · Fixed by #1952
Labels

Comments

@linquememe
Copy link

问题描述

使用高德的自定义地图样式,有时候会出现请求高德对应文件会出现请求超时,类似请求https://webapi.amap.com/maps?callback=___onAPILoaded&v=2.0&key=50b929398990652268041870e73b31ff&plugin=Map3D 这样的文件,主要会导致自定义地图加载不出来,要如何捕获这种错误重新创建地图

重现链接

No response

重现步骤

No response

预期行为

No response

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@github-actions
Copy link
Contributor

hi @linquememe, welcome!

@github-actions github-actions bot added 🌟 star good first issue Good for newcomers labels Oct 24, 2023
@lzxue
Copy link
Contributor

lzxue commented Oct 24, 2023

请使用自己注册的高德地图key,作为 L7 Token参数。

@linquememe
Copy link
Author

有使用高德地图key,作为 L7 Token参数,高德的自定义皮肤也能正常加载,主要是在页面第一次加载的时候偶尔会出现请求超时导致加载失败的情况,导致地图是默认的白底,看了文档没找到对应的地图皮肤加载失败事件,不知道怎么处理能宾这种情况

@linquememe
Copy link
Author

image
是否是加载这个高德地图的loader.js的原因,L7是不是用高德只要安全密钥和token,其他的高德配置不需要加上去

@lzxue
Copy link
Contributor

lzxue commented Oct 25, 2023

image 是否是加载这个高德地图的loader.js的原因,L7是不是用高德只要安全密钥和token,其他的高德配置不需要加上去

https://codesandbox.io/s/m76tht?file=/index.html 该demo 链接替换成自己的 key和密钥验证一下不能加载你的自定义地图
如果可以那么 L7 也没问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants