谷歌地图嵌入 - 2个目标/ 2个引脚只能看到一个

时间:2014-01-29 06:17:06

标签: javascript html google-maps

我对Google Map嵌入有疑问。

我希望它有2个引脚(下图)并显示一个引脚:

http://i.stack.imgur.com/7xMVP.png

http://i.stack.imgur.com/1sjBM.png

这就是我用它做的事情:

HTML

<iframe id="maps" scrolling="yes" src="https://www.google.ca/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=http:%2F%2Fmapsengine.google.com%2Fmap%2Fu%2F0%2Fkml%3Fmid%3DznCNeZskEW3Y.kS90qBvIE6qE%26amp%3Blid%3DznCNeZskEW3Y.kiLNrr6FIbEE&amp;aq=&amp;sll=51.022835,-114.12811&amp;sspn=0.070293,0.154324&amp;t=m&amp;ie=UTF8&amp;ll=51.022826,-114.128036&amp;spn=0.051829,0.109863&amp;z=13&amp;output=embed">
</iframe>

和Javascript:

  w = window.innerWidth;
  h = window.innerHeight;
  $('#maps').css('height', h - 100);
  $('#maps').css('width', w - 100);
  $('#maps').css('margin-left', 50);

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

大家好,我找到了成功的方法。

<object id="maps" type="text/html" data="https://www.google.ca/maps?f=q&source=s_q&hl=en&geocode=&q=http:%2F%2Fmapsengine.google.com%2Fmap%2Fu%2F0%2Fkml%3Fmid%3DznCNeZskEW3Y.kS90qBvIE6qE%26amp%3Blid%3DznCNeZskEW3Y.kiLNrr6FIbEE&aq=&sll=51.022835,-114.12811&sspn=0.070293,0.154324&t=m&ie=UTF8&ll=51.022826,-114.128036&spn=0.051829,0.109863&z=13&output=embed">

我使用object标签显示整个页面,并使用Javascript来修复地图的高度和宽度。

  w = window.innerWidth;
  h = window.innerHeight;
  $('#maps').css('height', h - 100);
  $('#maps').css('width', w - 100);
  $('#maps').css('margin-left', 50);