user5134138
user5134138

Reputation:

open page on marker click using leaflet and ionic 2

I created map in ionic 2 using leaflet library. And also added marker

enter image description here

let marker = L.marker([47.561495, 7.592376]).addTo(this.map);

My question is how can I open page on marker click.

I am doing something like this.

marker.on('click', this.onMarkerClicked);
...

onMarkerClicked() {
   this.navCtrl.push(SomePage);
}

But it gives following error.

enter image description here

Upvotes: 0

Views: 844

Answers (1)

raj
raj

Reputation: 6094

Did you try marker.on('click', ()=> {this.onMarkerClicked()});

Upvotes: 3

Related Questions