Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR TypeError: Cannot read property 'navigateTo' of undefined #13

Open
fatjoni opened this issue Jun 5, 2018 · 0 comments
Open

ERROR TypeError: Cannot read property 'navigateTo' of undefined #13

fatjoni opened this issue Jun 5, 2018 · 0 comments

Comments

@fatjoni
Copy link

fatjoni commented Jun 5, 2018

Hi,

Maybe i am not implementing it the right way,
i have managed to install the plugin as guided. I can show the map and pins on the screen but when i call navigatoTo method i get this: ERROR TypeError: Cannot read property 'navigateTo' of undefined

Here is the whole method.

ionViewDidLoad() {
this.map = L.map("mapi").fitWorld();
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attributions: '',
maxZoom: 18,
id: 'mapbox.streets',
}).addTo(this.map);
this.map.locate({
setView: true,
maxZoom: 10,
enableHighAccaracy: true
}).on('locationfound', (e) => { this.map.directions.navigateTo('41.322223', '19.842798');

  let markerGroup = L.featureGroup();
  let marker: any = L.marker([e.latitude, e.longitude]).on('click', () => {
    marker.bindPopup("Ti je ketu !");
  })
  markerGroup.addLayer(marker);
  this.map.addLayer(markerGroup);
  }).on('locationerror', (err) => {
    alert(err.message);
}); 

}

Best regards,
Fatjoni

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant