@maplibre-yaml/core 0.1.2 → 0.1.3-beta.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/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +101 -1
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +101 -1
- package/dist/index.js.map +1 -1
- package/dist/{map-renderer-DOLO9y-3.d.ts → map-renderer-IvxniEQy.d.ts} +72 -2
- package/dist/{page.schema-CzdCyPFI.d.ts → page.schema-VBytF9l5.d.ts} +544 -6
- package/dist/register.browser.js +101 -1
- package/dist/register.browser.js.map +1 -1
- package/dist/register.d.ts +2 -2
- package/dist/register.js +101 -1
- package/dist/register.js.map +1 -1
- package/dist/schemas/index.d.ts +2 -483
- package/dist/schemas/index.js +3 -1
- package/dist/schemas/index.js.map +1 -1
- package/package.json +1 -1
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export {
|
|
2
|
+
export { k as BackgroundLayerSchema, B as BaseLayerPropertiesSchema, O as Block, G as BlockSchema, y as Chapter, z as ChapterAction, v as ChapterActionSchema, A as ChapterLayers, w as ChapterLayersSchema, x as ChapterSchema, e as CircleLayerSchema, p as ControlPosition, n as ControlPositionSchema, q as ControlsConfig, C as ControlsConfigSchema, i as FillExtrusionLayerSchema, F as FillLayerSchema, T as GlobalConfig, K as GlobalConfigSchema, H as HeatmapLayerSchema, j as HillshadeLayerSchema, I as InteractiveConfigSchema, m as LayerOrReferenceSchema, l as LayerReferenceSchema, L as LayerSchema, r as LegendConfig, a as LegendConfigSchema, d as LegendItemSchema, f as LineLayerSchema, t as MapBlock, M as MapBlockSchema, s as MapConfig, b as MapConfigSchema, u as MapFullPageBlock, o as MapFullPageBlockSchema, N as MixedBlock, E as MixedBlockSchema, Q as Page, J as PageSchema, c as PopupContentItemSchema, P as PopupContentSchema, h as RasterLayerSchema, U as RootConfig, R as RootSchema, D as ScrollytellingBlock, S as ScrollytellingBlockSchema, g as SymbolLayerSchema } from '../page.schema-VBytF9l5.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @file Base schemas for maplibre-yaml
|
|
@@ -2260,485 +2260,4 @@ declare const ContentBlockSchema: z.ZodObject<{
|
|
|
2260
2260
|
className?: string | undefined;
|
|
2261
2261
|
}>;
|
|
2262
2262
|
|
|
2263
|
-
|
|
2264
|
-
* @file Scrollytelling schemas for maplibre-yaml
|
|
2265
|
-
* @module @maplibre-yaml/core/schemas/scrollytelling
|
|
2266
|
-
*
|
|
2267
|
-
* @description
|
|
2268
|
-
* Zod schemas for narrative scrollytelling maps with chapters, animations,
|
|
2269
|
-
* and layer transitions.
|
|
2270
|
-
*
|
|
2271
|
-
* @example
|
|
2272
|
-
* ```typescript
|
|
2273
|
-
* import { ScrollytellingBlockSchema, ChapterSchema } from '@maplibre-yaml/core/schemas';
|
|
2274
|
-
* ```
|
|
2275
|
-
*/
|
|
2276
|
-
|
|
2277
|
-
/**
|
|
2278
|
-
* Chapter action for map state changes.
|
|
2279
|
-
*
|
|
2280
|
-
* @remarks
|
|
2281
|
-
* Actions are triggered when entering or exiting a chapter.
|
|
2282
|
-
* They can modify layer properties, filters, or trigger animations.
|
|
2283
|
-
*
|
|
2284
|
-
* **Action Types:**
|
|
2285
|
-
* - `setFilter` - Update layer filter
|
|
2286
|
-
* - `setPaintProperty` - Update layer paint property
|
|
2287
|
-
* - `setLayoutProperty` - Update layer layout property
|
|
2288
|
-
* - `flyTo` - Fly to location (handled by chapter config)
|
|
2289
|
-
* - `easeTo` - Ease to location (handled by chapter config)
|
|
2290
|
-
* - `fitBounds` - Fit to bounds
|
|
2291
|
-
* - `custom` - Custom action (handled by application)
|
|
2292
|
-
*
|
|
2293
|
-
* @example Set Filter
|
|
2294
|
-
* ```yaml
|
|
2295
|
-
* onChapterEnter:
|
|
2296
|
-
* - action: setFilter
|
|
2297
|
-
* layer: earthquakes
|
|
2298
|
-
* filter: [">=", ["get", "magnitude"], 5]
|
|
2299
|
-
* ```
|
|
2300
|
-
*
|
|
2301
|
-
* @example Set Paint Property
|
|
2302
|
-
* ```yaml
|
|
2303
|
-
* onChapterEnter:
|
|
2304
|
-
* - action: setPaintProperty
|
|
2305
|
-
* layer: buildings
|
|
2306
|
-
* property: fill-extrusion-height
|
|
2307
|
-
* value: ["get", "height"]
|
|
2308
|
-
* ```
|
|
2309
|
-
*
|
|
2310
|
-
* @example Fit Bounds
|
|
2311
|
-
* ```yaml
|
|
2312
|
-
* onChapterEnter:
|
|
2313
|
-
* - action: fitBounds
|
|
2314
|
-
* bounds: [-74.3, 40.5, -73.7, 40.9]
|
|
2315
|
-
* options:
|
|
2316
|
-
* padding: 50
|
|
2317
|
-
* duration: 1000
|
|
2318
|
-
* ```
|
|
2319
|
-
*/
|
|
2320
|
-
declare const ChapterActionSchema: z.ZodObject<{
|
|
2321
|
-
action: z.ZodEnum<["setFilter", "setPaintProperty", "setLayoutProperty", "flyTo", "easeTo", "fitBounds", "custom"]>;
|
|
2322
|
-
layer: z.ZodOptional<z.ZodString>;
|
|
2323
|
-
property: z.ZodOptional<z.ZodString>;
|
|
2324
|
-
value: z.ZodOptional<z.ZodAny>;
|
|
2325
|
-
filter: z.ZodOptional<z.ZodNullable<z.ZodType<any[], z.ZodTypeDef, any[]>>>;
|
|
2326
|
-
bounds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
2327
|
-
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
2328
|
-
}, "strip", z.ZodTypeAny, {
|
|
2329
|
-
action: "custom" | "flyTo" | "setFilter" | "setPaintProperty" | "setLayoutProperty" | "easeTo" | "fitBounds";
|
|
2330
|
-
value?: any;
|
|
2331
|
-
filter?: any[] | null | undefined;
|
|
2332
|
-
options?: Record<string, any> | undefined;
|
|
2333
|
-
bounds?: number[] | undefined;
|
|
2334
|
-
property?: string | undefined;
|
|
2335
|
-
layer?: string | undefined;
|
|
2336
|
-
}, {
|
|
2337
|
-
action: "custom" | "flyTo" | "setFilter" | "setPaintProperty" | "setLayoutProperty" | "easeTo" | "fitBounds";
|
|
2338
|
-
value?: any;
|
|
2339
|
-
filter?: any[] | null | undefined;
|
|
2340
|
-
options?: Record<string, any> | undefined;
|
|
2341
|
-
bounds?: number[] | undefined;
|
|
2342
|
-
property?: string | undefined;
|
|
2343
|
-
layer?: string | undefined;
|
|
2344
|
-
}>;
|
|
2345
|
-
/**
|
|
2346
|
-
* Chapter layer visibility configuration.
|
|
2347
|
-
*
|
|
2348
|
-
* @remarks
|
|
2349
|
-
* Controls which layers are visible during this chapter.
|
|
2350
|
-
*
|
|
2351
|
-
* @example
|
|
2352
|
-
* ```yaml
|
|
2353
|
-
* layers:
|
|
2354
|
-
* show:
|
|
2355
|
-
* - earthquakes
|
|
2356
|
-
* - fault-lines
|
|
2357
|
-
* hide:
|
|
2358
|
-
* - buildings
|
|
2359
|
-
* ```
|
|
2360
|
-
*/
|
|
2361
|
-
declare const ChapterLayersSchema: z.ZodObject<{
|
|
2362
|
-
show: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
2363
|
-
hide: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
2364
|
-
}, "strip", z.ZodTypeAny, {
|
|
2365
|
-
show: string[];
|
|
2366
|
-
hide: string[];
|
|
2367
|
-
}, {
|
|
2368
|
-
show?: string[] | undefined;
|
|
2369
|
-
hide?: string[] | undefined;
|
|
2370
|
-
}>;
|
|
2371
|
-
/**
|
|
2372
|
-
* Scrollytelling chapter.
|
|
2373
|
-
*
|
|
2374
|
-
* @remarks
|
|
2375
|
-
* A chapter represents one section of the scrollytelling narrative.
|
|
2376
|
-
* As the user scrolls, the map transitions between chapters with
|
|
2377
|
-
* camera animations and layer changes.
|
|
2378
|
-
*
|
|
2379
|
-
* **Required:**
|
|
2380
|
-
* - `id` - Unique chapter identifier
|
|
2381
|
-
* - `title` - Chapter title
|
|
2382
|
-
* - `center` - Map center for this chapter
|
|
2383
|
-
* - `zoom` - Zoom level for this chapter
|
|
2384
|
-
*
|
|
2385
|
-
* **Content:**
|
|
2386
|
-
* - `description` - HTML description (supports markdown)
|
|
2387
|
-
* - `image` - Hero image URL
|
|
2388
|
-
* - `video` - Video URL
|
|
2389
|
-
*
|
|
2390
|
-
* **Camera:**
|
|
2391
|
-
* - `pitch` - Camera tilt (0-85)
|
|
2392
|
-
* - `bearing` - Camera rotation (-180 to 180)
|
|
2393
|
-
* - `animation` - Animation type (flyTo, easeTo, jumpTo)
|
|
2394
|
-
* - `speed`, `curve` - Animation parameters
|
|
2395
|
-
*
|
|
2396
|
-
* **Layout:**
|
|
2397
|
-
* - `alignment` - Content position (left, right, center, full)
|
|
2398
|
-
* - `hidden` - Hide chapter content (map-only)
|
|
2399
|
-
*
|
|
2400
|
-
* **Interactivity:**
|
|
2401
|
-
* - `layers` - Show/hide layers
|
|
2402
|
-
* - `onChapterEnter`, `onChapterExit` - Actions
|
|
2403
|
-
*
|
|
2404
|
-
* @example Basic Chapter
|
|
2405
|
-
* ```yaml
|
|
2406
|
-
* - id: intro
|
|
2407
|
-
* title: "Welcome"
|
|
2408
|
-
* description: "This is the introduction."
|
|
2409
|
-
* center: [-74.006, 40.7128]
|
|
2410
|
-
* zoom: 12
|
|
2411
|
-
* ```
|
|
2412
|
-
*
|
|
2413
|
-
* @example Chapter with 3D View
|
|
2414
|
-
* ```yaml
|
|
2415
|
-
* - id: downtown
|
|
2416
|
-
* title: "Downtown"
|
|
2417
|
-
* description: "Explore the city center in 3D."
|
|
2418
|
-
* center: [-74.006, 40.7128]
|
|
2419
|
-
* zoom: 16
|
|
2420
|
-
* pitch: 60
|
|
2421
|
-
* bearing: 30
|
|
2422
|
-
* ```
|
|
2423
|
-
*
|
|
2424
|
-
* @example Chapter with Media
|
|
2425
|
-
* ```yaml
|
|
2426
|
-
* - id: overview
|
|
2427
|
-
* title: "City Overview"
|
|
2428
|
-
* description: "A bird's eye view of the city."
|
|
2429
|
-
* image: "https://example.com/overview.jpg"
|
|
2430
|
-
* center: [-74.006, 40.7128]
|
|
2431
|
-
* zoom: 10
|
|
2432
|
-
* ```
|
|
2433
|
-
*
|
|
2434
|
-
* @example Chapter with Layer Control
|
|
2435
|
-
* ```yaml
|
|
2436
|
-
* - id: earthquakes
|
|
2437
|
-
* title: "Recent Earthquakes"
|
|
2438
|
-
* description: "Major earthquakes in the last month."
|
|
2439
|
-
* center: [-120, 35]
|
|
2440
|
-
* zoom: 6
|
|
2441
|
-
* layers:
|
|
2442
|
-
* show:
|
|
2443
|
-
* - earthquakes
|
|
2444
|
-
* - fault-lines
|
|
2445
|
-
* hide:
|
|
2446
|
-
* - cities
|
|
2447
|
-
* ```
|
|
2448
|
-
*
|
|
2449
|
-
* @example Chapter with Actions
|
|
2450
|
-
* ```yaml
|
|
2451
|
-
* - id: filtered
|
|
2452
|
-
* title: "High Magnitude Events"
|
|
2453
|
-
* center: [-120, 35]
|
|
2454
|
-
* zoom: 6
|
|
2455
|
-
* onChapterEnter:
|
|
2456
|
-
* - action: setFilter
|
|
2457
|
-
* layer: earthquakes
|
|
2458
|
-
* filter: [">=", ["get", "magnitude"], 5]
|
|
2459
|
-
* onChapterExit:
|
|
2460
|
-
* - action: setFilter
|
|
2461
|
-
* layer: earthquakes
|
|
2462
|
-
* filter: null
|
|
2463
|
-
* ```
|
|
2464
|
-
*
|
|
2465
|
-
* @example Full-Width Chapter
|
|
2466
|
-
* ```yaml
|
|
2467
|
-
* - id: fullwidth
|
|
2468
|
-
* title: "Immersive View"
|
|
2469
|
-
* alignment: full
|
|
2470
|
-
* center: [-74.006, 40.7128]
|
|
2471
|
-
* zoom: 14
|
|
2472
|
-
* pitch: 45
|
|
2473
|
-
* ```
|
|
2474
|
-
*/
|
|
2475
|
-
declare const ChapterSchema: z.ZodObject<{
|
|
2476
|
-
id: z.ZodString;
|
|
2477
|
-
title: z.ZodString;
|
|
2478
|
-
center: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
2479
|
-
zoom: z.ZodNumber;
|
|
2480
|
-
description: z.ZodOptional<z.ZodString>;
|
|
2481
|
-
image: z.ZodOptional<z.ZodString>;
|
|
2482
|
-
video: z.ZodOptional<z.ZodString>;
|
|
2483
|
-
pitch: z.ZodDefault<z.ZodNumber>;
|
|
2484
|
-
bearing: z.ZodDefault<z.ZodNumber>;
|
|
2485
|
-
speed: z.ZodDefault<z.ZodNumber>;
|
|
2486
|
-
curve: z.ZodDefault<z.ZodNumber>;
|
|
2487
|
-
animation: z.ZodDefault<z.ZodEnum<["flyTo", "easeTo", "jumpTo"]>>;
|
|
2488
|
-
rotateAnimation: z.ZodOptional<z.ZodBoolean>;
|
|
2489
|
-
spinGlobe: z.ZodOptional<z.ZodBoolean>;
|
|
2490
|
-
alignment: z.ZodDefault<z.ZodEnum<["left", "right", "center", "full"]>>;
|
|
2491
|
-
hidden: z.ZodDefault<z.ZodBoolean>;
|
|
2492
|
-
layers: z.ZodOptional<z.ZodObject<{
|
|
2493
|
-
show: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
2494
|
-
hide: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
2495
|
-
}, "strip", z.ZodTypeAny, {
|
|
2496
|
-
show: string[];
|
|
2497
|
-
hide: string[];
|
|
2498
|
-
}, {
|
|
2499
|
-
show?: string[] | undefined;
|
|
2500
|
-
hide?: string[] | undefined;
|
|
2501
|
-
}>>;
|
|
2502
|
-
onChapterEnter: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2503
|
-
action: z.ZodEnum<["setFilter", "setPaintProperty", "setLayoutProperty", "flyTo", "easeTo", "fitBounds", "custom"]>;
|
|
2504
|
-
layer: z.ZodOptional<z.ZodString>;
|
|
2505
|
-
property: z.ZodOptional<z.ZodString>;
|
|
2506
|
-
value: z.ZodOptional<z.ZodAny>;
|
|
2507
|
-
filter: z.ZodOptional<z.ZodNullable<z.ZodType<any[], z.ZodTypeDef, any[]>>>;
|
|
2508
|
-
bounds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
2509
|
-
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
2510
|
-
}, "strip", z.ZodTypeAny, {
|
|
2511
|
-
action: "custom" | "flyTo" | "setFilter" | "setPaintProperty" | "setLayoutProperty" | "easeTo" | "fitBounds";
|
|
2512
|
-
value?: any;
|
|
2513
|
-
filter?: any[] | null | undefined;
|
|
2514
|
-
options?: Record<string, any> | undefined;
|
|
2515
|
-
bounds?: number[] | undefined;
|
|
2516
|
-
property?: string | undefined;
|
|
2517
|
-
layer?: string | undefined;
|
|
2518
|
-
}, {
|
|
2519
|
-
action: "custom" | "flyTo" | "setFilter" | "setPaintProperty" | "setLayoutProperty" | "easeTo" | "fitBounds";
|
|
2520
|
-
value?: any;
|
|
2521
|
-
filter?: any[] | null | undefined;
|
|
2522
|
-
options?: Record<string, any> | undefined;
|
|
2523
|
-
bounds?: number[] | undefined;
|
|
2524
|
-
property?: string | undefined;
|
|
2525
|
-
layer?: string | undefined;
|
|
2526
|
-
}>, "many">>;
|
|
2527
|
-
onChapterExit: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2528
|
-
action: z.ZodEnum<["setFilter", "setPaintProperty", "setLayoutProperty", "flyTo", "easeTo", "fitBounds", "custom"]>;
|
|
2529
|
-
layer: z.ZodOptional<z.ZodString>;
|
|
2530
|
-
property: z.ZodOptional<z.ZodString>;
|
|
2531
|
-
value: z.ZodOptional<z.ZodAny>;
|
|
2532
|
-
filter: z.ZodOptional<z.ZodNullable<z.ZodType<any[], z.ZodTypeDef, any[]>>>;
|
|
2533
|
-
bounds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
2534
|
-
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
2535
|
-
}, "strip", z.ZodTypeAny, {
|
|
2536
|
-
action: "custom" | "flyTo" | "setFilter" | "setPaintProperty" | "setLayoutProperty" | "easeTo" | "fitBounds";
|
|
2537
|
-
value?: any;
|
|
2538
|
-
filter?: any[] | null | undefined;
|
|
2539
|
-
options?: Record<string, any> | undefined;
|
|
2540
|
-
bounds?: number[] | undefined;
|
|
2541
|
-
property?: string | undefined;
|
|
2542
|
-
layer?: string | undefined;
|
|
2543
|
-
}, {
|
|
2544
|
-
action: "custom" | "flyTo" | "setFilter" | "setPaintProperty" | "setLayoutProperty" | "easeTo" | "fitBounds";
|
|
2545
|
-
value?: any;
|
|
2546
|
-
filter?: any[] | null | undefined;
|
|
2547
|
-
options?: Record<string, any> | undefined;
|
|
2548
|
-
bounds?: number[] | undefined;
|
|
2549
|
-
property?: string | undefined;
|
|
2550
|
-
layer?: string | undefined;
|
|
2551
|
-
}>, "many">>;
|
|
2552
|
-
callback: z.ZodOptional<z.ZodString>;
|
|
2553
|
-
}, "strip", z.ZodTypeAny, {
|
|
2554
|
-
center: [number, number];
|
|
2555
|
-
zoom: number;
|
|
2556
|
-
id: string;
|
|
2557
|
-
title: string;
|
|
2558
|
-
pitch: number;
|
|
2559
|
-
bearing: number;
|
|
2560
|
-
speed: number;
|
|
2561
|
-
curve: number;
|
|
2562
|
-
animation: "flyTo" | "easeTo" | "jumpTo";
|
|
2563
|
-
alignment: "center" | "left" | "right" | "full";
|
|
2564
|
-
hidden: boolean;
|
|
2565
|
-
onChapterEnter: {
|
|
2566
|
-
action: "custom" | "flyTo" | "setFilter" | "setPaintProperty" | "setLayoutProperty" | "easeTo" | "fitBounds";
|
|
2567
|
-
value?: any;
|
|
2568
|
-
filter?: any[] | null | undefined;
|
|
2569
|
-
options?: Record<string, any> | undefined;
|
|
2570
|
-
bounds?: number[] | undefined;
|
|
2571
|
-
property?: string | undefined;
|
|
2572
|
-
layer?: string | undefined;
|
|
2573
|
-
}[];
|
|
2574
|
-
onChapterExit: {
|
|
2575
|
-
action: "custom" | "flyTo" | "setFilter" | "setPaintProperty" | "setLayoutProperty" | "easeTo" | "fitBounds";
|
|
2576
|
-
value?: any;
|
|
2577
|
-
filter?: any[] | null | undefined;
|
|
2578
|
-
options?: Record<string, any> | undefined;
|
|
2579
|
-
bounds?: number[] | undefined;
|
|
2580
|
-
property?: string | undefined;
|
|
2581
|
-
layer?: string | undefined;
|
|
2582
|
-
}[];
|
|
2583
|
-
image?: string | undefined;
|
|
2584
|
-
video?: string | undefined;
|
|
2585
|
-
layers?: {
|
|
2586
|
-
show: string[];
|
|
2587
|
-
hide: string[];
|
|
2588
|
-
} | undefined;
|
|
2589
|
-
description?: string | undefined;
|
|
2590
|
-
rotateAnimation?: boolean | undefined;
|
|
2591
|
-
spinGlobe?: boolean | undefined;
|
|
2592
|
-
callback?: string | undefined;
|
|
2593
|
-
}, {
|
|
2594
|
-
center: [number, number];
|
|
2595
|
-
zoom: number;
|
|
2596
|
-
id: string;
|
|
2597
|
-
title: string;
|
|
2598
|
-
image?: string | undefined;
|
|
2599
|
-
video?: string | undefined;
|
|
2600
|
-
pitch?: number | undefined;
|
|
2601
|
-
bearing?: number | undefined;
|
|
2602
|
-
layers?: {
|
|
2603
|
-
show?: string[] | undefined;
|
|
2604
|
-
hide?: string[] | undefined;
|
|
2605
|
-
} | undefined;
|
|
2606
|
-
description?: string | undefined;
|
|
2607
|
-
speed?: number | undefined;
|
|
2608
|
-
curve?: number | undefined;
|
|
2609
|
-
animation?: "flyTo" | "easeTo" | "jumpTo" | undefined;
|
|
2610
|
-
rotateAnimation?: boolean | undefined;
|
|
2611
|
-
spinGlobe?: boolean | undefined;
|
|
2612
|
-
alignment?: "center" | "left" | "right" | "full" | undefined;
|
|
2613
|
-
hidden?: boolean | undefined;
|
|
2614
|
-
onChapterEnter?: {
|
|
2615
|
-
action: "custom" | "flyTo" | "setFilter" | "setPaintProperty" | "setLayoutProperty" | "easeTo" | "fitBounds";
|
|
2616
|
-
value?: any;
|
|
2617
|
-
filter?: any[] | null | undefined;
|
|
2618
|
-
options?: Record<string, any> | undefined;
|
|
2619
|
-
bounds?: number[] | undefined;
|
|
2620
|
-
property?: string | undefined;
|
|
2621
|
-
layer?: string | undefined;
|
|
2622
|
-
}[] | undefined;
|
|
2623
|
-
onChapterExit?: {
|
|
2624
|
-
action: "custom" | "flyTo" | "setFilter" | "setPaintProperty" | "setLayoutProperty" | "easeTo" | "fitBounds";
|
|
2625
|
-
value?: any;
|
|
2626
|
-
filter?: any[] | null | undefined;
|
|
2627
|
-
options?: Record<string, any> | undefined;
|
|
2628
|
-
bounds?: number[] | undefined;
|
|
2629
|
-
property?: string | undefined;
|
|
2630
|
-
layer?: string | undefined;
|
|
2631
|
-
}[] | undefined;
|
|
2632
|
-
callback?: string | undefined;
|
|
2633
|
-
}>;
|
|
2634
|
-
/**
|
|
2635
|
-
* Scrollytelling block for narrative map stories.
|
|
2636
|
-
*
|
|
2637
|
-
* @remarks
|
|
2638
|
-
* Creates an immersive scrollytelling experience where the map
|
|
2639
|
-
* transitions between chapters as the user scrolls through content.
|
|
2640
|
-
*
|
|
2641
|
-
* **Features:**
|
|
2642
|
-
* - Smooth camera transitions
|
|
2643
|
-
* - Layer show/hide animations
|
|
2644
|
-
* - Dynamic property updates
|
|
2645
|
-
* - Chapter-based narrative structure
|
|
2646
|
-
* - Customizable themes and markers
|
|
2647
|
-
*
|
|
2648
|
-
* **Structure:**
|
|
2649
|
-
* 1. Base map configuration (persistent)
|
|
2650
|
-
* 2. Persistent layers (visible throughout)
|
|
2651
|
-
* 3. Chapters (individual story sections)
|
|
2652
|
-
* 4. Optional footer
|
|
2653
|
-
*
|
|
2654
|
-
* @example Basic Scrollytelling
|
|
2655
|
-
* ```yaml
|
|
2656
|
-
* - type: scrollytelling
|
|
2657
|
-
* id: story
|
|
2658
|
-
* config:
|
|
2659
|
-
* center: [-74.006, 40.7128]
|
|
2660
|
-
* zoom: 12
|
|
2661
|
-
* mapStyle: "https://demotiles.maplibre.org/style.json"
|
|
2662
|
-
* chapters:
|
|
2663
|
-
* - id: intro
|
|
2664
|
-
* title: "Introduction"
|
|
2665
|
-
* description: "Welcome to our story."
|
|
2666
|
-
* center: [-74.006, 40.7128]
|
|
2667
|
-
* zoom: 12
|
|
2668
|
-
* - id: detail
|
|
2669
|
-
* title: "A Closer Look"
|
|
2670
|
-
* description: "Let's zoom in."
|
|
2671
|
-
* center: [-74.006, 40.7128]
|
|
2672
|
-
* zoom: 16
|
|
2673
|
-
* ```
|
|
2674
|
-
*
|
|
2675
|
-
* @example Themed Scrollytelling
|
|
2676
|
-
* ```yaml
|
|
2677
|
-
* - type: scrollytelling
|
|
2678
|
-
* id: dark-story
|
|
2679
|
-
* theme: dark
|
|
2680
|
-
* showMarkers: true
|
|
2681
|
-
* markerColor: "#ff0000"
|
|
2682
|
-
* config:
|
|
2683
|
-
* center: [0, 0]
|
|
2684
|
-
* zoom: 2
|
|
2685
|
-
* mapStyle: "https://demotiles.maplibre.org/style.json"
|
|
2686
|
-
* chapters:
|
|
2687
|
-
* - id: chapter1
|
|
2688
|
-
* title: "Chapter 1"
|
|
2689
|
-
* center: [0, 0]
|
|
2690
|
-
* zoom: 3
|
|
2691
|
-
* ```
|
|
2692
|
-
*
|
|
2693
|
-
* @example With Persistent Layers
|
|
2694
|
-
* ```yaml
|
|
2695
|
-
* - type: scrollytelling
|
|
2696
|
-
* id: earthquake-story
|
|
2697
|
-
* config:
|
|
2698
|
-
* center: [-120, 35]
|
|
2699
|
-
* zoom: 5
|
|
2700
|
-
* mapStyle: "https://demotiles.maplibre.org/style.json"
|
|
2701
|
-
* layers:
|
|
2702
|
-
* - id: base-layer
|
|
2703
|
-
* type: circle
|
|
2704
|
-
* source:
|
|
2705
|
-
* type: geojson
|
|
2706
|
-
* url: "https://example.com/data.geojson"
|
|
2707
|
-
* paint:
|
|
2708
|
-
* circle-radius: 6
|
|
2709
|
-
* circle-color: "#888888"
|
|
2710
|
-
* chapters:
|
|
2711
|
-
* - id: overview
|
|
2712
|
-
* title: "Overview"
|
|
2713
|
-
* center: [-120, 35]
|
|
2714
|
-
* zoom: 5
|
|
2715
|
-
* - id: detail
|
|
2716
|
-
* title: "Major Event"
|
|
2717
|
-
* center: [-118, 34]
|
|
2718
|
-
* zoom: 10
|
|
2719
|
-
* layers:
|
|
2720
|
-
* show:
|
|
2721
|
-
* - base-layer
|
|
2722
|
-
* ```
|
|
2723
|
-
*
|
|
2724
|
-
* @example With Footer
|
|
2725
|
-
* ```yaml
|
|
2726
|
-
* - type: scrollytelling
|
|
2727
|
-
* id: story
|
|
2728
|
-
* config:
|
|
2729
|
-
* center: [0, 0]
|
|
2730
|
-
* zoom: 2
|
|
2731
|
-
* mapStyle: "https://demotiles.maplibre.org/style.json"
|
|
2732
|
-
* chapters:
|
|
2733
|
-
* - id: chapter1
|
|
2734
|
-
* title: "Chapter 1"
|
|
2735
|
-
* center: [0, 0]
|
|
2736
|
-
* zoom: 3
|
|
2737
|
-
* footer: |
|
|
2738
|
-
* <p>Data sources: ...</p>
|
|
2739
|
-
* <p>Created with maplibre-yaml</p>
|
|
2740
|
-
* ```
|
|
2741
|
-
*/
|
|
2742
|
-
declare const ScrollytellingBlockSchema: z.ZodObject<any>;
|
|
2743
|
-
|
|
2744
|
-
export { ChapterActionSchema, ChapterLayersSchema, ChapterSchema, ColorOrExpressionSchema, ColorSchema, ContentBlockSchema, ContentElementSchema, ContentItemSchema, ExpressionSchema, GeoJSONSourceSchema, ImageSourceSchema, LatitudeSchema, LayerSourceSchema, LngLatBoundsSchema, LngLatSchema, LoadingConfigSchema, LongitudeSchema, NumberOrExpressionSchema, RasterSourceSchema, ScrollytellingBlockSchema, StreamConfigSchema, ValidTagNames, VectorSourceSchema, VideoSourceSchema, ZoomLevelSchema };
|
|
2263
|
+
export { ColorOrExpressionSchema, ColorSchema, ContentBlockSchema, ContentElementSchema, ContentItemSchema, ExpressionSchema, GeoJSONSourceSchema, ImageSourceSchema, LatitudeSchema, LayerSourceSchema, LngLatBoundsSchema, LngLatSchema, LoadingConfigSchema, LongitudeSchema, NumberOrExpressionSchema, RasterSourceSchema, StreamConfigSchema, ValidTagNames, VectorSourceSchema, VideoSourceSchema, ZoomLevelSchema };
|
package/dist/schemas/index.js
CHANGED
|
@@ -532,7 +532,9 @@ var MapConfigSchema = z.object({
|
|
|
532
532
|
// Required
|
|
533
533
|
center: LngLatSchema.describe("Initial map center [longitude, latitude]"),
|
|
534
534
|
zoom: ZoomLevelSchema.describe("Initial zoom level (0-24)"),
|
|
535
|
-
mapStyle: z.union([z.string().url(), z.any()]).describe(
|
|
535
|
+
mapStyle: z.union([z.string().url(), z.any()]).optional().describe(
|
|
536
|
+
"MapLibre style URL or style object. Optional when global config.defaultMapStyle is set."
|
|
537
|
+
),
|
|
536
538
|
// View
|
|
537
539
|
pitch: z.number().min(0).max(85).default(0).describe("Camera pitch angle in degrees (0-85)"),
|
|
538
540
|
bearing: z.number().min(-180).max(180).default(0).describe("Camera bearing (rotation) in degrees (-180 to 180)"),
|