Google Maps API not centering the Marker

后端 未结 2 1471
抹茶落季
抹茶落季 2021-01-19 12:28

I have Google Maps on a website that sets the marker based on an address.

Here\'s an example (click the location tab): http://www.weddinghouse.com.au/wedding-directo

2条回答
  •  北恋
    北恋 (楼主)
    2021-01-19 12:40

    If you load the page in google maps and then click on the "link" function, it gives you code to embed the site as an iFrame instead of messing about with the API- you could try this?

    There is also a bug with this that sometimes the marker is not centered, particularly on a hidden div. My best way to overcome this is to put the iFrame of the google map in a separate file (e.g. pages/map.html) and then to make that the source of the iFrame in your page.

    E.g.- instead of iFrame src="maps.google.com/ etc etc" have it as src="pages/map.html"

    Anyway, this post is 6 months old but better late than never!

提交回复
热议问题