Skip to content

Commit

Permalink
Merge pull request #3771 from ahennr/wfs-hook
Browse files Browse the repository at this point in the history
Feature: Combine WfsSearch and WfsSearchInput to WfsSearchField using `useWfs` hook
  • Loading branch information
ahennr committed Mar 11, 2024
2 parents 5890569 + 347c624 commit bdaef7f
Show file tree
Hide file tree
Showing 15 changed files with 397 additions and 1,564 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -76,7 +76,7 @@
"@fortawesome/react-fontawesome": "^0.2.0",
"@terrestris/base-util": "^1.1.0",
"@terrestris/ol-util": "^14.0.0",
"@terrestris/react-util": "^4.0.0-beta.2",
"@terrestris/react-util": "^4.0.0-beta.3",
"@types/geojson": "^7946.0.12",
"@types/lodash": "^4.14.200",
"ag-grid-community": "^28.2.1",
Expand Down
9 changes: 7 additions & 2 deletions src/Button/MeasureButton/MeasureButton.tsx
Expand Up @@ -2,6 +2,7 @@ import './MeasureButton.less';

import MeasureUtil from '@terrestris/ol-util/dist/MeasureUtil/MeasureUtil';
import {useMap, useOlInteraction, useOlLayer} from '@terrestris/react-util';
import _isNil from 'lodash/isNil';
import OlCollection from 'ol/Collection';
import {Coordinate as OlCoordinate} from 'ol/coordinate';
import OlFeature from 'ol/Feature';
Expand Down Expand Up @@ -503,8 +504,12 @@ export const MeasureButton: FC<MeasureButtonProps> = ({
const onMapClickKey = map?.on('click', onMapClick);

return () => {
unByKey(onDrawStartKey);
unByKey(onDrawEndKey);
if (!_isNil(onDrawStartKey)) {
unByKey(onDrawStartKey);
}
if (!_isNil(onDrawEndKey)) {
unByKey(onDrawEndKey);
}
if (onMapPointerMoveKey) {
unByKey(onMapPointerMoveKey);
}
Expand Down
73 changes: 0 additions & 73 deletions src/Field/WfsSearch/WfsSearch.example.md

This file was deleted.

267 changes: 0 additions & 267 deletions src/Field/WfsSearch/WfsSearch.spec.tsx

This file was deleted.

0 comments on commit bdaef7f

Please sign in to comment.