haoliangyu/ngx-leaflet-starter

Need help for integrating leaflet plugin

eskiou opened this issue · 2 comments

Hello,
I'm learning Angular and I'm using your implementation as a sandbox. I'm trying to add leaflet-editable to the project. However, it seems there are conflicts between leaflet and leaflet-editable.

I added leaflet-editable to npm dependencies and the following typings: "leaflet-editable": "github:DefinitelyTyped/DefinitelyTyped/leaflet-editable/leaflet-editable.d.ts"

It throws me errors like:
ERROR in E:\Steven\Documents\Angular\angular2-leaflet\typings\globals\leaflet-editable\index.d.ts
(41,21): error TS2315: Type 'LayerGroup' is not generic.

ERROR in E:\Steven\Documents\Angular\angular2-leaflet\typings\globals\leaflet-editable\index.d.ts
(46,25): error TS2315: Type 'LayerGroup' is not generic.

ERROR in E:\Steven\Documents\Angular\angular2-leaflet\typings\globals\leaflet-editable\index.d.ts
(90,39): error TS2503: Cannot find namespace 'Mixin'.

Anyone can help me?

Thank you very much!

This project is currently using Leaflet 1.0. But the type definition of leaflet-editable is for leaflet 0.7 (see here). Therefore to use leaflet-editable, you have to downgrade to leaflet 0.7.

v1.0.1 is a historical version that used leaflet 0.7:

Thank you for this quick answer! I'll try to write a typings for leaflet-editable 1.0 instead.