我可以更改Google地图嵌入式地图(iframe)中的标记吗? [英] Can I change the marker in a Google Maps embedded map (iframe)?

查看:138
本文介绍了我可以更改Google地图嵌入式地图(iframe)中的标记吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我可以使用Google Maps API来做到这一点,但是您知道是否有方法在嵌入式Google地图中更改标记吗?

我想要替换B按钮或仅有一个点的标记在中间

解决方案

我之前没有玩过嵌入谷歌地图(我通常会直接去像这样的东西的API)。我尝试了几种方法:


  • 我认为嵌入语法可能与静态地图API相同。所以我抓住了一个静态地图网址,从中复制了标记参数并尝试将其粘贴到iFrame网址中。这并没有太多的工作。

  • 我创建了 Google MyPlaces 并自定义 marker 使用您提供的那个。这创建了测试图,它有适当的标记图标。然后我抓住嵌入代码并将其粘贴在测试页面上,然后! / p>



I know I can do it with the Google Maps API, but do you know if there is a way to change the marker in an embedded Google Map?

I want to replace the default "A" button for a "B" button or the marker with just a dot in the middle.

解决方案

I haven't played around with embedding Google Maps before (I generally go straight to the API for stuff like this). I tried a couple of approaches:

  • I figured maybe the embed syntax would be the same as the static maps api. So I grabbed a static maps URL, copied the markers param from that and tried sticking it into the iFrame URL. This didn't work so much.

  • I created a Google MyPlaces and customized the marker to use the one your provided. This created a Test map which had the appropriate marker icon. I then grabbed the embed code and stuck it on a test page and voila!

这篇关于我可以更改Google地图嵌入式地图(iframe)中的标记吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆