We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
RT
import React, { useState, useEffect } from 'react'; import { APILoader } from '@uiw/react-baidu-map'; import { WaterMark } from 'antd-mobile'; import './_style.scss'; import { BoxMap } from '@/components'; export default function MapPage() { const AK = 'AK'; useEffect(() => { console.log(window); console.log(window?.BMapGL); }, []); // 获取userName以用于水印 const [userName] = useState('duxiaoman'); return ( <div className="map-page" style={{ width: '100%', height: '100vh', overflow: 'hidden' }} > <APILoader akay={AK} type="webgl" > <BoxMap></BoxMap> </APILoader> {/* 水印组件 */} <WaterMark content={userName} /> </div> ); }
在打印第一个window时可以看到BmapGL挂到window上了,第二个会直接打出undefined。求教各位大神是怎么回事
The text was updated successfully, but these errors were encountered:
@Allen-Bayern 如果使用 BmapGL 可以使用百度官方 react 组件 https://lbsyun.baidu.com/solutions/reactBmapDoc
Sorry, something went wrong.
No branches or pull requests
RT
在打印第一个window时可以看到BmapGL挂到window上了,第二个会直接打出undefined。求教各位大神是怎么回事
The text was updated successfully, but these errors were encountered: