Can anyone help?
I cant seem to get google maps to center on the marker. The Map is in pop up that is hidden on load.
If the map is visible on page load everything works fine. but thats not the functionality i'm after.
$scope.$on('displayDealerMap', function() {
$scope.displayModal = mySharedService.message;
dealerLatLng = {
lat: mySharedService.location.lat,
lng: mySharedService.location.lng
};
var center = new google.maps.LatLng(dealerLatLng);
var map_options = {
zoom: 13,
center: center
};
// create map
var map = new google.maps.Map(document.getElementById('myMap'), map_options);
var marker = new google.maps.Marker({
position: dealerLatLng,
map: map
});
$timeout(function(){
google.maps.event.trigger(map, 'resize');
},100);
});