From 1d8415a1091ca3d832305f6742cccf6ce0672e20 Mon Sep 17 00:00:00 2001 From: Daniel Lautzenheiser Date: Wed, 14 Jun 2023 09:55:26 -0400 Subject: [PATCH] fix: map widget duplication --- packages/core/dev-test/config.yml | 10 ++++++++++ packages/core/src/widgets/map/withMapControl.tsx | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/core/dev-test/config.yml b/packages/core/dev-test/config.yml index 7a04fe64..e980fe69 100644 --- a/packages/core/dev-test/config.yml +++ b/packages/core/dev-test/config.yml @@ -565,6 +565,16 @@ collections: widget: map pattern: ['\[-([7-9][0-9]|1[0-2][0-9])\.', 'Must be between latitude -70 and -129'] required: false + - name: line_string + label: Line String + type: LineString + widget: map + required: false + - name: polygon + label: Polygon + type: Polygon + widget: map + required: false - name: markdown label: Markdown file: _widgets/markdown.json diff --git a/packages/core/src/widgets/map/withMapControl.tsx b/packages/core/src/widgets/map/withMapControl.tsx index 186b2286..057beae9 100644 --- a/packages/core/src/widgets/map/withMapControl.tsx +++ b/packages/core/src/widgets/map/withMapControl.tsx @@ -38,7 +38,6 @@ interface WithMapControlProps { const withMapControl = ({ getFormat, getMap }: WithMapControlProps = {}) => { const MapControl: FC> = ({ - path, value, field, onChange, @@ -84,7 +83,8 @@ const withMapControl = ({ getFormat, getMap }: WithMapControlProps = {}) => { onChange(format.writeGeometry(geometry, writeOptions)); } }); - }, [disabled, field, mapContainer, onChange, path, value]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); return (