@wemap/core 14.6.0-beta.3 → 14.6.0-beta.5

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 CHANGED
@@ -8,6 +8,7 @@ The core package provides the foundational functionality for the Wemap SDK, incl
8
8
  - **Configuration Management**: Access global configuration across all SDK packages
9
9
  - **HTTP Client**: Robust HTTP client with automatic JSON parsing, error handling, and timeout support
10
10
  - **Livemap Service**: Fetch and parse livemap data from the Wemap API
11
+ - **Geocoding**: Forward and reverse geocoding via the Wemap geocoding API
11
12
 
12
13
  ## Getting Started
13
14
 
@@ -30,6 +31,7 @@ const config = CoreConfig.getConfig();
30
31
  - **CoreConfig**: Main configuration class for SDK initialization
31
32
  - **HttpClient**: HTTP client for making API requests
32
33
  - **LivemapService**: Service for fetching livemap data
34
+ - **GeocodingService**: Forward and reverse geocoding
33
35
 
34
36
  ## Content search / pinpoint search
35
37
 
@@ -67,3 +69,24 @@ Query normalisation (livemap parity):
67
69
  The exported `Pinpoint` type is a minimal read model: `id`, `name`,
68
70
  `description?`, coordinates, `level?`, `altitude?`, `tags?`, `category?`,
69
71
  `image_url?`, `address?`.
72
+
73
+ ## Geocoding
74
+
75
+ Forward and reverse geocoding against `https://geocoding.getwemap.workers.dev`.
76
+ Does not require `core.init()`:
77
+
78
+ ```typescript
79
+ import { GeocodingService, core } from '@wemap/core';
80
+
81
+ const geocoding = core.createGeocodingService({ language: 'fr', region: 'fr' });
82
+ // or: new GeocodingService({ language: 'fr' })
83
+
84
+ const place = await geocoding.search('Paris');
85
+ const places = await geocoding.searchMultiple('Paris');
86
+ const address = await geocoding.reverseGeocode(48.85, 2.35);
87
+ ```
88
+
89
+ `GeocodingResult` exposes `id`, `placeType`, `relevance`, `text`, `placeName`,
90
+ `language?`, `latitude`, `longitude`, and optional `bbox` as
91
+ `[west, south, east, north]`. Per-call `language` / `region` / `bbox` override
92
+ constructor defaults.
package/dist/index.d.ts CHANGED
@@ -5,10 +5,12 @@ export * from './src/CoreConfig';
5
5
  export * from './src/services/LivemapService';
6
6
  export * from './src/services/BuildingService';
7
7
  export * from './src/services/PinpointManager';
8
+ export * from './src/services/GeocodingService';
8
9
  export * from './src/services/HttpClient';
9
10
  export type { LatLngLike } from './src/types/common';
10
11
  export type { Building, IndoorLevel } from './src/types/indoor';
11
12
  export type { Pinpoint, PinpointBoundsParams, PinpointSearchQuery, PinpointSearchResponse, PinpointResolver, } from './src/types/pinpoint';
13
+ export type { GeocodingResult, GeocodingSearchOptions, GeocodingServiceOptions, } from './src/types/geocoding';
12
14
  export { latLngLikeToCoordinates, boundsToDelta } from './src/utils/map';
13
15
  export { DEFAULT_THEME, resolveTheme, themeToCssVariables, } from './src/theme';
14
16
  export type { WemapTheme } from './src/theme';
@@ -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,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;AAEzE,OAAO,EACL,aAAa,EACb,YAAY,EACZ,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cA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