uiwjs / react-amap

基于 React 封装的高德地图组件,帮助你轻松的接入地图到 React 项目中。
https://uiwjs.github.io/react-amap
MIT License
422 stars 69 forks source link

ReferenceError: AMap is not defined #257

Closed pyb0924 closed 1 year ago

pyb0924 commented 1 year ago

const [infoWindowPosition, setInfoWindowPosition] = useState( new AMap.LngLat(121.437, 31.026) );

报错信息 ReferenceError: AMap is not defined at MapPage (http://localhost:3000/static/js/bundle.js:2243:107) at renderWithHooks (http://localhost:3000/static/js/bundle.js:92643:22) at mountIndeterminateComponent (http://localhost:3000/static/js/bundle.js:95929:17) at beginWork (http://localhost:3000/static/js/bundle.js:97225:20) at beginWork$1 (http://localhost:3000/static/js/bundle.js:102188:18) at performUnitOfWork (http://localhost:3000/static/js/bundle.js:101457:16) at workLoopSync (http://localhost:3000/static/js/bundle.js:101380:9) at renderRootSync (http://localhost:3000/static/js/bundle.js:101353:11) at recoverFromConcurrentError (http://localhost:3000/static/js/bundle.js:100845:24) at performSyncWorkOnRoot (http://localhost:3000/static/js/bundle.js:101054:24)

版本信息 @uiw/react-amap": "^4.0.2", "react": "^18.2.0",

想问一下是哪里没有引入吗?

jaywcjlove commented 1 year ago

@pyb0924