AngularJS Google Map con múltiples marcadores
Actualmente estoy desarrollando un proyecto de Ionic Framework (AngularJS) que utiliza Geo Location y Google Maps para mostrar la posición del usuario.
Estoy tratando de mostrar la ubicación geográfica de los usuarios y varios marcadores alrededor del área.
Tengo la ubicación geográfica funcionando, pero parece que no puedo agregar varios marcadores.
Localizaciones
var markers = [
{'London Eye, London', 51.503454,-0.119562},
{'Palace of Westminster, London', 51.499633,-0.124755}
];
Controller.JS
// 1. Google Map //
FCCAppCtrl.controller('MapController', function($scope, $ionicLoading) {
$scope.initialise = function() {
var myLatlng = new google.maps.LatLng(37.3000, -120.4833);
var mapOptions = {
center: myLatlng,
zoom: 16,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map"), mapOptions);
navigator.geolocation.getCurrentPosition(function(pos) {
map.setCenter(new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude));
var myLocation = new google.maps.Marker({
position: new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude),
map: map,
animation: google.maps.Animation.DROP,
title: "My Location"
});
});
$scope.map = map;
};
google.maps.event.addDomListener(document.getElementById("map"), 'load', $scope.initialise());
});