I am trying to implement a google map in my ionic app.
I am able to dynamically generate markers, but can't seem to bind infowindows.
$scope.arrayOfMarkers = [];
for (var i = 0 ; i < results.length ; i++) {
var user = results[i];
var mySID = JSON.parse(window.localStorage.getItem("userObject")).userProfileId;
if (user.userProfileId != mySID) {
var userCoords = {
latitude: user.userProfileLatitude,
longitude: user.userProfileLongitude
};
var markerOptions = {
animation: "drop"
}
var thisMarker = {
id:i,
coords: userCoords,
options: markerOptions,
idKey: i,
window: {
show: false,
title: "Test"
}
}
$scope.arrayOfMarkers.push(thisMarker);
}
}
HTML
<ui-gmap-google-map id="map" center="map.center" zoom="map.zoom">
<ui-gmap-marker ng-repeat="marker in arrayOfMarkers" coords="marker.coords" options="marker.options" events="marker.events" idkey="marker.id" window="marker.window">
</ui-gmap-marker>
</ui-gmap-google-map>
When I click the markers nothing happens. How should I be implementing window?
arrayOfMarkersto the scope$scope$scope.arrayOfMarkers = arrayOfMarkers;