@wemap/core 14.6.0-beta.0 → 14.6.0-beta.2
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/README.md +36 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +386 -217
- package/dist/src/CoreConfig.d.ts +15 -0
- package/dist/src/CoreConfig.d.ts.map +1 -1
- package/dist/src/services/PinpointCache.d.ts +35 -0
- package/dist/src/services/PinpointCache.d.ts.map +1 -0
- package/dist/src/services/PinpointManager.d.ts +28 -0
- package/dist/src/services/PinpointManager.d.ts.map +1 -0
- package/dist/src/services/PinpointService.d.ts +20 -0
- package/dist/src/services/PinpointService.d.ts.map +1 -0
- package/dist/src/types/pinpoint.d.ts +49 -0
- package/dist/src/types/pinpoint.d.ts.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -31,3 +31,39 @@ const config = CoreConfig.getConfig();
|
|
|
31
31
|
- **HttpClient**: HTTP client for making API requests
|
|
32
32
|
- **LivemapService**: Service for fetching livemap data
|
|
33
33
|
|
|
34
|
+
## Content search / pinpoint search
|
|
35
|
+
|
|
36
|
+
After `core.init()`, use `createPinpointManager()` to search pinpoints in the
|
|
37
|
+
current viewport. Bounds are required — pass `...boundsToDelta(map.getBounds())`
|
|
38
|
+
from `@wemap/core`:
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { boundsToDelta, core } from '@wemap/core';
|
|
42
|
+
|
|
43
|
+
await core.init({ emmid, token });
|
|
44
|
+
const pinpointManager = core.createPinpointManager();
|
|
45
|
+
|
|
46
|
+
const { items, count, next } = await pinpointManager.search({
|
|
47
|
+
query: 'café',
|
|
48
|
+
...boundsToDelta(map.getBounds()),
|
|
49
|
+
level: map.getLevel() ?? undefined,
|
|
50
|
+
limit: 20,
|
|
51
|
+
offset: 0,
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Search results are upserted into a shared internal cache (one per livemap).
|
|
56
|
+
`@wemap/map` uses the same cache for invisible viewport preload and to resolve
|
|
57
|
+
full `Pinpoint` entities on POI click — integrators do not manage the cache.
|
|
58
|
+
|
|
59
|
+
Query normalisation (livemap parity):
|
|
60
|
+
|
|
61
|
+
- `level` alone becomes `levels: "null,<level>"`; when both `level` and
|
|
62
|
+
`levels` are set, `levels` wins.
|
|
63
|
+
- `tags` accepts `string | string[]` (arrays are joined with `,`).
|
|
64
|
+
- Default `query_mode: 'phrase'`.
|
|
65
|
+
- Pinpoint API calls do not send `Authorization`.
|
|
66
|
+
|
|
67
|
+
The exported `Pinpoint` type is a minimal read model: `id`, `name`,
|
|
68
|
+
`description?`, coordinates, `level?`, `altitude?`, `tags?`, `category?`,
|
|
69
|
+
`image_url?`, `address?`.
|
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
export * from './src/CoreConfig';
|
|
5
5
|
export * from './src/services/LivemapService';
|
|
6
6
|
export * from './src/services/BuildingService';
|
|
7
|
+
export * from './src/services/PinpointManager';
|
|
7
8
|
export * from './src/services/HttpClient';
|
|
8
9
|
export type { LatLngLike } from './src/types/common';
|
|
9
10
|
export type { Building, IndoorLevel } from './src/types/indoor';
|
|
10
|
-
export {
|
|
11
|
+
export type { Pinpoint, PinpointBoundsParams, PinpointSearchQuery, PinpointSearchResponse, PinpointResolver, } from './src/types/pinpoint';
|
|
12
|
+
export { latLngLikeToCoordinates, boundsToDelta } from './src/utils/map';
|
|
11
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAE1C,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAE1C,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAChE,YAAY,EACV,QAAQ,EACR,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|