Last active
October 28, 2016 12:42
-
-
Save magnificode/6113759 to your computer and use it in GitHub Desktop.
Google maps snippet to keep the center centered on window resize
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
google.maps.event.addDomListener(window, 'resize', function() { | |
map.setCenter(YOUR_LAT_LONG_VAR_HERE); | |
}); |
this will work:
var latlng = new google.maps.LatLng(lat, lng);
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A bit of explanation for
YOUR_LAT_LONG_VAR_HERE
will be nice.