zur4ik
zur4ik

Reputation: 6254

Center map on window resize with Google Maps Engine

Trying to put map on my web page from Google's Map Engine service:

<iframe src="http://mapsengine.google.com/map/u/0/embed?mid=zcYcL12izhP0.kBlDVAO1nRr8" width="100%" height="480"></iframe>

How to center map on window resize? - JSFiddle Demo

Upvotes: 1

Views: 1977

Answers (1)

Dr.Molle
Dr.Molle

Reputation: 117334

There is no way to access the document inside the iframe, because it's located on a different domain. Therefore it's not possible to use any API-method to manipulate the map from the parent window.

The only option I see so far is to reload the iframe when the size of the parent window changes(what also changes the size of the iframe)

Demo: http://fiddle.jshell.net/doktormolle/zSHBe/

Upvotes: 2

Related Questions