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

mapStyleV2 使用问题 #134

Open
mcl950121 opened this issue May 14, 2021 · 10 comments
Open

mapStyleV2 使用问题 #134

mcl950121 opened this issue May 14, 2021 · 10 comments

Comments

@mcl950121
Copy link

当使用mapStyleV2 底图时,Map 组件 center参数设置为经纬度才可以生效,设置为字符串(比如'北京市')不生效。 但是设置为经纬度时,地图动态生成marker时会重置地图center和zoom

@jaywcjlove
Copy link
Member

@mcl950121 请给出示例

@mcl950121
Copy link
Author

@mcl950121
Copy link
Author

@jaywcjlove 您好,帮忙给看看

@jaywcjlove
Copy link
Member

@mcl950121 https://codesandbox.io/s/react-baidu-map-demo-forked-bw829?file=/src/index.js

我的使用 styleJson 成功了!但是 styleId 使用失败,你可以去百度提交工单,看一下什么问题。

styleJson 直接复制编辑器中的 json 数据

@jaywcjlove
Copy link
Member

@mcl950121 你的密钥 密钥(ak) 是不是 和 styleId 不在一个账号上?

@mcl950121
Copy link
Author

@jaywcjlove 我的密钥和styleId在同一个账号上,center属性填写经纬度是可以出来地图的,但填写地图字符串就出不来了, 是不是因为加了mapStyleV2属性导致map不支持center地区字符串了。

jaywcjlove added a commit that referenced this issue May 19, 2021
jaywcjlove added a commit that referenced this issue May 19, 2021
jaywcjlove added a commit that referenced this issue May 19, 2021
@jaywcjlove
Copy link
Member

@mcl950121 不知道什么原因,搞我发几个版本

center 设置经纬度或者字符串是起作用的,但是配合 mapStyleV2 使用就不行了...

昨天 mapStyleV2. styleJson 好的今天就........

@mcl950121
Copy link
Author

@jaywcjlove 是不是mapStylev2不支持不识别地区字符串,

@jaywcjlove
Copy link
Member

@mcl950121 这个不太清楚,只是把参数给到地图API 具体地图怎么处理不太清楚,欢迎排除问题。

@yoke0104x
Copy link

@mcl950121 大佬帮我看看为什么我用json都出不来

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

3 participants