@remaply/maps 0.0.0-stage → 0.2.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.
Files changed (52) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +8 -0
  3. package/README.md +240 -2
  4. package/dist/client.d.ts +31 -0
  5. package/dist/client.d.ts.map +1 -0
  6. package/dist/client.js +208 -0
  7. package/dist/client.js.map +1 -0
  8. package/dist/config.d.ts +62 -0
  9. package/dist/config.d.ts.map +1 -0
  10. package/dist/config.js +65 -0
  11. package/dist/config.js.map +1 -0
  12. package/dist/directions.d.ts +68 -0
  13. package/dist/directions.d.ts.map +1 -0
  14. package/dist/directions.js +114 -0
  15. package/dist/directions.js.map +1 -0
  16. package/dist/errors.d.ts +26 -0
  17. package/dist/errors.d.ts.map +1 -0
  18. package/dist/errors.js +85 -0
  19. package/dist/errors.js.map +1 -0
  20. package/dist/geo.d.ts +17 -0
  21. package/dist/geo.d.ts.map +1 -0
  22. package/dist/geo.js +43 -0
  23. package/dist/geo.js.map +1 -0
  24. package/dist/index.d.ts +21 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.js +23 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/map.d.ts +117 -0
  29. package/dist/map.d.ts.map +1 -0
  30. package/dist/map.js +357 -0
  31. package/dist/map.js.map +1 -0
  32. package/dist/routePreview.d.ts +84 -0
  33. package/dist/routePreview.d.ts.map +1 -0
  34. package/dist/routePreview.js +206 -0
  35. package/dist/routePreview.js.map +1 -0
  36. package/dist/search.d.ts +70 -0
  37. package/dist/search.d.ts.map +1 -0
  38. package/dist/search.js +60 -0
  39. package/dist/search.js.map +1 -0
  40. package/dist/security.d.ts +20 -0
  41. package/dist/security.d.ts.map +1 -0
  42. package/dist/security.js +53 -0
  43. package/dist/security.js.map +1 -0
  44. package/dist/style.d.ts +45 -0
  45. package/dist/style.d.ts.map +1 -0
  46. package/dist/style.js +173 -0
  47. package/dist/style.js.map +1 -0
  48. package/dist/version.d.ts +3 -0
  49. package/dist/version.d.ts.map +1 -0
  50. package/dist/version.js +5 -0
  51. package/dist/version.js.map +1 -0
  52. package/package.json +56 -4
package/dist/style.js ADDED
@@ -0,0 +1,173 @@
1
+ // Copyright 2026 Remaply
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { apiBaseUrl, apiGet, apiUrl, getText, isReachable } from "./client.js";
4
+ import { currentSettings } from "./config.js";
5
+ // Style preparation, as core/src/commonMain/.../map/MapStyle.kt in the mobile SDK.
6
+ /** Id of the vector tile source in the style. Its URL is replaced with the tiles of the API in use. */
7
+ export const REMAPLY_SOURCE = "remaply";
8
+ /** Label fonts for styles whose `glyphs` cannot be loaded (Remaply's default style may name `mapbox://fonts/...`). */
9
+ export const FALLBACK_GLYPHS = "https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf";
10
+ /** Tile layers of building numbers and buildings. Each feature has a `min_zoom` (18 and 17 in the current tiles). */
11
+ const ADDRESS_SOURCE_LAYER = "addresses";
12
+ const BUILDING_SOURCE_LAYER = "buildings";
13
+ /** The style is not a MapLibre style with a `remaply` source. */
14
+ export class MapStyleError extends Error {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.name = "MapStyleError";
18
+ }
19
+ }
20
+ function isObject(value) {
21
+ return typeof value === "object" && value !== null && !Array.isArray(value);
22
+ }
23
+ /**
24
+ * The Remaply map style, ready for `new maplibregl.Map({ style })`: the style from the API (or
25
+ * `mapStyleUrl`), with its `remaply` source pointed at the tiles of the API in use, the sprite on that
26
+ * API, reachable fonts, and buildings and building numbers from `buildingMinZoom` /
27
+ * `addressNumberMinZoom`.
28
+ *
29
+ * The key is not written into the style: pass {@link transformRequest} to the map, which adds it to
30
+ * requests for the API's origin only. `RemaplyMap` does both for you.
31
+ */
32
+ export async function loadStyle(options = {}) {
33
+ const { signal } = options;
34
+ const s = currentSettings();
35
+ const tileset = s.tileset || "remaply";
36
+ const [styleText, tileJson] = await Promise.all([
37
+ getText(s.mapStyleUrl || apiUrl("/v1/styles/default.json"), signal),
38
+ apiGet(`/v1/tiles/${encodePath(tileset)}.json`, {}, signal),
39
+ ]);
40
+ const prepared = prepareStyle(styleText, tileJson, {
41
+ tileset,
42
+ buildingMinZoom: s.buildingMinZoom,
43
+ addressNumberMinZoom: s.addressNumberMinZoom,
44
+ });
45
+ return withReachableGlyphs(prepared, signal);
46
+ }
47
+ /**
48
+ * The style's fonts when its host serves them, else {@link FALLBACK_GLYPHS}: an API environment can
49
+ * name its own fonts before it serves them, and without fonts the map has no labels at all.
50
+ */
51
+ async function withReachableGlyphs(style, signal) {
52
+ const glyphs = style.glyphs;
53
+ if (!glyphs || glyphs === FALLBACK_GLYPHS)
54
+ return style;
55
+ const font = firstFont(style);
56
+ if (!font)
57
+ return style;
58
+ const probe = glyphs.replace("{fontstack}", encodeURIComponent(font)).replace("{range}", "0-255");
59
+ return (await isReachable(probe, signal)) ? style : { ...style, glyphs: FALLBACK_GLYPHS };
60
+ }
61
+ /** The first font named literally in a symbol layer, for the glyph check and for marker labels. */
62
+ export function firstFont(style) {
63
+ for (const layer of style.layers ?? []) {
64
+ const layout = layer.layout;
65
+ const fonts = layout?.["text-font"];
66
+ if (Array.isArray(fonts) && typeof fonts[0] === "string" && fonts[0] !== "literal")
67
+ return fonts[0];
68
+ // ["literal", ["Noto Sans Regular"]]
69
+ if (Array.isArray(fonts) && fonts[0] === "literal" && Array.isArray(fonts[1]) && typeof fonts[1][0] === "string")
70
+ return fonts[1][0];
71
+ }
72
+ return null;
73
+ }
74
+ /** Exported for tests. See {@link loadStyle}. */
75
+ export function prepareStyle(styleText, tileJson, options) {
76
+ let style;
77
+ try {
78
+ style = JSON.parse(styleText);
79
+ }
80
+ catch {
81
+ style = null;
82
+ }
83
+ const sources = isObject(style) ? style.sources : undefined;
84
+ if (!isObject(style) || style.version !== 8 || !isObject(sources) || sources[REMAPLY_SOURCE] === undefined) {
85
+ throw new MapStyleError(`not a MapLibre style with a "${REMAPLY_SOURCE}" source.`);
86
+ }
87
+ const source = {
88
+ type: "vector",
89
+ tiles: [tileUrl(options.tileset, tileJson)],
90
+ minzoom: tileJson.minzoom ?? 0,
91
+ maxzoom: tileJson.maxzoom ?? 15,
92
+ };
93
+ if (tileJson.bounds?.length === 4)
94
+ source.bounds = tileJson.bounds;
95
+ if (tileJson.attribution)
96
+ source.attribution = tileJson.attribution;
97
+ const updated = { ...style, sources: { ...sources, [REMAPLY_SOURCE]: source } };
98
+ if (style.sprite !== undefined)
99
+ updated.sprite = spriteOnApi(style.sprite);
100
+ const glyphs = style.glyphs;
101
+ if (typeof glyphs !== "string" || !glyphs.startsWith("http"))
102
+ updated.glyphs = FALLBACK_GLYPHS;
103
+ if (Array.isArray(style.layers)) {
104
+ updated.layers = withMinZooms(style.layers, {
105
+ [BUILDING_SOURCE_LAYER]: options.buildingMinZoom,
106
+ [ADDRESS_SOURCE_LAYER]: options.addressNumberMinZoom,
107
+ });
108
+ }
109
+ return updated;
110
+ }
111
+ /**
112
+ * Building and building-number layers from at most the zoom set for their tile layer (null:
113
+ * unchanged): each feature shows from the lower of its own `min_zoom` and that zoom, and a layer
114
+ * `minzoom` above it is lowered to it.
115
+ */
116
+ function withMinZooms(layers, zooms) {
117
+ return layers.map((layer) => {
118
+ if (!isObject(layer) || layer.source !== REMAPLY_SOURCE)
119
+ return layer;
120
+ const sourceLayer = layer["source-layer"];
121
+ if (typeof sourceLayer !== "string")
122
+ return layer;
123
+ const zoom = zooms[sourceLayer];
124
+ if (zoom === null || zoom === undefined)
125
+ return layer;
126
+ const updated = { ...layer };
127
+ if (layer.filter !== undefined)
128
+ updated.filter = capMinZoom(layer.filter, zoom);
129
+ if (typeof layer.minzoom === "number" && layer.minzoom > zoom)
130
+ updated.minzoom = zoom;
131
+ return updated;
132
+ });
133
+ }
134
+ /** Every `["get", "min_zoom"]` becomes `min(min_zoom, zoom)` ([zoom] when the feature has none). */
135
+ function capMinZoom(expression, zoom) {
136
+ if (!Array.isArray(expression))
137
+ return expression;
138
+ if (expression.length === 2 && expression[0] === "get" && expression[1] === "min_zoom") {
139
+ return ["min", ["number", expression, zoom], zoom];
140
+ }
141
+ return expression.map((item) => capMinZoom(item, zoom));
142
+ }
143
+ /**
144
+ * Tile URL template on the API in use. Keeps the query of the TileJSON URL (`?v=`, the tileset
145
+ * version): without it a rebuilt tileset would show a mix of old and new cached tiles. A `key` in
146
+ * that query is dropped: {@link transformRequest} adds the current one.
147
+ */
148
+ export function tileUrl(tileset, tileJson) {
149
+ const first = tileJson.tiles[0] ?? "";
150
+ const queryStart = first.indexOf("?");
151
+ const params = new URLSearchParams(queryStart >= 0 ? first.slice(queryStart + 1) : "");
152
+ params.delete("key");
153
+ const query = params.toString();
154
+ // Template braces must stay literal, so the URL is built as text, not with URL().
155
+ return `${apiBaseUrl()}/v1/tiles/${encodePath(tileset)}/{z}/{x}/{y}.mvt${query ? `?${query}` : ""}`;
156
+ }
157
+ /** The style's sprite (POI icons) on the API in use. */
158
+ function spriteOnApi(sprite) {
159
+ const onApi = (url) => {
160
+ const path = /\/v1\/sprites\/[a-z0-9_-]+(?=[?#]|$)/.exec(url)?.[0];
161
+ return path ? `${apiBaseUrl()}${path}` : url;
162
+ };
163
+ if (typeof sprite === "string")
164
+ return onApi(sprite);
165
+ if (Array.isArray(sprite)) {
166
+ return sprite.map((item) => (isObject(item) && typeof item.url === "string" ? { ...item, url: onApi(item.url) } : item));
167
+ }
168
+ return sprite;
169
+ }
170
+ function encodePath(value) {
171
+ return value.replace(/[^A-Za-z0-9_-]/g, "");
172
+ }
173
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.js","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,sCAAsC;AAGtC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MA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.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAGA,4EAA4E;AAC5E,eAAO,MAAM,OAAO,UAAU,CAAC"}
@@ -0,0 +1,5 @@
1
+ // Copyright 2026 Remaply
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ /** Must equal `version` in package.json; test/version.test.ts checks it. */
4
+ export const VERSION = "0.2.0";
5
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,sCAAsC;AAEtC,4EAA4E;AAC5E,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,58 @@
1
1
  {
2
2
  "name": "@remaply/maps",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Remaply Maps for the web: the Remaply map on MapLibre GL JS, markers, routes, place search and directions.",
5
+ "license": "Apache-2.0",
6
+ "author": "Remaply",
7
+ "homepage": "https://github.com/Remaply-Fiji/remaply-maps-sdk/tree/main/web#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Remaply-Fiji/remaply-maps-sdk.git",
11
+ "directory": "web"
12
+ },
13
+ "bugs": "https://github.com/Remaply-Fiji/remaply-maps-sdk/issues",
14
+ "keywords": [
15
+ "remaply",
16
+ "maps",
17
+ "maplibre",
18
+ "fiji",
19
+ "search",
20
+ "directions",
21
+ "geocoding"
22
+ ],
23
+ "type": "module",
24
+ "main": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "import": "./dist/index.js"
30
+ },
31
+ "./package.json": "./package.json"
32
+ },
33
+ "files": [
34
+ "dist",
35
+ "README.md",
36
+ "LICENSE",
37
+ "NOTICE"
38
+ ],
39
+ "sideEffects": false,
40
+ "engines": {
41
+ "node": ">=18"
42
+ },
43
+ "scripts": {
44
+ "build": "rm -rf dist && tsc -p tsconfig.build.json",
45
+ "typecheck": "tsc -p tsconfig.json --noEmit",
46
+ "test": "vitest run",
47
+ "prepack": "cp ../LICENSE ../NOTICE . && npm run build"
48
+ },
49
+ "peerDependencies": {
50
+ "maplibre-gl": "^5.0.0 || ^6.0.0"
51
+ },
52
+ "devDependencies": {
53
+ "maplibre-gl": "6.18.0",
54
+ "typescript": "5.9.3",
55
+ "vite": "7.3.8",
56
+ "vitest": "5.1.0"
57
+ }
58
+ }