是否有可能在谷歌地图内部定位?

时间:2012-02-18 11:03:04

标签: css google-maps

我有几个网站的这个问题。我正在为该网站构建此联系页面 - http://bellated.us.lt/kontaktai-2/ 我想要做的是在加载这个谷歌地图地址提示应该在中间和可见。现在它在某个上方,我必须滚动才能看到它。关于如何克服这个问题的任何想法?

感谢。

我正在使用这样的iframe:

<iframe width="410" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=lt&amp;geocode=&amp;q=s.konarskio+49,+vilnius+adverum&amp;aq=&amp;sll=54.67742,25.249747&amp;sspn=0.036425,0.077162&amp;ie=UTF8&amp;hq=s.konarskio+49,+vilnius+adverum&amp;hnear=&amp;ll=54.67742,25.249747&amp;spn=0.036425,0.077162&amp;t=m&amp;output=embed"></iframe><br /><small><a class="linkedin" href="http://maps.google.com/maps?f=q&amp;source=embed&amp;hl=lt&amp;geocode=&amp;q=s.konarskio+49,+vilnius+adverum&amp;aq=&amp;sll=54.67742,25.249747&amp;sspn=0.036425,0.077162&amp;ie=UTF8&amp;hq=s.konarskio+49,+vilnius+adverum&amp;hnear=&amp;ll=54.67742,25.249747&amp;spn=0.036425,0.077162&amp;t=m" style="color:#0000FF;text-align:left">Didinti &#382;em&#279;lap&#303;</a></small>

2 个答案:

答案 0 :(得分:3)

两个选项:

1)将ll参数(纬度)的第一部分编辑为54.69300,使地图稍微偏低。您可以根据需要调整此值。

<iframe width="410" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=lt&amp;geocode=&amp;q=s.konarskio+49,+vilnius+adverum&amp;aq=&amp;sll=54.67742,25.249747&amp;sspn=0.036425,0.077162&amp;ie=UTF8&amp;hq=s.konarskio+49,+vilnius+adverum&amp;hnear=&amp;ll=54.69300,25.249747&amp;spn=0.036425,0.077162&amp;t=m&amp;output=embed"></iframe>​

2)将&amp;iwloc=0添加到src的末尾。这将默认隐藏气球。

<iframe width="410" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=lt&amp;geocode=&amp;q=s.konarskio+49,+vilnius+adverum&amp;aq=&amp;sll=54.67742,25.249747&amp;sspn=0.036425,0.077162&amp;ie=UTF8&amp;hq=s.konarskio+49,+vilnius+adverum&amp;hnear=&amp;ll=54.67742,25.249747&amp;spn=0.036425,0.077162&amp;t=m&amp;output=embed&amp;iwloc=0"></iframe>

在此处查看这些内容:http://jsfiddle.net/chad/w2zLv/

答案 1 :(得分:1)

使用panTo(latLng:LatLng)和平移地图,以便当前点位于谷歌地图窗口下部的某个位置

@ user1149048

我说你已经使用google maps API了,你需要调整ll param

  

“ll”代表谷歌地图中心的纬度,经度 - 请注意,订单必须先是纬度,然后是经度,它必须是   采用十进制格式。

实施例

  

http://maps.google.com/maps?f=q&source=s_q&hl=lt&geocode=&q=s.konarskio+49,+vilnius+adverum&aq=&sll=54.67742,25.249747&sspn=0.036425,0.077162&ie=UTF8&hq=s.konarskio+49,+vilnius+adverum&hnear=&ll=54.67942,25.259747&spn=0.036425,0.077162&t=m&output=embed

你在联系

  

http://maps.google.com/maps?f=q&source=s_q&hl=lt&geocode=&q=s.konarskio+49,+vilnius+adverum&aq=&sll=54.67742,25.249747&sspn=0.036425,0.077162&ie=UTF8&hq=s.konarskio+49,+vilnius+adverum&hnear=&ll=54.67742,25.249747&spn=0.036425,0.077162&t=m&output=embed

你在哪里获得lat,lng你放在地图上的标记。从这个位置你必须加/减一些小值。