fix: map widget duplication

This commit is contained in:
Daniel Lautzenheiser 2023-06-14 09:55:26 -04:00
parent 7b4a8ac376
commit 1d8415a109
2 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -38,7 +38,6 @@ interface WithMapControlProps {
const withMapControl = ({ getFormat, getMap }: WithMapControlProps = {}) => {
const MapControl: FC<WidgetControlProps<string, MapField>> = ({
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 (
<Field