I'm trying to get several markers on a simple google map. I'm using Ionic 3 which use Angular 4.
I'm loading the map like this :
import { Component, ViewChild, ElementRef } from '@angular/core';
import { GoogleMaps } from '@ionic-native/google-maps';
declare var google;
export class SearchResultsPage extends BasePage {
@ViewChild('map') mapElement: ElementRef;
private map: any;
constructor(public navCtrl: NavController, 
            public navParams: NavParams, 
            private translateService: TranslateService,
            private googleMaps: GoogleMaps) {}
  ionViewDidLoad() {
   setTimeout(()=>{
      this.loadMap();
   }, 1000)
  }
  loadMap() {
    let latLng = new google.maps.LatLng(48.8509695, 2.3861870000000636);
    let latLng2 = new google.maps.LatLng(48.8504541, 2.3865487000000485);
    let mapOptions = {
        center: latLng,
        zoom: 15,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    this.map = new google.maps.Map(this.mapElement.nativeElement, mapOptions);    
    var marker = new google.maps.Marker({    
        position: latLng,
        map: this.map,
        title: 'Hello World!'
    },{
        position: latLng2,
        map: this.map,
        title: 'Check the World!'
    });
}
I found this (but doesn't work)
addMarkers(data, callback) {
    var markers = [{
        'position': {
            lat: 48.8513735,
            lng: 2.3861292
        },
        'icon': '#ff0000'
        }];
    function onMarkerAdded(marker) {
        console.log(marker);
        markers.push(marker);
        if (markers.length === data.length) {
            callback(markers);
        } else {
            console.log('in the else');
        }
    }
    data.forEach(function(markerOptions) {
        console.log('in foreach');
        this.map.addMarker(markerOptions, onMarkerAdded);
    });
}
The map is showing, but I don't succeed to add markers.
I tried to follow the official doc (v1 and v2) but it doesn't work. If someone has an idea, thanks by advance. I saw lot of people who try to do the same thing, but every codes are differents..
 
    