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

[Feature request] 增加地图插件 #290

Closed
sunshang-hl opened this issue Nov 19, 2024 · 1 comment
Closed

[Feature request] 增加地图插件 #290

sunshang-hl opened this issue Nov 19, 2024 · 1 comment

Comments

@sunshang-hl
Copy link

Clear and concise description of the problem

我最近在研究如何解决vuepress静态站点页面显示地图,目前的想到解决方案是通过iframe内嵌的方式调用地图api,在md文件中传入经纬度和描述,在地图中标记地点并显示地点的名称信息,

Suggested solution

目前的想到解决方案是通过iframe内嵌的方式调用地图api, 比如这样:
`<iframe id="mapPage" width="100%" height="100%" frameborder=0 src="https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=your key&referer=myapp">

</iframe> <script> window.addEventListener('message', function(event) { // 接收位置信息,用户选择确认位置点后选点组件会触发该事件,回传用户的位置信息 var loc = event.data; if (loc && loc.module == 'locationPicker') {//防止其他应用也会向该页面post信息,需判断module是否为'locationPicker' console.log('location', loc); } }, false); </script>

`
用户传入想locationPicker传入数据:22.547086,114.010066,,地图上标注地点,地图下边的列表中显示地址名称:广东省深圳市福田区侨香三道1号,传入多个地点则同时在地图上标注位置,并显示地址名称.

Alternative

No response

Additional context

No response

@Mister-Hope
Copy link
Member

Not a common need

@Mister-Hope Mister-Hope closed this as not planned Won't fix, can't repro, duplicate, stale Nov 19, 2024
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