Here is an example developed with angular.
Link project: link
App:
var app = angular.module("GoogleMapsCustom", ["uiGmapgoogle-maps"]);
Controller:
app.controller("GoogleMapsCustomController", function($scope) {
$scope.map = { center: { latitude: -23.586172, longitude: -46.657085 }, zoom: 10};
$scope.map.randomMarkers = [];
var adressOfCustomer = [
["BAZAR BARAO LTDA ME", "AV.JOAO XXIII,84-V.FORMOSA, SP"],
["MAGAZINE BELEZA CENTER LTDA", "AV DOS IGARAPES, 1571, SP"],
["ESTACIONAMENTO CARREIRA LTDA ME", "AV.SAPOPEMBA,3016 SAPOPEMBA, SP"],
["LUIS GONZAGA GARDINALI ME", "R.FREI CANECA,22 - CENTRO, SP"],
["A R NETTO", "R.ANTONIO GONCALVES TEIXEIRA, 53, SP"],
["O DONEGA MOJI MIRIM ", "R.BUTANTA, 17-PINHEIROS, SP"],
["MAGAZINE MISS ELEGAN LTDA", "R GOVERNADOR PEDRO DE TOLEDO 1021, SP"],
["O.Y.OKI & CIA.LTDA ", "R.JOSE BONIFACIO,60, SP"]
];
$scope.setMarkers = function(numberOfMarkers) {
setLatitudeAndLongitudeByAdress(adressOfCustomer, $scope.map);
};
$scope.onMarkerClicked = function(marker){
marker.showWindow = true;
$scope.$apply();
};
});
app.controller("InfoController", function($scope) {
$scope.templateValue = 'hello from the template itself';
$scope.clickedButtonInWindow = function() {
var msg = 'clicked a window in the template!';
$log.info(msg);
alert(msg);
}
});
function setLatitudeAndLongitudeByAdress(adressOfCustomer, map){
var geocoder = new google.maps.Geocoder();
angular.forEach(adressOfCustomer, function(value, key) {
var adress = value[1];
geocoder.geocode({ 'address': adress + ', Brasil', 'region': 'BR' }, function (results, status) {
var latitude = results[0].geometry.location.lat();
var longitude = results[0].geometry.location.lng();
var customer = value[0];
var itemMap = {
latitude : latitude,
longitude : longitude,
title : customer,
id : key,
adress : adress,
date : "10/11/2015"
};
map.randomMarkers.push(itemMap);
});
});
}
function init(){
var adressOfCustomer = [
["BAZAR BARAO LTDA ME", "AV.JOAO XXIII,84-V.FORMOSA, SP"],
["MAGAZINE BELEZA CENTER LTDA", "AV DOS IGARAPES, 1571, SP"],
["ESTACIONAMENTO CARREIRA LTDA ME", "AV.SAPOPEMBA,3016 SAPOPEMBA, SP"],
["LUIS GONZAGA GARDINALI ME", "R.FREI CANECA,22 - CENTRO, SP"],
["A R NETTO", "R.ANTONIO GONCALVES TEIXEIRA, 53, SP"],
["O DONEGA MOJI MIRIM ", "R.BUTANTA, 17-PINHEIROS, SP"],
["MAGAZINE MISS ELEGAN LTDA", "R GOVERNADOR PEDRO DE TOLEDO 1021, SP"],
["O.Y.OKI & CIA.LTDA ", "R.JOSE BONIFACIO,60, SP"]
];
var locationOfCustomer = getLatitudeAndLongitudeByAdress(adressOfCustomer);
initializeMaps(locationOfCustomer);
}
Index.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Google Maps API v3: Busca de endereço e Autocomplete - Demo</title>
<link rel="stylesheet" type="text/css" href="assets/css/custom.css">
</head>
<body ng-app="GoogleMapsCustom">
<h1>Google Maps Multiple Marker Demo 123</h1>
<div ng-controller="GoogleMapsCustomController" ng-init="setMarkers();">
<ui-gmap-google-map center="map.center" zoom="map.zoom"> <ui-gmap-markers models="map.randomMarkers" coords="'self'" icon="'icon'" click="onMarkerClicked" doCluster="map.doClusterRandomMarkers"
clusterOptions="map.clusterOptions" modelsbyref="true">
<ui-gmap-windows show="'showWindow'" closeClick="'closeClick'" ng-cloak>
<div>
<p ng-non-bindable>{{title}} - endereço: {{adress}} visita: {{date}}<button type='button'>Incluir na Agenda</button></p>
</div>
</ui-gmap-windows>
</ui-gmap-markers>
</ui-gmap-google-map>
</div>
</body>
</html>