I connect so
<script src='//maps.googleapis.com/maps/api/js?sensor=false'></script> I write this in the controller
var locations = [ ['loan 1', 55.787004, 37.102659, 'address 1'] ]; function initialize() { var myOptions = { center: new google.maps.LatLng(33.890542, 151.274856), zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map"), myOptions); setMarkers(map, locations) } function setMarkers(map, locations) { var marker, i for (i = 0; i < locations.length; i++) { var loan = locations[i][0] var lat = locations[i][1] var long = locations[i][2] var add = locations[i][3] latlngset = new google.maps.LatLng(lat, long); var marker = new google.maps.Marker({ map: map, title: loan, position: latlngset }); map.setCenter(marker.getPosition()) var content = "Loan Number: " + loan + '</h3>' + "Address: " + add var infowindow = new google.maps.InfoWindow() google.maps.event.addListener(marker, 'click', (function (marker, content, infowindow) { return function () { infowindow.setContent(content); infowindow.open(map, marker); }; })(marker, content, infowindow)); } } initialize(); I get this picture
There are no errors, added such a thing
$timeout(function () { initialize(); }.bind(this), 5000); And the map is loaded. Probably you need to clarify that the card is on the 2nd hidden tab, even with a timer while waiting more than 5 seconds and switching to the tab, I get the same unloaded map. In general, I set the initialization of the card to the tab open function and it works =)
Now, if someone else suggested how to update the map on the button
