-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathStyleBuilderTool.input.schema.ts
More file actions
336 lines (318 loc) · 10.2 KB
/
Copy pathStyleBuilderTool.input.schema.ts
File metadata and controls
336 lines (318 loc) · 10.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
// Copyright (c) Mapbox, Inc.
// Licensed under the MIT License.
import { z } from 'zod';
const LayerConfigSchema = z.object({
layer_type: z
.string()
.describe(
'Layer type from the resource (e.g., "water", "railways", "parks")'
),
render_type: z
.enum([
'fill',
'line',
'symbol',
'circle',
'fill-extrusion',
'heatmap',
'auto'
])
.optional()
.default('auto')
.describe(
'How to render this layer visually. Default "auto" chooses based on geometry type.\n' +
'Override to achieve specific visual effects:\n' +
'• "line" - For outlines, borders, strokes (e.g., building outlines, road borders)\n' +
'• "fill" - For solid filled areas (e.g., solid color buildings, water bodies)\n' +
'• "fill-extrusion" - For 3D extrusions (e.g., 3D buildings)\n' +
'• "symbol" - For text labels or icons\n' +
'• "circle" - For dot visualization (e.g., POI dots, data points)\n' +
'• "heatmap" - For density maps (points only)\n' +
'IMPORTANT: Use "line" for outlines even on polygon features like buildings.'
),
action: z
.enum(['show', 'hide', 'color', 'highlight'])
.describe('What to do with this layer'),
color: z
.string()
.optional()
.describe('Color value if action is "color" or "highlight"'),
opacity: z.number().min(0).max(1).optional().describe('Opacity value'),
width: z
.number()
.optional()
.describe('Width for line layers or outline thickness'),
filter: z
.union([
z.string(),
z.number(),
z.boolean(),
z.array(z.unknown()),
z.record(z.string(), z.unknown())
])
.optional()
.describe('Custom filter expression'),
// Comprehensive property-based filtering
filter_properties: z
.record(
z.string(),
z.union([
z.string(),
z.number(),
z.boolean(),
z.array(z.union([z.string(), z.number(), z.boolean()]))
])
)
.optional()
.describe(
'Filter by specific properties. Examples: ' +
'{ class: "motorway" } for only motorways, ' +
'{ class: ["motorway", "trunk"] } for multiple road types, ' +
'{ structure: "bridge" } for only bridges, ' +
'{ admin_level: 0, disputed: "false" } for undisputed country boundaries'
),
// Expression-based styling
zoom_based: z.boolean().optional().describe('Make styling zoom-dependent'),
min_zoom: z
.number()
.min(0)
.max(24)
.optional()
.describe('Minimum zoom level for zoom-based styling'),
max_zoom: z
.number()
.min(0)
.max(24)
.optional()
.describe('Maximum zoom level for zoom-based styling'),
// Data-driven styling
property_based: z
.string()
.optional()
.describe('Feature property to base styling on (e.g., "class", "type")'),
property_values: z
.record(z.string(), z.union([z.string(), z.number()]))
.optional()
.describe('Map of property values to styles'),
// Advanced expressions
expression: z
.union([
z.string(),
z.number(),
z.boolean(),
z.array(z.unknown()),
z.record(z.string(), z.unknown())
])
.optional()
.describe('Custom Mapbox expression for advanced styling'),
// Slot for Standard styles
slot: z
.enum(['bottom', 'middle', 'top'])
.optional()
.describe(
'Layer slot for Mapbox Standard styles. Controls layer stacking order. ' +
'Bottom: below most map features, Middle: between base and labels, Top: above all base map features (default)'
)
});
export const StyleBuilderToolSchema = z.object({
style_name: z.string().default('Custom Style').describe('Name for the style'),
base_style: z
.enum([
'standard',
'streets-v12',
'light-v11',
'dark-v11',
'satellite-v9',
'satellite-streets-v12',
'outdoors-v12',
'navigation-day-v1',
'navigation-night-v1'
])
.default('standard')
.describe(
'Base style template. ALWAYS use "standard" as the default for all new styles. ' +
'Standard style provides the best performance and modern features. ' +
'Only use Classic styles (streets/light/dark/satellite/outdoors/navigation) when explicitly requested with "create a classic style" or when working with an existing Classic style.'
),
layers: z
.array(LayerConfigSchema)
.describe('Layer configurations based on the mapbox-style-layers resource'),
global_settings: z
.object({
background_color: z.string().optional().describe('Background/land color'),
label_color: z.string().optional().describe('Default label color'),
mode: z.enum(['light', 'dark']).optional().describe('Light or dark mode')
})
.optional()
.describe('Global style settings'),
standard_config: z
.object({
// Boolean configuration properties
showPedestrianRoads: z
.boolean()
.optional()
.describe(
'Show/hide the base pedestrian roads and paths from the Standard style'
),
showPlaceLabels: z
.boolean()
.optional()
.describe(
'Show/hide the base place label layers from the Standard style'
),
showPointOfInterestLabels: z
.boolean()
.optional()
.describe(
'Show/hide the base POI icons and text from the Standard style'
),
showRoadLabels: z
.boolean()
.optional()
.describe(
'Show/hide the base road labels and shields from the Standard style'
),
showTransitLabels: z
.boolean()
.optional()
.describe(
'Show/hide the base transit icons and text from the Standard style'
),
show3dObjects: z
.boolean()
.optional()
.describe(
'Show/hide the base 3D objects like buildings and landmarks from the Standard style'
),
showLandmarkIcons: z
.boolean()
.optional()
.describe('Show/hide the base landmark icons from the Standard style'),
showLandmarkIconLabels: z
.boolean()
.optional()
.describe(
'Show/hide the base landmark icon labels from the Standard style'
),
showAdminBoundaries: z
.boolean()
.optional()
.describe(
'Show/hide the base administrative boundaries from the Standard style'
),
showRoadsAndTransit: z
.boolean()
.optional()
.describe(
'Show/hide the base roads and transit networks from the Standard style (Standard-Satellite)'
),
// String configuration properties
theme: z
.enum(['default', 'faded', 'monochrome', 'custom'])
.optional()
.describe('Theme for the base Standard style layers'),
'theme-data': z
.string()
.optional()
.describe('Custom color theme for the base style via Base64 LUT image'),
lightPreset: z
.enum(['dusk', 'dawn', 'day', 'night'])
.optional()
.describe('Time-of-day lighting for the base Standard style'),
font: z
.string()
.optional()
.describe('Font family for the base Standard style text'),
colorModePointOfInterestLabels: z
.string()
.optional()
.describe('Color mode for the base POI labels'),
backgroundPointOfInterestLabels: z
.string()
.optional()
.describe('Background style for the base POI labels'),
// Numeric configuration properties
densityPointOfInterestLabels: z
.number()
.min(1)
.max(5)
.optional()
.describe('Density of base POI labels (1-5, default 3)'),
// Color override properties
colorPlaceLabels: z
.string()
.optional()
.describe('Override color for the base place labels in Standard style'),
colorRoadLabels: z
.string()
.optional()
.describe('Override color for the base road labels in Standard style'),
colorGreenspace: z
.string()
.optional()
.describe(
'Override color for the base greenspace areas in Standard style'
),
colorWater: z
.string()
.optional()
.describe(
'Override color for the base water features in Standard style'
),
colorAdminBoundaries: z
.string()
.optional()
.describe(
'Override color for the base administrative boundaries in Standard style'
),
colorPointOfInterestLabels: z
.string()
.optional()
.describe('Override color for the base POI labels in Standard style'),
colorMotorways: z
.string()
.optional()
.describe(
'Override color for the base motorways/highways in Standard style'
),
colorTrunks: z
.string()
.optional()
.describe('Override color for the base trunk roads in Standard style'),
colorRoads: z
.string()
.optional()
.describe(
'Override color for the base regular roads in Standard style'
),
colorBuildingHighlight: z
.string()
.optional()
.describe(
'Override color for the base highlighted buildings in Standard style'
),
colorBuildingSelect: z
.string()
.optional()
.describe(
'Override color for the base selected buildings in Standard style'
),
colorPlaceLabelHighlight: z
.string()
.optional()
.describe(
'Override color for the base highlighted place labels in Standard style'
),
colorPlaceLabelSelect: z
.string()
.optional()
.describe(
'Override color for the base selected place labels in Standard style'
)
})
.optional()
.describe(
'Configuration for the base Mapbox Standard style. These properties customize the underlying Standard style features - you can still add your own custom layers on top using the layers parameter. The Standard style provides a rich basemap that you can configure and enhance with additional layers.'
)
});
export type StyleBuilderToolInput = z.infer<typeof StyleBuilderToolSchema>;