leaflet-geoman: Incorrect TS typings
Hi, I updated to the last version and got couple of new errors:
- setPathOptions should have second argument as optional in TS definition. Also newly added
mergefield is missing - disableDraw accepts
shapeargument. It is optional, but it is still there. I guess the right option is to removeshapefrom the code, not from typings. - I see that there are newly added typings for event handlers. For example, the
layeris nowL.Layer. Are you sure this is the best typings? Because now I cannot usesetStyleortoGeoJSONfunctions without fighting TS
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (10 by maintainers)
Commits related to this issue
- Fix TypeScript Issues. Fixes: #912, Fixes #917 (#915) (patch) * Fix LayerGroup PM property TypeScript * Some type fixes — committed to geoman-io/leaflet-geoman by Falke-Design 3 years ago
- Fix TypeScript Issues. Fixes: #912, Fixes #917 (#915) (patch) * Fix LayerGroup PM property TypeScript * Some type fixes — committed to BaharWeb/leaflet-geoman by Falke-Design 3 years ago
@tirli do you mean like this, but before you didn’t have to typecast polygon?
@Falke-Design is there a specific subset of the types that can be passed into the event handlers as
workingLayer? Unless all of the types thatlayercan be set to have atoGeoJSON()method, you would have to typecast to access more type specific methodsPR for the changes: #915
One more addition I just found:
rotateModeis missing inToolbarOptionsThanks for reporting, we will change 1 and 2.
@ryan-morris can you please answer point 3.