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: L.Routing.openrouteservice is not a constructor #4

Open
fahmisaad opened this issue Aug 8, 2019 · 1 comment
Open

Comments

@fahmisaad
Copy link

fahmisaad commented Aug 8, 2019

Hi,

i try using your library into my project which is using ionic framewrok. but i got this error

ERROR TypeError: L.Routing.openrouteservice is not a constructor

when i run the app.
i already include your library into my project and i can confirm that the location of the library can be access by the project. May i know how to solve this issue? already stuck at this issue nearly 3 days.
Below are my code:
` this.mymap = L.map("mapid").setView([3.101984, 101.598002], 13);

L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  attribution: '© OpenStreetMap contributors and ORS'
}).addTo(this.mymap);

var control = L.Routing.control({
  waypoints: [
    L.latLng(3.102739, 101.598077),
    L.latLng(3.101861, 101.599037)
  ],
  router: new L.Routing.openrouteservice('5b3ce3597851110001cf6248e3cd48b3c44c4e529f8fac67408d4257')
  // routeWhileDragging: true
}).addTo(this.mymap);` 

Thanks.

@fapdash
Copy link

fapdash commented Oct 31, 2019

The error message shows up when the library hasn't been loaded.

I don't know how you handle dependencies in your project but I had this problem when I tried to include the library directly from GitHub (FF blocked the request because GH didn't send the proper MIME info or something).
Once I saved the lib to disk and loaded it from there it worked.

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

2 participants