Closed hoetmaaiers closed 2 years ago
What does Partial
mean?
The implementation is the same as everywhere in Leaflet. Only the passed options are overwritten and the others are still available / applied
Then Partial
would make every option optional.
https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype
This would allow me to only provide hideMiddleMarkers
as an option to map.pm.setGlobalOptions
.
@ryan-morris what do you think?
@Falke-Design I agree with the suggestion. it's either that or we need to make all properties on GlobalOptions
allow undefined. I think the Partial<GlobalOptions>
is a cleaner approach
@ryan-morris Thank you, your help is very useful for me!
@hoetmaaiers can you please check if #1168 works for you
When using the function
map.pm.setGlobalOptions
I am obliged to passsnappingOrder
andpanes
.Might it be better to update the typing to:
This depend on the exact implementation of course. But if the new options are applied on top of the default ones I see no problem.