You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Argument of type 'CachedTileLayer' is not assignable to parameter of type 'Layer'.
Types of property 'addTo' are incompatible.
Type '(map: Map | LayerGroup<any>) => CachedTileLayer' is not assignable to type '(map: Map | LayerGroup<any>) => Layer'.
Types of parameters 'map' and 'map' are incompatible.
Type 'L.Map | L.LayerGroup<any>' is not assignable to type 'import("/Users/martin/Desktop/projects/metservice-consumer-web/node_modules/@yaga/leaflet-cached-...'.
Type 'Map' is not assignable to type 'Map | LayerGroup<any>'.
Type 'Map' is not assignable to type 'LayerGroup<any>'.
Property 'toGeoJSON' is missing in type 'Map'.
I also tried to create a LayerGroup and adding the CachedTileLayer but got the same thing.
I noticed we have different versions of leaflet types (I'm on ^1.2.7), but there does not seem to be a difference in the methods signature.
I'm not sure what I'm doing wrong, but I'm not being capable of getting this to work. I'm sure it must be something really silly, but if you could give me a hand that'd be great.
Thanks.
Cheers!
The text was updated successfully, but these errors were encountered:
loqtor
changed the title
Could not use this with Typescript
How to have this type of layer added to a Leaflet map?
Jan 29, 2019
Hi,
When trying to use the
CachedTileLayer
by:And:
I'm getting this error:
I also tried to create a
LayerGroup
and adding theCachedTileLayer
but got the same thing.I noticed we have different versions of leaflet types (I'm on
^1.2.7
), but there does not seem to be a difference in the methods signature.I'm not sure what I'm doing wrong, but I'm not being capable of getting this to work. I'm sure it must be something really silly, but if you could give me a hand that'd be great.
Thanks.
Cheers!
The text was updated successfully, but these errors were encountered: