The main premise here is to provide a more generalised way to validate drawn features. This allows developers using Terra Draw to define their own custom logic for validating drawn features.
It also aligns the validateFeature function with this new validate option for all built in modes. We centralise around the idea of Validations which are essentially predicate functions. validateFeature will now also run the validate function passed as part of any call to it (i.e. via addFeatures).
It attempts to add comprehensive tests and docs to accommodate for the changes.
Link to Issue
256
PR Checklist
[x] There is a associated GitHub issue
[x] If I have added significant code changes, there are relevant tests
[x] If there are behaviour changes these are documented
Description of Changes
The main premise here is to provide a more generalised way to validate drawn features. This allows developers using Terra Draw to define their own custom logic for validating drawn features.
It also aligns the
validateFeature
function with this newvalidate
option for all built in modes. We centralise around the idea ofValidations
which are essentially predicate functions.validateFeature
will now also run thevalidate
function passed as part of any call to it (i.e. viaaddFeatures
).It attempts to add comprehensive tests and docs to accommodate for the changes.
Link to Issue
256
PR Checklist