{"action":"created","issue":{"url":"https://api.github.com/repos/objectivehtml/Google-Maps-for-Craft/issues/40","labels_url":"https://api.github.com/repos/objectivehtml/Google-Maps-for-Craft/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/objectivehtml/Google-Maps-for-Craft/issues/40/comments","events_url":"https://api.github.com/repos/objectivehtml/Google-Maps-for-Craft/issues/40/events","html_url":"https://github.com/objectivehtml/Google-Maps-for-Craft/issues/40","id":71559368,"number":40,"title":"Keep map centred when browser window size changes","user":{"login":"katrinkerber","id":818635,"avatar_url":"https://avatars.githubusercontent.com/u/818635?v=3","gravatar_id":"","url":"https://api.github.com/users/katrinkerber","html_url":"https://github.com/katrinkerber","followers_url":"https://api.github.com/users/katrinkerber/followers","following_url":"https://api.github.com/users/katrinkerber/following{/other_user}","gists_url":"https://api.github.com/users/katrinkerber/gists{/gist_id}","starred_url":"https://api.github.com/users/katrinkerber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katrinkerber/subscriptions","organizations_url":"https://api.github.com/users/katrinkerber/orgs","repos_url":"https://api.github.com/users/katrinkerber/repos","events_url":"https://api.github.com/users/katrinkerber/events{/privacy}","received_events_url":"https://api.github.com/users/katrinkerber/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-28T11:15:41Z","updated_at":"2016-01-21T01:03:15Z","closed_at":"2016-01-21T01:03:14Z","body":"What's the best way to make use of [this solution](http://hsmoore.com/keep-google-map-v3-centered-when-browser-is-resized/), which keeps the map centred when the browser window size changes?"},"comment":{"url":"https://api.github.com/repos/objectivehtml/Google-Maps-for-Craft/issues/comments/173417377","html_url":"https://github.com/objectivehtml/Google-Maps-for-Craft/issues/40#issuecomment-173417377","issue_url":"https://api.github.com/repos/objectivehtml/Google-Maps-for-Craft/issues/40","id":173417377,"user":{"login":"objectivehtml","id":685027,"avatar_url":"https://avatars.githubusercontent.com/u/685027?v=3","gravatar_id":"","url":"https://api.github.com/users/objectivehtml","html_url":"https://github.com/objectivehtml","followers_url":"https://api.github.com/users/objectivehtml/followers","following_url":"https://api.github.com/users/objectivehtml/following{/other_user}","gists_url":"https://api.github.com/users/objectivehtml/gists{/gist_id}","starred_url":"https://api.github.com/users/objectivehtml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/objectivehtml/subscriptions","organizations_url":"https://api.github.com/users/objectivehtml/orgs","repos_url":"https://api.github.com/users/objectivehtml/repos","events_url":"https://api.github.com/users/objectivehtml/events{/privacy}","received_events_url":"https://api.github.com/users/objectivehtml/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T01:03:14Z","updated_at":"2016-01-21T01:03:14Z","body":"I know this is super old, but I ended up having some health issues and didn't work most of last year. I'm back now though and figured I would post the solution to this for future reference.\r\n\r\n\t{% set options = {\r\n\t\tid: 'map', \r\n\t\twidth: '100%', \r\n\t\theight: '100%',\r\n\t\tcenter: 'The Florida Keys'\r\n\t} %}\r\n\r\n\t{{ craft.googleMaps.map(options) }}\r\n\r\n\t<script type=\"text/javascript\">\r\n\t\tvar mapCenter;\r\n\r\n\t\twindow.onload = function() {\r\n\t\t\tmapCenter = map.getCenter();\r\n\t\t};\r\n\t\t\r\n\t\twindow.onresize = function(e) {\r\n\t\t\tmap.setCenter(mapCenter.lat(), mapCenter.lng());\r\n\t\t};\r\n\r\n\t</script>"}}