Reputation: 21
I'm trying to implement the solution found at Center map on window resize with Google Maps Engine in a Drupal site. The page is here http://dspdesignworks.com/projects/neversummernordic/page/location
I've added the Iframe code to a block and added the JS to the head section however, I get a blank page.
JS code added to head:
window.onresize=function(){ var frame=document.getElementsByTagName('iframe')[0]; frame.setAttribute('src','https://mapsengine.google.com/map/embed?mid=zFhzxVukKcLo.kPyCeTJuW86s'+new Date().getTime()) }
Iframe:
<iframe src="https://mapsengine.google.com/map/embed?mid=zFhzxVukKcLo.kPyCeTJuW86s" height="480" width="1950"></iframe>
Upvotes: 0
Views: 53
Reputation: 21
Sometimes you have to just walk away and then try again. I'm using a module for Drupal called "Add to Head" and apparently, it automatically adds the opening and closing "script" tags. When I removed them from the code, the map showed centered as it should.
Upvotes: 0