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

Uncaught ReferenceError: AMap is not defined #211

Closed
lyquita opened this issue Feb 25, 2022 · 1 comment
Closed

Uncaught ReferenceError: AMap is not defined #211

lyquita opened this issue Feb 25, 2022 · 1 comment

Comments

@lyquita
Copy link

lyquita commented Feb 25, 2022

compile没有问题,但是项目跑起来后,控制台会报这个错误

useEffect(()=>{
    //@ts-ignore: Unreachable code error
    AMap.plugin(['AMap.Geolocation'], ()=>{
      const instance = new AMap.Geolocation({});
      instance.getCurrentPosition((status, result)=>{
        console.log('result', status, result)
      })
    } )
    }, [])

image

@jaywcjlove
Copy link
Member

jaywcjlove commented Feb 25, 2022

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

No branches or pull requests

2 participants