[Resolved] There is a problem with the key ak you are using and it does not support the jsapi service. You can visit this URL to learn how to obtain a valid key.

There is a problem with the key ak you are using and it does not support the jsapi service. You can visit this URL to learn how to obtain a valid key. For details, check: http://lbsyun.baidu.com/apiconsole/key#.

question

Baidu key expires

Ideas

Register as a developer.
If you haven't registered a Baidu Map API account yet, click to enter this interface. At this time, you click on the "api console" in the upper right corner to enter, and it will jump to the registration page. After completing the registration, click Apply for Key.

image-20230911194823858

Apply for a key
After clicking Apply for a key, you will be redirected to this page. You can click "Create Application" in "My Applications" on the right menu bar, and then you can create your own ak. You can fill in the name as you like. If you don’t want to join the whitelist, you can fill in the IP address. If you want all websites to be accessible, you have to fill it in as I did.

Copy ak to the web page.
Look, ak will be generated after submission. At this time, you can copy and paste ak to your web page, and the problem will be solved. If the problem is not solved, then Baidu is updating the server, just wait a few hours.

image-20230911194836041

Official solution
http://lbsyun.baidu.com/index.php?title=jspopular/qa

You can change it after registration

solve

Global replacement ak=xxx

image-20230911193446172

Guess you like

Origin blog.csdn.net/xianyu120/article/details/132816294