I'm used to include in my projects simple Leaflet plugins, for example "Zoomslider",
where the files to use are just "
Zoomslider.css" and "
Zoomslider.js":
<link rel="stylesheet" href="src/plugins/L.Control.Zoomslider.css">
<script src="src/plugins/L.Control.Zoomslider.js"></script>
<script> var ctlZoomslider;
....
ctlZoomslider = L.control.zoomslider({position:'topright'}).addTo(mymap); </script>
However, I'm having problems in adding leaflet-measure. I have tried the following (just a copy of the above code):
<link rel="stylesheet" href="src/plugins/leaflet-measure.scss">
<script src="src/plugins/leaflet-measure.js"></script>
<script>
var ctlMeasure;
....
ctlMeasure = L.control.measure();
ctlMeasure.addTo(myMap);
</script>
But it doesn't work, and I get the following error messages in the browser console:
http://localhost/src/plugins/leaflet-measure.scss net::ERR_ABORTED 404 (Not Found)
Uncaught SyntaxError: Cannot use import statement outside a module (at leaflet-measure.js:1:1)
Any suggestions to overcome this issue would be very much appreciated.