From 5d0b6e32017011d93d5b0931293a5aed9f20d599 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Sat, 21 Oct 2023 18:33:46 -0400 Subject: [PATCH] Revert "Revert "Added checkbox for cluster attribute (#810)"" This reverts commit 52f949e152d629a366726d647a35889951a4bd88. --- src/components/ModalSources.jsx | 1 + src/components/ModalSourcesTypeEditor.jsx | 39 +++++++++++++++-------- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/components/ModalSources.jsx b/src/components/ModalSources.jsx index 022c47d0..d6c1e788 100644 --- a/src/components/ModalSources.jsx +++ b/src/components/ModalSources.jsx @@ -128,6 +128,7 @@ class AddSource extends React.Component { } case 'geojson_json': return { type: 'geojson', + cluster: source.cluster || false, data: {} } case 'tilejson_vector': return { diff --git a/src/components/ModalSourcesTypeEditor.jsx b/src/components/ModalSourcesTypeEditor.jsx index 4b77f401..ba6ebf12 100644 --- a/src/components/ModalSourcesTypeEditor.jsx +++ b/src/components/ModalSourcesTypeEditor.jsx @@ -8,6 +8,7 @@ import FieldSelect from './FieldSelect' import FieldDynamicArray from './FieldDynamicArray' import FieldArray from './FieldArray' import FieldJson from './FieldJson' +import FieldCheckbox from './FieldCheckbox' class TileJSONSourceEditor extends React.Component { @@ -80,7 +81,7 @@ class TileURLSourceEditor extends React.Component { })} /> {this.props.children} - + } } @@ -205,23 +206,35 @@ class GeoJSONSourceFieldJsonEditor extends React.Component { } render() { - return - { + return
+ + { + this.props.onChange({ + ...this.props.source, + data, + }) + }} + /> + + { this.props.onChange({ ...this.props.source, - data, + cluster: cluster, }) }} /> - +
} }