如何将标记添加到google map embed api?

时间:2015-07-27 03:27:23

标签: google-maps

我尝试将google map embed api添加到我的网站。就像文档一样,如下所示

<iframe
  width="600"
  height="450"
  frameborder="0" style="border:0"
  src="https://www.google.com/maps/embed/v1/place?key=API_KEY
    &q=Space+Needle,Seattle+WA" allowfullscreen>
</iframe>

但是,我不知道如何添加标记来嵌入api。有人可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

I just had this issue. I tried the "directions" for a set of markers, seems to work. In my case it was an itinerary so it was reasonable.

iframe width="600" height="450" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/directions?key=my key here&amp;origin=45.476112,-73.823152&amp;destination=45.800000,-73.823298&amp;mode=walking&amp;waypoints=45.47611153,-73.82315248|45.56712414,-73.82331277|45.6,-73.82318975|45.7,-73.83250646|45.8,-73.82329847&amp;center=45.47611153,-73.82315248&amp;zoom=14" allowfullscreen=""></iframe>

If you happen to know how to get it to go fullscreen, I'd be grateful.