Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Marker not centering in iframe for google map

I have bit strange requirement of open google map in iframe. i have address that i use to pass and convert that into google map. but the trouble is the size of my iframe is 200*200 so the marker is not getting centered. and the other problem is the marker infowindow also gets poppedup after few seconds that makes my marker out of the frame boundry.and marker moves from the centere. my code is like this.

$(document).ready(function(){
  $("#map_address").each(function(){   
    var embed ='<iframe class="map_google" width="200" scrolling="no" height="200" frameborder="0" src="https:/maps.google.com/maps?&q=Ahmedabad&output=embed" marginwidth="0" marginheight="0">';
    $(this).html(embed);
  });
});

i want to close the marker info window and make the marker cenetered. any help will be appreciated.

this was created by the use of the http://jsbin.com/welcome/68407/edit

like image 902
Shwet Avatar asked Apr 18 '13 07:04

Shwet


People also ask

How do I center an iframe in Google Maps?

You can simply add text-align: center to the paragraph element that is around the iframe.

How do I center a Google map?

Please go to your map and drag and drop your map to the position you wish. You can also zoom in your map a little bit with mouse wheel or zoom cotrols on the bottom right corner of the map. Please remember to save your map after any changes. Hope that helps.

How do I get a marker position on Google Maps?

You can add a simple marker to the map at a desired location by instantiating the marker class and specifying the position to be marked using latlng, as shown below.


Video Answer


1 Answers

Add an iwloc-parameter without a value to the iframe-URL: http://jsbin.com/emoyup/1/edit

Description of URL-parameters: http://www.seomoz.org/ugc/everything-you-never-wanted-to-know-about-google-maps-parameters

like image 155
Dr.Molle Avatar answered Oct 22 '22 06:10

Dr.Molle