@eeacms/volto-eea-map 4.1.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/package.json +5 -2
- package/src/Arcgis/Editor/Editor.jsx +130 -0
- package/src/Arcgis/Editor/EditorContext.jsx +2 -0
- package/src/Arcgis/Editor/Fold/Fold.jsx +56 -0
- package/src/Arcgis/Editor/Panels/Panel.jsx +8 -0
- package/src/Arcgis/Editor/Panels/SettingsGeneralPanel.jsx +217 -0
- package/src/Arcgis/Editor/Panels/SettingsLayersPanel.jsx +216 -0
- package/src/Arcgis/Editor/Panels/StructureBaseLayerPanel.jsx +60 -0
- package/src/Arcgis/Editor/Panels/StructureLayersPanel.jsx +394 -0
- package/src/Arcgis/Editor/Panels/StructureWidgetsPanel.jsx +181 -0
- package/src/Arcgis/Editor/Panels/index.js +6 -0
- package/src/Arcgis/Editor/SidebarGroup.jsx +62 -0
- package/src/Arcgis/Layer/Layer.jsx +247 -0
- package/src/Arcgis/Map/Map.jsx +287 -0
- package/src/Arcgis/Map/MapBuilder.jsx +111 -0
- package/src/Arcgis/Map/MapContext.jsx +3 -0
- package/src/Arcgis/Widget/Widget.jsx +170 -0
- package/src/Arcgis/helpers.js +140 -0
- package/src/Blocks/EmbedEEAMap/Edit.jsx +40 -0
- package/src/Blocks/EmbedEEAMap/View.jsx +122 -0
- package/src/Blocks/EmbedEEAMap/helpers.js +12 -0
- package/src/Blocks/EmbedEEAMap/schema.js +126 -0
- package/src/{components → Toolbar}/Share.jsx +1 -1
- package/src/{components/ExtraViews.jsx → Toolbar/Toolbar.jsx} +14 -16
- package/src/{components/visualization → Views}/VisualizationView.jsx +8 -9
- package/src/Widgets/ArcgisColorPickerWidget.jsx +95 -0
- package/src/Widgets/ArcgisRendererWidget/ArcgisRendererWidget.jsx +106 -0
- package/src/Widgets/ArcgisRendererWidget/RendererEditor/ClassBreaks.jsx +8 -0
- package/src/Widgets/ArcgisRendererWidget/RendererEditor/Dictionary.jsx +8 -0
- package/src/Widgets/ArcgisRendererWidget/RendererEditor/DotDensity.jsx +8 -0
- package/src/Widgets/ArcgisRendererWidget/RendererEditor/Heatmap.jsx +8 -0
- package/src/Widgets/ArcgisRendererWidget/RendererEditor/PieChart.jsx +8 -0
- package/src/Widgets/ArcgisRendererWidget/RendererEditor/Simple.jsx +109 -0
- package/src/Widgets/ArcgisRendererWidget/RendererEditor/UniqueValue.jsx +8 -0
- package/src/Widgets/ArcgisRendererWidget/RendererEditor/_Editor.jsx +29 -0
- package/src/Widgets/ArcgisRendererWidget/RendererEditor/_EditorModal.jsx +88 -0
- package/src/Widgets/ArcgisRendererWidget/RendererEditor/_defaults.js +30 -0
- package/src/Widgets/ArcgisSliderWidget.jsx +79 -0
- package/src/Widgets/ArcgisViewpointWidget.jsx +112 -0
- package/src/{components/visualization → Widgets}/VisualizationViewWidget.jsx +9 -10
- package/src/Widgets/VisualizationWidget.jsx +200 -0
- package/src/arcgis.js +48 -0
- package/src/constants.js +225 -7
- package/src/hocs/withArcgis.jsx +27 -0
- package/src/hooks/useChangedProps.jsx +24 -0
- package/src/hooks/useClass.jsx +17 -0
- package/src/hooks/useCopyToClipboard.jsx +25 -0
- package/src/index.js +16 -16
- package/src/jsoneditor.js +72 -0
- package/src/styles/editor.less +446 -0
- package/src/styles/map.less +3 -0
- package/src/components/Blocks/EmbedEEAMap/Edit.jsx +0 -161
- package/src/components/Blocks/EmbedEEAMap/Schema.js +0 -161
- package/src/components/Blocks/EmbedEEAMap/View.jsx +0 -79
- package/src/components/Blocks/EmbedEEAMap/helpers.js +0 -45
- package/src/components/LegendView.jsx +0 -150
- package/src/components/Webmap.jsx +0 -371
- package/src/components/index.js +0 -6
- package/src/components/visualization/VisualizationEditorWidget.jsx +0 -122
- package/src/components/visualization/panelsSchema.js +0 -229
- package/src/components/widgets/DataQueryWidget.jsx +0 -51
- package/src/components/widgets/LayerSelectWidget.jsx +0 -463
- package/src/components/widgets/LayersPanelWidget.jsx +0 -59
- package/src/components/widgets/SimpleColorPickerWidget.jsx +0 -121
- package/src/hocs/index.js +0 -3
- package/src/hocs/withDeviceSize.jsx +0 -45
- package/src/less/global.less +0 -253
- package/src/less/variables.less +0 -5
- package/src/utils.js +0 -151
- /package/src/{components → Toolbar}/FigureNote.jsx +0 -0
- /package/src/{components → Toolbar}/MoreInfoLink.jsx +0 -0
- /package/src/{components → Toolbar}/Sources.jsx +0 -0
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import { base_layers } from '../../constants';
|
|
2
|
-
|
|
3
|
-
const customBaselayers = [
|
|
4
|
-
['positron-composite', 'positron-composite'],
|
|
5
|
-
['blossom-composite', 'blossom-composite'],
|
|
6
|
-
];
|
|
7
|
-
|
|
8
|
-
const BaseLayerSchema = ({ data = {} }) => {
|
|
9
|
-
const useCustomBase = data?.map_data?.base?.use_custom_base;
|
|
10
|
-
return {
|
|
11
|
-
title: 'Base Layer',
|
|
12
|
-
fieldsets: [
|
|
13
|
-
{
|
|
14
|
-
id: 'base',
|
|
15
|
-
title: 'Base Layer',
|
|
16
|
-
fields: [
|
|
17
|
-
'use_custom_base',
|
|
18
|
-
...(useCustomBase ? ['custom_base_layer'] : ['base_layer']),
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
properties: {
|
|
23
|
-
use_custom_base: {
|
|
24
|
-
title: 'Use custom Base Layer',
|
|
25
|
-
description:
|
|
26
|
-
'Switch between default base layers and defining your custom service base layer',
|
|
27
|
-
type: 'boolean',
|
|
28
|
-
},
|
|
29
|
-
base_layer: {
|
|
30
|
-
title: 'Base Layer',
|
|
31
|
-
choices: [...customBaselayers, ...base_layers],
|
|
32
|
-
},
|
|
33
|
-
custom_base_layer: {
|
|
34
|
-
title: 'Base Layer',
|
|
35
|
-
description:
|
|
36
|
-
'Add an URL Template to import your own base layer from an external service',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
required: [],
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const LayerSchema = {
|
|
44
|
-
title: 'Layer',
|
|
45
|
-
fieldsets: [
|
|
46
|
-
{
|
|
47
|
-
id: 'default',
|
|
48
|
-
title: 'Layer',
|
|
49
|
-
fields: ['map_layer'],
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
properties: {
|
|
53
|
-
map_layer: {
|
|
54
|
-
title: 'Map layer configuration',
|
|
55
|
-
widget: 'map_layers_widget',
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
required: [],
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const MapLayersSchema = {
|
|
62
|
-
title: 'Map Layers',
|
|
63
|
-
fieldsets: [
|
|
64
|
-
{
|
|
65
|
-
id: 'default',
|
|
66
|
-
title: 'Map Data',
|
|
67
|
-
fields: ['map_layers'],
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
properties: {
|
|
71
|
-
map_layers: {
|
|
72
|
-
title: 'Map Layers',
|
|
73
|
-
description: 'Add/Edit Map Layers',
|
|
74
|
-
widget: 'object_list',
|
|
75
|
-
schema: LayerSchema,
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
required: [],
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
//style changes work only for Feature layers atm
|
|
82
|
-
// TODO: apply style for individual layers
|
|
83
|
-
const StylesLayersSchema = ({ data = {} }) => {
|
|
84
|
-
return {
|
|
85
|
-
title: 'Styles Layers',
|
|
86
|
-
fieldsets: [
|
|
87
|
-
{
|
|
88
|
-
id: 'default',
|
|
89
|
-
title: 'Map Data',
|
|
90
|
-
fields: [
|
|
91
|
-
'override_styles',
|
|
92
|
-
...(data?.map_data?.styles?.override_styles
|
|
93
|
-
? ['symbol_color', 'outline_color', 'outline_width']
|
|
94
|
-
: []),
|
|
95
|
-
],
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
properties: {
|
|
99
|
-
override_styles: {
|
|
100
|
-
title: 'Override layers style',
|
|
101
|
-
description: 'Will override imported layers styling',
|
|
102
|
-
type: 'boolean',
|
|
103
|
-
},
|
|
104
|
-
symbol_color: {
|
|
105
|
-
title: 'Fill color',
|
|
106
|
-
widget: 'simple_color_picker_widget',
|
|
107
|
-
},
|
|
108
|
-
outline_color: {
|
|
109
|
-
title: 'Outline color',
|
|
110
|
-
widget: 'simple_color_picker_widget',
|
|
111
|
-
},
|
|
112
|
-
outline_width: {
|
|
113
|
-
title: 'Outline width',
|
|
114
|
-
type: 'number',
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
required: [],
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
const GeneralSchema = ({ data = {} }) => {
|
|
122
|
-
const centerOnExtent = data?.map_data?.general?.centerOnExtent;
|
|
123
|
-
|
|
124
|
-
return {
|
|
125
|
-
title: 'General',
|
|
126
|
-
fieldsets: [
|
|
127
|
-
{
|
|
128
|
-
id: 'default',
|
|
129
|
-
title: 'Zoom',
|
|
130
|
-
fields: [
|
|
131
|
-
'print_position',
|
|
132
|
-
'zoom_position',
|
|
133
|
-
'scalebar',
|
|
134
|
-
'centerOnExtent',
|
|
135
|
-
...(!centerOnExtent ? ['zoom_level', 'long', 'lat'] : []),
|
|
136
|
-
],
|
|
137
|
-
},
|
|
138
|
-
],
|
|
139
|
-
properties: {
|
|
140
|
-
centerOnExtent: {
|
|
141
|
-
title: 'Center on extent',
|
|
142
|
-
type: 'boolean',
|
|
143
|
-
description:
|
|
144
|
-
'This will override latitude/longitude/zoom level and will lock zoom/moving the map.',
|
|
145
|
-
},
|
|
146
|
-
scalebar: {
|
|
147
|
-
title: 'Scalebar',
|
|
148
|
-
choices: ['metric', 'non-metric', 'dual'].map((n) => {
|
|
149
|
-
return [n, n];
|
|
150
|
-
}),
|
|
151
|
-
},
|
|
152
|
-
zoom_position: {
|
|
153
|
-
title: 'Zoom position',
|
|
154
|
-
choices: ['bottom-right', 'bottom-left', 'top-right', 'top-left'].map(
|
|
155
|
-
(n) => {
|
|
156
|
-
return [n, n];
|
|
157
|
-
},
|
|
158
|
-
),
|
|
159
|
-
},
|
|
160
|
-
zoom_level: {
|
|
161
|
-
title: 'Zoom level',
|
|
162
|
-
type: 'number',
|
|
163
|
-
},
|
|
164
|
-
long: {
|
|
165
|
-
title: 'Longitude',
|
|
166
|
-
type: 'number',
|
|
167
|
-
description: `Will set the map center long coordinate. See: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center`,
|
|
168
|
-
},
|
|
169
|
-
lat: {
|
|
170
|
-
title: 'Latitude',
|
|
171
|
-
type: 'number',
|
|
172
|
-
description: `Will set the map center lat coordinate. See: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center`,
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
print_position: {
|
|
176
|
-
title: 'Print position',
|
|
177
|
-
choices: ['bottom-right', 'bottom-left', 'top-right', 'top-left'].map(
|
|
178
|
-
(n) => {
|
|
179
|
-
return [n, n];
|
|
180
|
-
},
|
|
181
|
-
),
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
required: [],
|
|
185
|
-
};
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
const PanelsSchema = ({ data = {} }) => {
|
|
189
|
-
const generalSchema = GeneralSchema({ data });
|
|
190
|
-
const baseLayerSchema = BaseLayerSchema({ data });
|
|
191
|
-
const stylesLayerSchema = StylesLayersSchema({ data });
|
|
192
|
-
return {
|
|
193
|
-
title: 'Map Editor',
|
|
194
|
-
fieldsets: [
|
|
195
|
-
{
|
|
196
|
-
id: 'default',
|
|
197
|
-
title: 'Map Editor Sections',
|
|
198
|
-
fields: ['map_data'],
|
|
199
|
-
},
|
|
200
|
-
],
|
|
201
|
-
properties: {
|
|
202
|
-
map_data: {
|
|
203
|
-
title: 'Panels',
|
|
204
|
-
widget: 'object_types_widget',
|
|
205
|
-
schemas: [
|
|
206
|
-
{
|
|
207
|
-
id: 'general',
|
|
208
|
-
schema: generalSchema,
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
id: 'base',
|
|
212
|
-
schema: baseLayerSchema,
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
id: 'layers',
|
|
216
|
-
schema: MapLayersSchema,
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
id: 'styles',
|
|
220
|
-
schema: stylesLayerSchema,
|
|
221
|
-
},
|
|
222
|
-
],
|
|
223
|
-
},
|
|
224
|
-
},
|
|
225
|
-
required: [],
|
|
226
|
-
};
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
export default PanelsSchema;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormFieldWrapper, Field } from '@plone/volto/components';
|
|
3
|
-
import { Accordion, Segment } from 'semantic-ui-react';
|
|
4
|
-
|
|
5
|
-
const DataQueryWidget = (props) => {
|
|
6
|
-
const { value, onChange, id } = props;
|
|
7
|
-
|
|
8
|
-
const onChangeAlias = (fieldId, fieldValue) => {
|
|
9
|
-
let altValue = value;
|
|
10
|
-
value[fieldId] = { ...value[fieldId], alias: fieldValue };
|
|
11
|
-
onChange(id, altValue);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<div>
|
|
16
|
-
<FormFieldWrapper {...props} noForInFieldLabel></FormFieldWrapper>
|
|
17
|
-
<div className="data-query-widget-field">
|
|
18
|
-
{value && value.length > 0 ? (
|
|
19
|
-
value.map((param, i) => (
|
|
20
|
-
<Accordion
|
|
21
|
-
key={i}
|
|
22
|
-
fluid
|
|
23
|
-
styled
|
|
24
|
-
style={{ border: '1px solid lightgray', marginBottom: '15px' }}
|
|
25
|
-
>
|
|
26
|
-
<Accordion.Content active={true}>
|
|
27
|
-
<Segment>
|
|
28
|
-
<p className="data-param-title">
|
|
29
|
-
<strong>{param?.i}:</strong>{' '}
|
|
30
|
-
{param?.v && param.v.join(', ')}
|
|
31
|
-
</p>
|
|
32
|
-
<Field
|
|
33
|
-
id={i}
|
|
34
|
-
title="Map to"
|
|
35
|
-
type="string"
|
|
36
|
-
onChange={onChangeAlias}
|
|
37
|
-
value={param?.alias}
|
|
38
|
-
/>
|
|
39
|
-
</Segment>
|
|
40
|
-
</Accordion.Content>
|
|
41
|
-
</Accordion>
|
|
42
|
-
))
|
|
43
|
-
) : (
|
|
44
|
-
<p style={{ textAlign: 'center' }}>No parameters set</p>
|
|
45
|
-
)}
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export default DataQueryWidget;
|