{"action":"opened","issue":{"url":"https://api.github.com/repos/angular-ui/angular-google-maps/issues/1646","labels_url":"https://api.github.com/repos/angular-ui/angular-google-maps/issues/1646/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/angular-google-maps/issues/1646/comments","events_url":"https://api.github.com/repos/angular-ui/angular-google-maps/issues/1646/events","html_url":"https://github.com/angular-ui/angular-google-maps/issues/1646","id":120637359,"number":1646,"title":"Multiple markers and center map","user":{"login":"mohammedshafiq","id":6485301,"avatar_url":"https://avatars.githubusercontent.com/u/6485301?v=3","gravatar_id":"","url":"https://api.github.com/users/mohammedshafiq","html_url":"https://github.com/mohammedshafiq","followers_url":"https://api.github.com/users/mohammedshafiq/followers","following_url":"https://api.github.com/users/mohammedshafiq/following{/other_user}","gists_url":"https://api.github.com/users/mohammedshafiq/gists{/gist_id}","starred_url":"https://api.github.com/users/mohammedshafiq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohammedshafiq/subscriptions","organizations_url":"https://api.github.com/users/mohammedshafiq/orgs","repos_url":"https://api.github.com/users/mohammedshafiq/repos","events_url":"https://api.github.com/users/mohammedshafiq/events{/privacy}","received_events_url":"https://api.github.com/users/mohammedshafiq/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-06T14:24:03Z","updated_at":"2015-12-06T14:24:03Z","closed_at":null,"body":"HI,\r\n\r\nI'm sure the answer is quite simple but I've done a search but cannot seem to find it.\r\n\r\nI would like to centre my map based on some given markers on initial load of the map. The map should therefore display all the markers with the correct centre position and zoom level.\r\n\r\nHow can I achieve this?\r\n\r\n```\r\n<ui-gmap-google-map center='map.center' zoom='map.zoom' bounds=\"map.bounds\">\r\n<ui-gmap-marker ng-repeat=\"m in map.markers\" coords=\"m.coords\" icon=\"m.icon\" idkey=\"m.id\">\r\n</ui-gmap-marker>\r\n</ui-gmap-google-map>\r\n```\r\n\r\n```\r\n$scope.map.markers.push({\r\n    id: Date.now(),\r\n    coords: {\r\n    latitude: $scope.placeDetails.geometry.location.lat,\r\n    longitude: $scope.placeDetails.geometry.location.lng\r\n  }\r\n});\r\n```\r\n"}}