uiwjs / react-baidu-map

基于 React 封装的百度地图组件,支持 React Hook,帮助你轻松的接入地图到 React 项目中。
https://uiwjs.github.io/react-baidu-map
MIT License
222 stars 22 forks source link

GeolocationControl组件 onLocationSuccesss事件返回district和street为空 #170

Open lijie0214 opened 3 years ago

lijie0214 commented 3 years ago

GeolocationControl组件 onLocationSuccesss事件返回district和street为空

addressComponent: { city: "广州市" district: "" province: "广东省" street: "" }

jaywcjlove commented 3 years ago

@lijie0214 是不是你 akay 配置错了?

lijie0214 commented 3 years ago

@lijie0214 是不是你 akay 配置错了?

没有错呀 按照文档里这么使用的

jaywcjlove commented 3 years ago

@lijie0214 那你需要看看 百度文档了,这个是百度API返回的数据。

lijie0214 commented 3 years ago

@lijie0214 那你需要看看 百度文档了,这个是百度API返回的数据。

本地开发时使用chrome浏览器 demo里面是可以获取到district和street, 我自己 demo里面的代码到本地开发后就获取到的是空了, 只有safari浏览器获取的是正常的, 很奇怪不知道什么原因

jaywcjlove commented 3 years ago

@lijie0214 我也不知道,这个是百度 SDK 的方法返回的结果。

jaywcjlove commented 3 years ago

@lijie0214 所以不是不是看看百度文档,需要账号设置啥?