Вы можете передать широту и долготу на контуре маркера. Это полный рабочий код отображения нескольких маркеров на карте
loadMap(lat,long){
let latLng = new google.maps.LatLng(lat, long);
let mapOptions = {
center: latLng,
zoom: 10,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
this.map = new google.maps.Map(this.mapElement.nativeElement, mapOptions);
var locations = [
['Sola', 23.0793864, 72.4921529],
['Shayona City', 23.0801729, 72.5360598],
['Axis Bank', 23.0808999, 72.5321389],
];
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: this.map
});
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(this.map, marker);
}
})(marker, i));
this.addMarker(this.map);
}
}
addMarker(map:any){
let marker = new google.maps.Marker({
map: map,
animation: google.maps.Animation.DROP,
position: map.getCenter(),
draggable: true
});
let content = "<h4>You are here</h4>";
this.addInfoWindow(marker, content);
}
addInfoWindow(marker, content) {
let infoWindow = new google.maps.InfoWindow({
content: content
});
google.maps.event.addListener(marker, 'click', () => {
infoWindow.open(this.map, marker);
});
google.maps.event.addListener(marker, 'dragend', function (event) {
console.log( this.getPosition().lat());
console.log( this.getPosition().lng());
});
}