Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class 'LayerGroup<P>' incorrectly extends base class 'Layer' #912

Closed
luismiguelprs opened this issue May 18, 2021 · 4 comments
Closed

Class 'LayerGroup<P>' incorrectly extends base class 'Layer' #912

luismiguelprs opened this issue May 18, 2021 · 4 comments
Labels

Comments

@luismiguelprs
Copy link

Hi, I'm getting this error on angular build process using leaflet + leaflet-geoman-free.

ERROR in node_modules/@types/leaflet/index.d.ts:1087:14 - error TS2415: Class 'LayerGroup<P>' incorrectly extends base class 'Layer'.
  Types of property 'pm' are incompatible.
    Type 'PMLayerGroup' is missing the following properties from type 'PMLayer': getShape, enableRotate, disableRotate, rotateEnabled, and 8 more.

1087 export class LayerGroup<P = any> extends Layer {
                  ~~~~~~~~~~
node_modules/@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.d.ts:32:15 - error TS2430: Interface 'LayerGroup<P>' incorrectly extends interface 'Layer'.

32     interface LayerGroup {
                 ~~~~~~~~~~

Package versions:

"@geoman-io/leaflet-geoman-free": "^2.11.1"
"leaflet": "^1.7.1"
"@types/leaflet": "^1.7.0"

@Falke-Design
Copy link
Collaborator

Thanks for reporting this issue, we are on it.

@ryan-morris is there a way to fix this localy? A workaround until we release a new version.

@ryan-morris
Copy link
Contributor

ryan-morris commented May 18, 2021

I had to keep my project pinned at version 2.10.0 for the same reason. Outside of that, adding "skipLibCheck": true to tsconfig.json under compilerOptions, but I believe that will apply to all *.d.ts in node_modules.

I did not see a quick option solution to the problem root problem (diff pm on Layer and LayerGroup). In a similar way to #893 the @types/leaflet inheritance complicates making 2 different types for same property name on Layer and LayerGroup since LayerGroup inherits from Layer. I'm still looking into options though

@luismiguelprs
Copy link
Author

Thanks @ryan-morris... I think the "skipLibCheck": true will resolve my problem for now..

@Falke-Design
Copy link
Collaborator

#915 Should fix this issue

BaharWeb pushed a commit to BaharWeb/leaflet-geoman that referenced this issue Jun 14, 2021
…man-io#915) (patch)

* Fix LayerGroup PM property TypeScript

* Some type fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants