我对Google Map嵌入有疑问。
我希望它有2个引脚(下图)并显示一个引脚:
这就是我用它做的事情:
HTML
<iframe id="maps" scrolling="yes" src="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">
</iframe>
和Javascript:
w = window.innerWidth;
h = window.innerHeight;
$('#maps').css('height', h - 100);
$('#maps').css('width', w - 100);
$('#maps').css('margin-left', 50);
答案 0 :(得分:0)
将缩放比例从13更改为11(缩小以显示两个标记):
您原来的“嵌入”网址(z = 13):
将其更改为(z = 11):
答案 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);