user1149048
user1149048

Reputation: 39

Is it possible to position inside google maps?

I have this problem for several web sites. I am building this contact page for the site - http://bellated.us.lt/kontaktai-2/ What I want to do is that on load this google maps address tip should be in the middle and visible. Now it is somewhere upper and I have to scroll in order to see it. Any ideas on how to overcome this?

Thanks.

I am using such 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>

Upvotes: 2

Views: 1060

Answers (2)

elrado
elrado

Reputation: 5272

Use panTo(latLng:LatLng) and pan map so that current point will be located somewhere in the lower part of google maps window

@user1149048

I Thaugth that you're usng google maps API in you're case you have to adjust ll param

“ll” stands for Latitude,longitude of a Google Map center – Note that the order has to be latitude first, then longitude and it has to be in decimal format.

EXAMPLE:

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

YOU'RE LINK

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

Where do you get lat,lng of marker that you put on the map. From this position you have to add/subtract some minor value.

Upvotes: 1

Chad von Nau
Chad von Nau

Reputation: 4404

Two options:

1) Edit the first part of the ll parameter (latitude) to be 54.69300, which centers your map slightly lower. You can adjust this value to taste.

<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) Add &amp;iwloc=0 to the end of the src. This will hide the balloon by default.

<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>

See them in action here: http://jsfiddle.net/chad/w2zLv/

Upvotes: 3

Related Questions