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

地图定位好了后,然后拖拽地图,怎么点击定位按钮 让地图移动到以定位为中心点的地方 #14

Closed
a2734961 opened this issue Nov 16, 2022 · 6 comments

Comments

@a2734961
Copy link

image

yue1123 added a commit that referenced this issue Nov 16, 2022
@yue1123
Copy link
Owner

yue1123 commented Nov 16, 2022

升级到0.0.34,调用map组件的 resetCenter 方法,可以参考useBrowserLocation文档实例代码

@a2734961
Copy link
Author

升级到0.0.34,调用map组件的 resetCenter 方法,可以参考useBrowserLocation文档实例代码

ok。解决了,谢谢哥~

@a2734961
Copy link
Author

升级到0.0.34,调用map组件的 resetCenter 方法,可以参考useBrowserLocation文档实例代码

另外一个小问题。marker能控制层级吗。比如我的定位点 显示在前面,其他标记点在后面
image

@a2734961
Copy link
Author

升级到0.0.34,调用map组件的 resetCenter 方法,可以参考useBrowserLocation文档实例代码

map的 height 能做成ref自适应的吗? 根据交互需要变化!

@yue1123
Copy link
Owner

yue1123 commented Nov 17, 2022

升级到0.0.34,调用map组件的 resetCenter 方法,可以参考useBrowserLocation文档实例代码

map的 height 能做成ref自适应的吗? 根据交互需要变化!

hight 是个静态属性,你可以试试 css 的相对高度,比如100%100vh

@yue1123
Copy link
Owner

yue1123 commented Nov 17, 2022

升级到0.0.34,调用map组件的 resetCenter 方法,可以参考useBrowserLocation文档实例代码

另外一个小问题。marker能控制层级吗。比如我的定位点 显示在前面,其他标记点在后面 image

当前版本marker组件没有提供设置层级的 props,但是你可以监听@initd 事件,通过事件参数中的 marker 实例调用实例方法setZIndex,百度地图文档上写了有,我没试过,不知道行不行,你试试吧。下个版本吧层级属性加到 Props 里面

yue1123 added a commit that referenced this issue Nov 17, 2022
@yue1123 yue1123 closed this as completed Nov 17, 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