Hello, I’m trying to integrate the Leaflet Routing Machine in this Ionic Framework, and I’m having the hardest time.
I am trying to use Leaflet Routing Machine to display routing between two points. When I add this to Ionic Framework, it seems lrm is not showing up at all, so when I make the L.Routing.control request, its erroring out because lrm is not adding that extra Routing property to L.
UPDATE
I accidentally found that importing as
import leaflet from ‘leaflet’ as opposed to import L from ‘leaflet’ finally brought the Routing property. I’m so close, but I still can’t define the waypoints property with two location points because it errors out.
I saw that there’s a google maps option based off this post Use Google map to show route and find distance between two point with driving option by using Ionic
but I’m trying to get the Leaflet library to work instead.
All in all, This library works perfectly in just plain React, so I know its not a react issue.
I would LOVE some help in trying to get this implemented
Here is my code sandbox if anyone would like to take a look