Last active
August 29, 2015 14:14
-
-
Save wholypantalones/c37f89ad438f17f347a5 to your computer and use it in GitHub Desktop.
Get and fit the mutha f**king bounds of things on a google map
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
| /* | |
| mutha f**king angular-google-maps | |
| http://angular-ui.github.io/angular-google-maps/#!/api | |
| */ | |
| $scope.findSquare = function(index) { | |
| var boundaryLatLng = new google.maps.LatLngBounds(), | |
| thisBounds = []; | |
| // or do a forEach here for multiples | |
| thisBounds.push( | |
| { | |
| name:"dunno", | |
| latlng: new google.maps.LatLng(northLatitude,northLongitude) | |
| },{ | |
| name:"dunno", | |
| latlng: new google.maps.LatLng(southLatitude,southLongitude) | |
| } | |
| ); | |
| for (var i = 0; i < thisBounds.length; i++) { | |
| boundaryLatLng.extend(thisBounds[i].latlng); | |
| } | |
| $scope.mapInstance.fitBounds(boundaryLatLng); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment