@wemap/core 14.5.5 → 14.6.0-beta.1

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,4 +1,7 @@
1
+ import { BoundingBox } from '../../geo';
2
+ import { PinpointManager } from './services/PinpointManager';
1
3
  import { SnippetParser } from './helpers/SnippetParser';
4
+ import { Building } from './types/indoor';
2
5
  /**
3
6
  * Initialization options for the Core SDK
4
7
  */
@@ -11,6 +14,16 @@ export interface InitOptions {
11
14
  env?: 'production' | 'development';
12
15
  }
13
16
  type Snippet = ReturnType<typeof SnippetParser.parse>;
17
+ /** Indoor settings from the livemap snippet (`indoor.enable`, `indoor.minZoom`). */
18
+ export interface IndoorOptions {
19
+ /** Whether indoor building selection is active (`indoor.enable`). */
20
+ enabled: boolean;
21
+ /**
22
+ * Zoom threshold from `indoor.minZoom`. Below this level there is no current
23
+ * building.
24
+ */
25
+ minZoom: number;
26
+ }
14
27
  /**
15
28
  * Core configuration class for initializing the Wemap SDK
16
29
  *
@@ -82,6 +95,69 @@ export declare class CoreConfig {
82
95
  * ```
83
96
  */
84
97
  static getConfig(): Snippet;
98
+ /**
99
+ * Map-related parameters derived from the livemap snippet, shaped for direct
100
+ * use when creating a map (e.g. `@wemap/map`'s `WemapMap`).
101
+ *
102
+ * Translates livemap semantics into renderer options:
103
+ * - `tilesStyle` → `style`
104
+ * - `initialBounds` → `bounds` (initial view; takes precedence over center/zoom)
105
+ * - `maxBounds`, `minZoom`, `maxZoom` → same
106
+ * - `initialBearing` → `bearing`, `pitchStart` → `pitch`
107
+ * - `dragging` → `dragPan`, `pitchEnabled` → `dragRotate` / `pitchWithRotate`
108
+ * - `scrollWheelZoom` → `scrollZoom`, `locked` → `interactive` (negated)
109
+ *
110
+ * Applied automatically by `@wemap/map`'s `WemapMap` after `core.init()`;
111
+ * constructor options override these defaults.
112
+ *
113
+ * @returns The map parameters from the parsed snippet.
114
+ */
115
+ static getIndoorOptions(): IndoorOptions;
116
+ static getMapOptions(): {
117
+ style: any;
118
+ bounds: BoundingBox;
119
+ maxBounds: BoundingBox;
120
+ minZoom: any;
121
+ maxZoom: any;
122
+ bearing: any;
123
+ pitch: any;
124
+ dragPan: any;
125
+ dragRotate: any;
126
+ pitchWithRotate: any;
127
+ scrollZoom: any;
128
+ interactive: boolean;
129
+ };
130
+ /**
131
+ * Build a building provider for the initialized livemap: a function that
132
+ * returns the buildings whose bbox intersects a given viewport.
133
+ *
134
+ * This is the concrete data source `@wemap/map` uses for building selection
135
+ * when `indoor.enable` is set in the livemap snippet. Integrators normally
136
+ * don't call it directly.
137
+ *
138
+ * ```typescript
139
+ * await core.init({ emmid, token });
140
+ * const provider = core.createBuildingProvider();
141
+ * const buildings = await provider(map.getBounds());
142
+ * ```
143
+ *
144
+ * @returns A `(bbox) => Promise<Building[]>` bound to this livemap.
145
+ */
146
+ createBuildingProvider(): (bbox: BoundingBox) => Promise<Building[]>;
147
+ /**
148
+ * Build a pinpoint manager bound to the initialized livemap.
149
+ *
150
+ * ```typescript
151
+ * await core.init({ emmid, token });
152
+ * const pinpoints = core.createPinpointManager();
153
+ * const { items } = await pinpoints.search({
154
+ * query: 'café',
155
+ * ...boundsToDelta(map.getBounds()),
156
+ * level: map.getLevel() ?? undefined,
157
+ * });
158
+ * ```
159
+ */
160
+ createPinpointManager(): PinpointManager;
85
161
  }
86
162
  /**
87
163
  * Default instance of CoreConfig for convenience
@@ -1 +1 @@
1
- {"version":3,"file":"CoreConfig.d.ts","sourceRoot":"","sources":["../../src/CoreConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,GAAG,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC;CACpC;AAED,KAAK,O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AAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAC,OAAO,CAAU;IAChC,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,GAAG,CAA8C;IAGzD;;;;OAIG;;IAKH,OAAO,CAAC,UAAU;IAIlB;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBnD;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,SAAS,IAAI,OAAO;IAI3B;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,gBAAgB,IAAI,aAAa;IAUxC,MAAM,CAAC,aAAa;;;;;;;;;;;;;;IAmBpB;;;;;;;;;;;;;;;OAeG;IACH,sBAAsB,IAAI,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,EAAE,CAAC;IAMpE;;;;;;;;;;;;OAYG;IACH,qBAAqB,IAAI,eAAe;CAGzC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,YAAmB,CAAC"}
@@ -158,6 +158,18 @@ export declare class SnippetParser {
158
158
  readonly dragging: any;
159
159
  readonly emmid: number;
160
160
  readonly handleBearing: any;
161
+ readonly indoor: {
162
+ enable: any;
163
+ enableInteraction: any;
164
+ highlightColor: any;
165
+ selectedColor: any;
166
+ highlightEnabled: any;
167
+ highlightOnSearch: any;
168
+ limitOutdoorAtLevel: any;
169
+ minZoom: any;
170
+ usePinpoints: any;
171
+ useLevelSearch: any;
172
+ };
161
173
  readonly initialBounds: BoundingBox;
162
174
  readonly initialBearing: any;
163
175
  readonly limit: number;
@@ -1 +1 @@
1
- {"version":3,"file":"SnippetParser.d.ts","sourceRoot":"","sources":["../../../src/helpers/SnippetParser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjF,OAAO,EAAE,WAAW,EAAE,MAAM,YAA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M,EAAE,GAAG,CAAC;;;IAuBvF,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CtC"}
@@ -0,0 +1,33 @@
1
+ import { BoundingBox } from '../../../geo';
2
+ import { Building } from '../types/indoor';
3
+ /**
4
+ * Fetches buildings of a livemap from the Wemap API, with bbox-based caching.
5
+ *
6
+ * Ported from livemap's `IndoorService`: the first lookup downloads every
7
+ * building of the livemap (paginated) and caches them against an expanded bbox;
8
+ * subsequent lookups whose viewport is still inside the cached bbox are served
9
+ * from memory. Each lookup returns only the buildings whose bbox intersects the
10
+ * requested viewport.
11
+ */
12
+ export declare class BuildingService {
13
+ /** Minimum bbox size (meters) the cache is expanded to, to limit API calls. */
14
+ static MIN_BBOX_SIZE: number;
15
+ private static PAGE_SIZE;
16
+ private readonly http;
17
+ private readonly emmid;
18
+ private readonly buildings;
19
+ private cachedBbox;
20
+ /**
21
+ * @param baseUrl - Base URL of the Wemap API (e.g. `https://api.getwemap.com/v3.0`).
22
+ * @param emmid - The livemap id whose buildings to fetch.
23
+ */
24
+ constructor(baseUrl: string, emmid: string | number);
25
+ /**
26
+ * Return the buildings whose bbox intersects `bbox`, fetching from the API
27
+ * when the cache does not already cover the requested viewport.
28
+ */
29
+ getBuildingsFromBbox(bbox: BoundingBox): Promise<Building[]>;
30
+ private intersecting;
31
+ private fetchAll;
32
+ }
33
+ //# sourceMappingURL=BuildingService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildingService.d.ts","sourceRoot":"","sources":["../../../src/services/BuildingService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAShD;;;;;;;;GAQG;AACH,qBAAa,eAAe;IAC1B,+EAA+E;IAC/E,MAAM,CAAC,aAAa,SAAQ;IAC5B,OAAO,CAAC,MAAM,CAAC,SAAS,CAAM;IAE9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+B;IACzD,OAAO,CAAC,UAAU,CAA4B;IAE9C;;;OAGG;gBACS,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAKnD;;;OAGG;IACG,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IA0BlE,OAAO,CAAC,YAAY;YAaN,QAAQ;CAiBvB"}
@@ -0,0 +1,35 @@
1
+ import { BoundingBox } from '../../../geo';
2
+ import { Pinpoint, PinpointSearchQuery } from '../types/pinpoint';
3
+ /**
4
+ * In-memory pinpoint store with expanded-bbox viewport preload.
5
+ * One instance per livemap; shared by search and map click resolution.
6
+ *
7
+ * @internal Used by {@link PinpointManager} and `@wemap/map`.
8
+ */
9
+ export declare class PinpointCache {
10
+ /** Minimum bbox size (meters) the cache is expanded to, to limit API calls. */
11
+ static MIN_BBOX_SIZE: number;
12
+ private static PAGE_SIZE;
13
+ private static instances;
14
+ private static refCounts;
15
+ private readonly service;
16
+ private readonly pinpoints;
17
+ private cachedBboxByLevel;
18
+ private constructor();
19
+ static forLivemap(baseUrl: string, emmid: string | number): PinpointCache;
20
+ /** Drop the shared cache when the last {@link PinpointManager} is released. */
21
+ static release(baseUrl: string, emmid: string | number): void;
22
+ upsert(items: readonly Pinpoint[]): void;
23
+ search(query: PinpointSearchQuery): Promise<import('../..').PinpointSearchResponse>;
24
+ getAll(): Promise<Pinpoint[]>;
25
+ getCachedById(id: number): Pinpoint | undefined;
26
+ getLoaded(): Pinpoint[];
27
+ getCachedBbox(): BoundingBox | null;
28
+ getById(id: number): Promise<Pinpoint | null>;
29
+ /**
30
+ * Preload pinpoints for the viewport when it leaves the cached area.
31
+ * Multi-page fetch within an expanded bbox; invisible to integrators.
32
+ */
33
+ preloadViewport(bbox: BoundingBox, level?: number | null): Promise<void>;
34
+ }
35
+ //# sourceMappingURL=PinpointCache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PinpointCache.d.ts","sourceRoot":"","sources":["../../../src/services/PinpointCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGvE;;;;;GAKG;AACH,qBAAa,aAAa;IACxB,+EAA+E;IAC/E,MAAM,CAAC,aAAa,SAAQ;IAC5B,OAAO,CAAC,MAAM,CAAC,SAAS,CAAO;IAE/B,OAAO,CAAC,MAAM,CAAC,SAAS,CAAoC;IAC5D,OAAO,CAAC,MAAM,CAAC,SAAS,CAA6B;IAErD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+B;IACzD,OAAO,CAAC,iBAAiB,CAAyC;IAElE,OAAO;IAIP,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa;IAazE,+EAA+E;IAC/E,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAY7D,MAAM,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,GAAG,IAAI;IAMxC,MAAM,CAAC,KAAK,EAAE,mBAAmB;IAI3B,MAAM,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAOnC,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAI/C,SAAS,IAAI,QAAQ,EAAE;IAIvB,aAAa,IAAI,WAAW,GAAG,IAAI;IAU7B,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAiBnD;;;OAGG;IACG,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAyC/E"}
@@ -0,0 +1,28 @@
1
+ import { BoundingBox } from '../../../geo';
2
+ import { Pinpoint, PinpointResolver, PinpointSearchQuery, PinpointSearchResponse } from '../types/pinpoint';
3
+ /**
4
+ * Public façade for pinpoint retrieval/search operations bound to a livemap.
5
+ *
6
+ * Internally uses the shared pinpoint store so map preload, click resolution,
7
+ * and integrator searches all benefit from the same data.
8
+ */
9
+ export declare class PinpointManager implements PinpointResolver {
10
+ private readonly cache;
11
+ private readonly baseUrl;
12
+ private readonly emmid;
13
+ constructor(baseUrl: string, emmid: string | number);
14
+ search(query: PinpointSearchQuery): Promise<PinpointSearchResponse>;
15
+ /**
16
+ * Fetch all pinpoints of the current livemap from API (paginated, no bounds).
17
+ */
18
+ getAll(): Promise<Pinpoint[]>;
19
+ getById(id: number): Promise<Pinpoint | null>;
20
+ preloadViewport(bbox: BoundingBox, level?: number | null): Promise<void>;
21
+ /** Already loaded pinpoints (search + preload + click fallback). */
22
+ getLoadedPinpoints(): Pinpoint[];
23
+ /** Cached preload bbox, or null when no preload happened yet. */
24
+ getCachedBbox(): BoundingBox | null;
25
+ /** Release the shared cache when this manager is no longer needed. */
26
+ release(): void;
27
+ }
28
+ //# sourceMappingURL=PinpointManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PinpointManager.d.ts","sourceRoot":"","sources":["../../../src/services/PinpointManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EACV,QAAQ,EACR,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAG3B;;;;;GAKG;AACH,qBAAa,eAAgB,YAAW,gBAAgB;IACtD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;gBAE5B,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAM7C,MAAM,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAOzE;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAI7B,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAI7C,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxE,oEAAoE;IACpE,kBAAkB,IAAI,QAAQ,EAAE;IAIhC,iEAAiE;IACjE,aAAa,IAAI,WAAW,GAAG,IAAI;IAInC,sEAAsE;IACtE,OAAO,IAAI,IAAI;CAGhB"}
@@ -0,0 +1,20 @@
1
+ import { Pinpoint, PinpointSearchQuery, PinpointSearchResponse } from '../types/pinpoint';
2
+ /**
3
+ * Fetches pinpoints from the Wemap API. Internal — use
4
+ * {@link CoreConfig.createPinpointManager} instead.
5
+ */
6
+ export declare class PinpointService {
7
+ private static PAGE_SIZE;
8
+ private readonly http;
9
+ private readonly emmid;
10
+ constructor(baseUrl: string, emmid: string | number);
11
+ search(query: PinpointSearchQuery): Promise<PinpointSearchResponse>;
12
+ getById(id: number): Promise<Pinpoint>;
13
+ /**
14
+ * Fetch all pinpoints of the current livemap (paginated), without bounds.
15
+ */
16
+ getAll(): Promise<Pinpoint[]>;
17
+ /** @internal Exported for unit tests. */
18
+ buildSearchParams(query: PinpointSearchQuery): Record<string, string | number>;
19
+ }
20
+ //# sourceMappingURL=PinpointService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PinpointService.d.ts","sourceRoot":"","sources":["../../../src/services/PinpointService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAuB3B;;;GAGG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,SAAS,CAAO;IAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;gBAEnB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAK7C,MAAM,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAenE,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAM5C;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAsBnC,yCAAyC;IACzC,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAkC/E"}
@@ -0,0 +1,40 @@
1
+ import { Feature, MultiPolygon, Polygon } from 'geojson';
2
+ /**
3
+ * A single level (floor) of a building, as returned by the Wemap buildings API.
4
+ */
5
+ export interface IndoorLevel {
6
+ /** Unique level id. */
7
+ id: number;
8
+ /** Numeric level (floor). Ground floor is usually `0`. */
9
+ level: number;
10
+ /** Display name (e.g. `"Ground floor"`). */
11
+ name: string;
12
+ /** Short display name (e.g. `"0"`, `"RDC"`). */
13
+ short_name: string;
14
+ /** Minimum altitude of the level, in meters. */
15
+ min_altitude?: number;
16
+ /** Maximum altitude of the level, in meters. */
17
+ max_altitude?: number;
18
+ /** Footprint of the level, when provided. */
19
+ geometry?: Polygon | MultiPolygon;
20
+ }
21
+ /**
22
+ * A building, as returned by `GET /buildings/search`. It is a GeoJSON feature
23
+ * (with a `bbox`) augmented with indoor metadata.
24
+ *
25
+ * Data model: a livemap has many venues, a venue has many buildings, a building
26
+ * has many {@link IndoorLevel}s.
27
+ */
28
+ export type Building = Feature<Polygon | MultiPolygon> & {
29
+ /** Unique building id. */
30
+ id: number;
31
+ /** Building name. */
32
+ name: string;
33
+ /** Level shown by default when the building becomes active. */
34
+ default_level: number;
35
+ /** Parent venue id, or `null`. */
36
+ venue: number | null;
37
+ /** Levels (floors) of the building. */
38
+ levels: IndoorLevel[];
39
+ };
40
+ //# sourceMappingURL=indoor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indoor.d.ts","sourceRoot":"","sources":["../../../src/types/indoor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;CACnC;AAED;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,GAAG,YAAY,CAAC,GAAG;IACvD,0BAA0B;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,aAAa,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,uCAAuC;IACvC,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB,CAAC"}
@@ -0,0 +1,49 @@
1
+ /** Minimal read model for a Wemap pinpoint (not a full livemap `PinpointObject` port). */
2
+ export interface Pinpoint {
3
+ id: number;
4
+ name: string;
5
+ description?: string;
6
+ latitude: number;
7
+ longitude: number;
8
+ level?: number | null;
9
+ altitude?: number | null;
10
+ tags?: string[];
11
+ category?: number;
12
+ image_url?: string;
13
+ address?: string;
14
+ }
15
+ /** Bounds params returned by {@link boundsToDelta}. */
16
+ export interface PinpointBoundsParams {
17
+ center_latitude: number;
18
+ center_longitude: number;
19
+ latitude_delta: number;
20
+ longitude_delta: number;
21
+ }
22
+ /** Query for {@link CoreConfig.createPinpointManager}. Bounds are required. */
23
+ export interface PinpointSearchQuery extends PinpointBoundsParams {
24
+ query?: string;
25
+ tags?: string | string[];
26
+ level?: number;
27
+ levels?: string;
28
+ limit?: number;
29
+ offset?: number;
30
+ }
31
+ /** Single-page pinpoint search response. */
32
+ export interface PinpointSearchResponse {
33
+ count: number;
34
+ items: Pinpoint[];
35
+ next: string | null;
36
+ previous: string | null;
37
+ query: Record<string, unknown>;
38
+ }
39
+ /**
40
+ * Viewport preload and click resolution surface used by `@wemap/map`.
41
+ *
42
+ * @internal
43
+ */
44
+ export interface PinpointResolver {
45
+ getById(id: number): Promise<Pinpoint | null>;
46
+ getLoadedPinpoints(): Pinpoint[];
47
+ preloadViewport(bounds: import('../../../geo').BoundingBox, level?: number | null): Promise<void>;
48
+ }
49
+ //# sourceMappingURL=pinpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pinpoint.d.ts","sourceRoot":"","sources":["../../../src/types/pinpoint.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE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I,QAAQ,EAAE,CAAC;IACjC,eAAe,CACb,MAAM,EAAE,OAAO,YAAY,EAAE,WAAW,EACxC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GACpB,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wemap/core",
3
- "version": "14.5.5",
3
+ "version": "14.6.0-beta.1",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -18,6 +18,7 @@
18
18
  "dist"
19
19
  ],
20
20
  "dependencies": {
21
- "@wemap/geo": "14.5.5"
21
+ "@wemap/geo": "14.6.0-beta.1",
22
+ "@types/geojson": "^7946.0.16"
22
23
  }
23
24
  }