hello guys, i am new with ionic and i am building an app which has a google map templete with multiple markers.How can i redirect the infowindows to different templetes of the app?here is my code.i hve see some solutions but nothing is working
.controller(âRdmCtrlâ, function($scope, $state, $cordovaGeolocation) {
var options = {timeout: 10000, enableHighAccuracy: true};
$cordovaGeolocation.getCurrentPosition(options).then(function(position){
var latLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
var locations = [
['Porto Studios', 38.1521374,23.2270006, 6],
['Mellisa Hotel', 38.0450982,23.5390992, 5],
['Elefsina Hotel' , 38.048490, 23.540285, 4],
['ÎΚδĎΝΚον Hotel', 38.1659738,23.336649, 3],
['ÎÎľĎĎĎΚ Hotel', 38.1678945,23.3292679, 2],
['Here I Am', position.coords.latitude, position.coords.longitude, 1]
];
var map = new google.maps.Map(document.getElementById(âmap1â), {
zoom: 16,
center: latLng,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var infowindow = new google.maps.InfoWindow();
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}
}, function(error){
alert(âCould not get your current location!Enable the location service and restart the application!â);
});
})
thanks in advance!!