Multiple Google Maps Marker with data from firebase

Hi there,
I currently working on setting multiple Google maps Markers with addresses from firebase.
But I’m really confused about getting/ looping through the data from firebase the right way and to use it for the markers then.

My datastructure in firebase is:


  • food key
    |__ address
    |__ some other data …
  • food key
    |__ address
    |__ some other data …

I’m using native geocoder to translate the addresses in lat and long

That’s my code so far:

    selector: 'page-maps',
    templateUrl: 'maps.html'
export class MapsPage {

    @ViewChild('map') mapElement;
    map: any;
    public currentLocation;
    public foodLocations;
    public address; 

    public getAddresses: Array<any>;

    constructor(public navCtrl: NavController,
        public foodlistdataProvider: FoodlistdataProvider,
        public geolocation: Geolocation,
        public nativeGeocoder: NativeGeocoder) {

    ionViewDidEnter() {

    initMap() {
        this.geolocation.getCurrentPosition().then((position) => {
            let LatLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);

            this.currentLocation = LatLng;

            let mapOptions = {
                center: LatLng,
                zoom: 15,
                navigationControl: true,
                mapTypeId: google.maps.MapTypeId.ROADMAP
   = new google.maps.Map(this.mapElement.nativeElement, mapOptions);


        }, (error) => {


    addMarkerCurrentPosition() {

        let marker = new google.maps.Marker({
            position: this.currentLocation,

    getAddressdata() {

//is this the right way to get the address data?
        this.foodlistdataProvider.getAddresses().on('value', snapshot => {
           this.address = snapshot.val().address



    addFoodAddresses(markers) {

        for (let marker of markers) {
                .then((coordinates: NativeGeocoderForwardResult) => {
                    let Address = new google.maps.LatLng(markers.coordinates.latitude, markers.coordinates.longitude);

                    let marker = new google.maps.Marker({
                        position: Address,

I’m stucked and would really appricate some help! cheers

did someone answer this ? i have the same problem