leaflet-elevation icon indicating copy to clipboard operation
leaflet-elevation copied to clipboard

How can I import the leaflet-elevation. js file offline in a Vue project

Open InstantWindy opened this issue 1 year ago • 1 comments

Hi!I want to use the L.control. elevation function in the Vue project by introducing the eaflet-elevation. js file. Here is my citation method

2

But I found that the following errors may occur. 1

Does it still need to import files like distance.js ?

InstantWindy avatar Aug 09 '24 09:08 InstantWindy

Hi @InstantWindy,

I found that the following errors may occur. 1

Be aware, It looks like you are trying to develop without http server (ie. I don't know how much this mode is supported).

Does it still need to import files like distance.js ?

Yes, otherwise you just need a L.Control.Elevation.Speed (and the others/used handlers) within the global scope:

https://github.com/Raruto/leaflet-elevation/blob/bd9316bd1b7e7784b3bf3d812960eaa808ad94d6/src/control.js#L750-L764

Here's a fairly complete example:

https://github.com/Raruto/leaflet-elevation/blob/bd9316bd1b7e7784b3bf3d812960eaa808ad94d6/examples/leaflet-elevation_extended-ui.html#L42-L221

https://github.com/Raruto/leaflet-elevation/blob/bd9316bd1b7e7784b3bf3d812960eaa808ad94d6/examples/leaflet-elevation_extended-ui.html#L253-L271

👋 Raruto

Raruto avatar Aug 19 '24 05:08 Raruto