Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Error in Angular 6 app with canvasIconLayer function #18

Open
jcabannes opened this issue Aug 16, 2018 · 2 comments
Open

Error in Angular 6 app with canvasIconLayer function #18

jcabannes opened this issue Aug 16, 2018 · 2 comments

Comments

@jcabannes
Copy link

jcabannes commented Aug 16, 2018

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.

@deeg
Copy link

deeg commented Sep 12, 2018

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.

@aacassandra
Copy link

aacassandra commented Sep 18, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants