Native map markers problem


#1

Hey all,
I’m trying to implement native google maps in my ionic 2 project but i get an error to set markers clickable.
this is my code to draw markers:

         for (var i = 0; i < mapMarkers.length; i++) {
                var centerMarker = mapMarkers[i];
                 let location = new GoogleMapsLatLng(centerMarker.lat, centerMarker.long);
                let MarkerDetails = centerMarker.name ;
                let markerOptions = {
                  position: location, title: MarkerDetails ,snippet:centerMarker.distance , icon:this._MapService.markerImg
               };
     this.map.addMarker(markerOptions)
                  .then( (marker: GoogleMapsMarker) => {
                    console.log('centerMarker.ID'+centerMarker.ID)
                     marker.addEventListener(GoogleMapsEvent.INFO_CLICK).subscribe(
                        ()=>{
                            this.navToCenter(centerMarker.ID);
                        }
                    );
                });
            }  

it appears on the map but my problem here is
this.navToCenter(centerMarker.ID);
always go to the last marker.


#2

did you solve yours i also have the same problem


#3

No, I’m still trying


#4

any one can help us with this ???