Leaflet.Canvas-Markers icon indicating copy to clipboard operation
Leaflet.Canvas-Markers copied to clipboard

Error in Angular 6 app with canvasIconLayer function

Open jcabannes opened this issue 7 years ago • 2 comments
trafficstars

I am using Leaflet.Canvas-Markers in an Angular 6 app working with leaflet 1.3.1 and I get the following error : ERROR TypeError: leaflet__WEBPACK_IMPORTED_MODULE_5___default.a.canvasIconLayer is not a function

I imported leaflet.canvas-markers.js file in angular.json script field.

jcabannes avatar Aug 16 '18 12:08 jcabannes

I use successfully by doing

import 'leaflet-canvas-marker/dist/leaflet.canvas-markers.js';

in the file where I am using the library after I have imported leaflet.

deeg avatar Sep 12 '18 20:09 deeg

I found the same problem here. when I use Single Page Apps. this plugin does not work and produces Uncaught TypeError: L.canvasIconLayer is not a function

even though I have added

<script src = 'assets / map / canvas-markers / leaflet.canvas-markers.js'> </ script>

in my header. but the bug still exists.

for the file leaflet.canvas-markers.js I took it from the source Link

but when I try to change the contents of the file from "eaflet.canvas-markers.js" with the source in: Link

perfect, bugs have been resolved. I wonder why developers make the same 2 files with different contents. and this complicates us.

But I thank you very much for the developer of this plugin that makes my work become lighter and faster. Hopefully, this can help many people.

aacassandra avatar Sep 18 '18 01:09 aacassandra