@eeacms/volto-eea-map 0.1.34 → 1.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.
@@ -1,151 +0,0 @@
1
- import { base_layers } from '../../constants';
2
-
3
- const BaseLayerSchema = {
4
- title: 'Base Layer',
5
- fieldsets: [
6
- {
7
- id: 'base',
8
- title: 'Base Layer',
9
- fields: ['base_layer'],
10
- },
11
- ],
12
- properties: {
13
- base_layer: {
14
- title: 'Base Layer',
15
- choices: base_layers,
16
- },
17
- },
18
- required: [],
19
- };
20
-
21
- const LayerSchema = {
22
- title: 'Layer',
23
- fieldsets: [
24
- {
25
- id: 'default',
26
- title: 'Layer',
27
- fields: ['map_layer'],
28
- },
29
- ],
30
- properties: {
31
- map_layer: {
32
- title: 'Map layer configuration',
33
- widget: 'map_layers_widget',
34
- },
35
- },
36
- required: [],
37
- };
38
-
39
- const MapLayersSchema = {
40
- title: 'Map Layers',
41
- fieldsets: [
42
- {
43
- id: 'default',
44
- title: 'Map Data',
45
- fields: ['map_layers'],
46
- },
47
- ],
48
- properties: {
49
- map_layers: {
50
- title: 'Map Layers',
51
- description: 'Add/Edit Map Layers',
52
- widget: 'object_list',
53
- schema: LayerSchema,
54
- },
55
- },
56
- required: [],
57
- };
58
-
59
- const GeneralSchema = ({ data = {} }) => {
60
- const centerOnExtent = data?.map_data?.general?.centerOnExtent;
61
-
62
- return {
63
- title: 'General',
64
- fieldsets: [
65
- {
66
- id: 'default',
67
- title: 'Zoom',
68
- fields: [
69
- 'print_position',
70
- 'zoom_position',
71
- 'centerOnExtent',
72
- ...(!centerOnExtent ? ['zoom_level', 'long', 'lat'] : []),
73
- ],
74
- },
75
- ],
76
- properties: {
77
- centerOnExtent: {
78
- title: 'Center on extent',
79
- type: 'boolean',
80
- description:
81
- 'This will override latitude/longitude/zoom level and will lock zoom/moving the map.',
82
- },
83
- zoom_position: {
84
- title: 'Zoom position',
85
- choices: ['bottom-right', 'bottom-left', 'top-right', 'top-left'].map(
86
- (n) => {
87
- return [n, n];
88
- },
89
- ),
90
- },
91
- zoom_level: {
92
- title: 'Zoom level',
93
- type: 'number',
94
- },
95
- long: {
96
- title: 'Longitude',
97
- type: 'number',
98
- },
99
- lat: {
100
- title: 'Latitude',
101
- type: 'number',
102
- },
103
-
104
- print_position: {
105
- title: 'Print position',
106
- choices: ['bottom-right', 'bottom-left', 'top-right', 'top-left'].map(
107
- (n) => {
108
- return [n, n];
109
- },
110
- ),
111
- },
112
- },
113
- required: [],
114
- };
115
- };
116
-
117
- export default ({ data = {} }) => {
118
- const generalSchema = GeneralSchema({ data });
119
-
120
- return {
121
- title: 'Map Editor',
122
- fieldsets: [
123
- {
124
- id: 'default',
125
- title: 'Map Editor Sections',
126
- fields: ['map_data'],
127
- },
128
- ],
129
- properties: {
130
- map_data: {
131
- title: 'Panels',
132
- widget: 'object_types_widget',
133
- schemas: [
134
- {
135
- id: 'general',
136
- schema: generalSchema,
137
- },
138
- {
139
- id: 'base',
140
- schema: BaseLayerSchema,
141
- },
142
- {
143
- id: 'layers',
144
- schema: MapLayersSchema,
145
- },
146
- ],
147
- },
148
- },
149
- required: [],
150
- };
151
- };