ropegeo-common 1.12.13 → 1.13.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 (31) hide show
  1. package/README.md +15 -1
  2. package/dist/components/RopeGeoCursorPaginationHttpRequest.d.ts.map +1 -1
  3. package/dist/components/RopeGeoCursorPaginationHttpRequest.js +15 -2
  4. package/dist/models/index.d.ts +5 -0
  5. package/dist/models/index.d.ts.map +1 -1
  6. package/dist/models/index.js +14 -2
  7. package/dist/models/minimap/abstract/pageMiniMap.d.ts +6 -1
  8. package/dist/models/minimap/abstract/pageMiniMap.d.ts.map +1 -1
  9. package/dist/models/minimap/abstract/pageMiniMap.js +9 -1
  10. package/dist/models/minimap/concrete/offlinePageMiniMap.d.ts +2 -1
  11. package/dist/models/minimap/concrete/offlinePageMiniMap.d.ts.map +1 -1
  12. package/dist/models/minimap/concrete/offlinePageMiniMap.js +7 -3
  13. package/dist/models/minimap/concrete/onlinePageMiniMap.d.ts +2 -1
  14. package/dist/models/minimap/concrete/onlinePageMiniMap.d.ts.map +1 -1
  15. package/dist/models/minimap/concrete/onlinePageMiniMap.js +3 -3
  16. package/dist/models/minimap/legend/abstract/legendFeatureType.d.ts +10 -0
  17. package/dist/models/minimap/legend/abstract/legendFeatureType.d.ts.map +1 -0
  18. package/dist/models/minimap/legend/abstract/legendFeatureType.js +13 -0
  19. package/dist/models/minimap/legend/abstract/legendItem.d.ts +23 -0
  20. package/dist/models/minimap/legend/abstract/legendItem.d.ts.map +1 -0
  21. package/dist/models/minimap/legend/abstract/legendItem.js +59 -0
  22. package/dist/models/minimap/legend/concrete/lineLegendItem.d.ts +13 -0
  23. package/dist/models/minimap/legend/concrete/lineLegendItem.d.ts.map +1 -0
  24. package/dist/models/minimap/legend/concrete/lineLegendItem.js +64 -0
  25. package/dist/models/minimap/legend/concrete/pointLegendItem.d.ts +18 -0
  26. package/dist/models/minimap/legend/concrete/pointLegendItem.d.ts.map +1 -0
  27. package/dist/models/minimap/legend/concrete/pointLegendItem.js +58 -0
  28. package/dist/models/minimap/legend/concrete/polygonLegendItem.d.ts +13 -0
  29. package/dist/models/minimap/legend/concrete/polygonLegendItem.d.ts.map +1 -0
  30. package/dist/models/minimap/legend/concrete/polygonLegendItem.js +64 -0
  31. package/package.json +1 -1
package/README.md CHANGED
@@ -254,13 +254,27 @@ Abstract classes live under `minimap/abstract/`, concrete under `minimap/concret
254
254
  | `RegionMiniMap` | `MiniMap` | Abstract region minimap (`miniMapType: region`); online/offline concrete subclasses. | `import { RegionMiniMap } from 'ropegeo-common/models'` |
255
255
  | `OnlineRegionMiniMap` | `RegionMiniMap` | API region routes (`routesParams`, `bounds` or null, `fetchType: "online"`). | `import { OnlineRegionMiniMap } from 'ropegeo-common/models'` |
256
256
  | `OfflineRegionMiniMap` | `RegionMiniMap` | Bundled region routes GeoJSON path (`downloadedGeojson`, `fetchType: "offline"`). | `import { OfflineRegionMiniMap } from 'ropegeo-common/models'` |
257
- | `PageMiniMap` | `MiniMap` | Abstract page minimap (`miniMapType: page`); online/offline tile templates. | `import { PageMiniMap } from 'ropegeo-common/models'` |
257
+ | `PageMiniMap` | `MiniMap` | Abstract page minimap (`miniMapType: page`); online/offline tile templates and optional `legend`. | `import { PageMiniMap } from 'ropegeo-common/models'` |
258
258
  | `OnlinePageMiniMap` | `PageMiniMap` | API page tiles template (`onlineTilesTemplate`, `fetchType: "online"`). | `import { OnlinePageMiniMap } from 'ropegeo-common/models'` |
259
259
  | `OfflinePageMiniMap` | `PageMiniMap` | Persisted local tiles template (`offlineTilesTemplate`, `fetchType: "offline"`). | `import { OfflinePageMiniMap } from 'ropegeo-common/models'` |
260
260
  | `CenteredRegionMiniMap` | `MiniMap` | Abstract centered-route minimap (`miniMapType: centeredRegion`). | `import { CenteredRegionMiniMap } from 'ropegeo-common/models'` |
261
261
  | `OnlineCenteredRegionMiniMap` | `CenteredRegionMiniMap` | API centered-route fallback (`routesParams`, `fetchType: "online"`). | `import { OnlineCenteredRegionMiniMap } from 'ropegeo-common/models'` |
262
262
  | `OfflineCenteredRegionMiniMap` | `CenteredRegionMiniMap` | Persisted local centered-route geojson (`downloadedGeojson`, `fetchType: "offline"`). | `import { OfflineCenteredRegionMiniMap } from 'ropegeo-common/models'` |
263
263
 
264
+ ### Minimap legend (`src/models/minimap/legend/`)
265
+
266
+ Legend entries for page minimaps are keyed objects (`legend` on `PageMiniMap`); each value is validated by `featureType` like `MiniMap`.
267
+
268
+ | Name | Base class | Description | Import |
269
+ | --- | --- | --- | --- |
270
+ | `LegendFeatureType` | N/A | Discriminator for legend wire payloads (`point`, `line`, `polygon`). | `import { LegendFeatureType } from 'ropegeo-common/models'` |
271
+ | `LEGEND_FEATURE_TYPES` | N/A | Set of allowed `LegendItem.featureType` string values. | `import { LEGEND_FEATURE_TYPES } from 'ropegeo-common/models'` |
272
+ | `LegendItem` | N/A | Abstract legend entry; `fromResult` dispatches on `featureType`. | `import { LegendItem } from 'ropegeo-common/models'` |
273
+ | `registerLegendItemParser` | N/A | Registers a `LegendItem` parser for a `LegendFeatureType` (extension point). | `import { registerLegendItemParser } from 'ropegeo-common/models'` |
274
+ | `PointLegendItem` | `LegendItem` | Point legend entry (`coordinates`, optional `icon`). | `import { PointLegendItem } from 'ropegeo-common/models'` |
275
+ | `LineLegendItem` | `LegendItem` | Line legend entry (`bounds`, optional stroke fields). | `import { LineLegendItem } from 'ropegeo-common/models'` |
276
+ | `PolygonLegendItem` | `LegendItem` | Polygon legend entry (`bounds`, optional border/fill colors). | `import { PolygonLegendItem } from 'ropegeo-common/models'` |
277
+
264
278
  ### Link preview (`src/models/linkPreview/`)
265
279
 
266
280
  | Name | Base class | Description | Import |
@@ -1 +1 @@
1
- {"version":3,"file":"RopeGeoCursorPaginationHttpRequest.d.ts","sourceRoot":"","sources":["../../src/components/RopeGeoCursorPaginationHttpRequest.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvC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5C"}
1
+ {"version":3,"file":"RopeGeoCursorPaginationHttpRequest.d.ts","sourceRoot":"","sources":["../../src/components/RopeGeoCursorPaginationHttpRequest.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvC,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAoB,MAAM,sBAAsB,CAAC;AAsCzE,MAAM,MAAM,uCAAuC,CAAC,CAAC,GAAG,OAAO,IAAI;IACjE,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,CAAC;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,WAAW,EAAE,sBAAsB,CAAC;IACpC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE;QACf,OAAO,EAAE,OAAO,CAAC;QACjB,WAAW,EAAE,OAAO,CAAC;QACrB;;;WAGG;QACH,UAAU,EAAE,OAAO,CAAC;QACpB,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC;QACjB,MAAM,EAAE,KAAK,GAAG,IAAI,CAAC;QACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;QACrB,OAAO,EAAE,OAAO,CAAC;QACjB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;QAChC;;;;WAIG;QACH,MAAM,EAAE,MAAM,IAAI,CAAC;KACpB,KAAK,SAAS,CAAC;CACjB,CAAC;AAEF,wBAAgB,kCAAkC,CAAC,CAAC,GAAG,OAAO,EAAE,EAC9D,OAAO,EACP,MAAmB,EACnB,IAAI,EACJ,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,QAAQ,EACR,kBAA0B,EAC1B,QAAQ,GACT,EAAE,uCAAuC,CAAC,CAAC,CAAC,2CAyY5C"}
@@ -297,10 +297,16 @@ function RopeGeoCursorPaginationHttpRequest({ service, method = RopeGeoHttpReque
297
297
  fetch(url, init)
298
298
  .then(async (res) => {
299
299
  const text = await res.text();
300
- if (!res.ok)
300
+ if (!res.ok) {
301
+ setErrors(new Error((0, network_1.formatHttpStatusMessage)(res.status, text || res.statusText)));
302
+ setParams((p) => p.withCursor(null));
301
303
  return;
302
- if (text.length === 0)
304
+ }
305
+ if (text.length === 0) {
306
+ setErrors(null);
307
+ setParams((p) => p.withCursor(null));
303
308
  return;
309
+ }
304
310
  try {
305
311
  const raw = JSON.parse(text);
306
312
  const body = getResponseBody(raw);
@@ -308,6 +314,7 @@ function RopeGeoCursorPaginationHttpRequest({ service, method = RopeGeoHttpReque
308
314
  const { results, nextCursor } = result;
309
315
  setData((prev) => [...(prev ?? []), ...results]);
310
316
  setParams((p) => p.withCursor(nextCursor));
317
+ setErrors(null);
311
318
  }
312
319
  catch (parseError) {
313
320
  console.error("[RopeGeoCursorPaginationHttpRequest] loadMore: Invalid JSON response", {
@@ -316,6 +323,8 @@ function RopeGeoCursorPaginationHttpRequest({ service, method = RopeGeoHttpReque
316
323
  responseText: text.slice(0, 500),
317
324
  parseError: parseError instanceof Error ? parseError.message : String(parseError),
318
325
  });
326
+ setErrors(new Error("Invalid JSON response"));
327
+ setParams((p) => p.withCursor(null));
319
328
  }
320
329
  })
321
330
  .catch((err) => {
@@ -323,6 +332,8 @@ function RopeGeoCursorPaginationHttpRequest({ service, method = RopeGeoHttpReque
323
332
  return;
324
333
  if (timedOutRef.current) {
325
334
  console.error("[RopeGeoCursorPaginationHttpRequest] loadMore: timed out", { url });
335
+ setErrors(new Error((0, network_1.formatNetworkRequestErrorMessage)(new Error(network_1.NETWORK_REQUEST_TIMED_OUT_MESSAGE))));
336
+ setParams((p) => p.withCursor(null));
326
337
  return;
327
338
  }
328
339
  if ((0, network_1.isAbortError)(err))
@@ -331,6 +342,8 @@ function RopeGeoCursorPaginationHttpRequest({ service, method = RopeGeoHttpReque
331
342
  url,
332
343
  error: err instanceof Error ? err.message : String(err),
333
344
  });
345
+ setErrors(new Error((0, network_1.formatNetworkRequestErrorMessage)(err)));
346
+ setParams((p) => p.withCursor(null));
334
347
  })
335
348
  .finally(() => {
336
349
  policyDispose();
@@ -44,6 +44,11 @@ export { BetaSection } from './betaSections/betaSection';
44
44
  export { OnlineBetaSection } from './betaSections/onlineBetaSection';
45
45
  export { OfflineBetaSection } from './betaSections/offlineBetaSection';
46
46
  export { Bounds } from './minimap/bounds';
47
+ export { LegendFeatureType, LEGEND_FEATURE_TYPES } from './minimap/legend/abstract/legendFeatureType';
48
+ export { LegendItem, registerLegendItemParser } from './minimap/legend/abstract/legendItem';
49
+ export { PointLegendItem } from './minimap/legend/concrete/pointLegendItem';
50
+ export { LineLegendItem } from './minimap/legend/concrete/lineLegendItem';
51
+ export { PolygonLegendItem } from './minimap/legend/concrete/polygonLegendItem';
47
52
  export { MiniMapType } from './minimap/abstract/miniMapType';
48
53
  export type { OnlineMiniMap } from './minimap/abstract/onlineMiniMap';
49
54
  export type { OfflineMiniMap } from './minimap/abstract/offlineMiniMap';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,wCAAwC,CAAC;AAChD,OAAO,wCAAwC,CAAC;AAChD,OAAO,kDAAkD,CAAC;AAC1D,OAAO,8CAA8C,CAAC;AACtD,OAAO,2CAA2C,CAAC;AACnD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,qCAAqC,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;A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", { value: true });
3
3
  exports.RoutesGeojson = exports.RouteType = exports.RouteGeoJsonFeature = exports.Route = exports.RegionPreview = exports.OfflinePagePreview = exports.OnlinePagePreview = exports.PagePreview = exports.PreviewType = exports.Preview = exports.PermitStatus = exports.SavedFilters = exports.SavedPagesFilter = exports.SearchFilter = exports.RouteFilter = exports.RiskMinMax = exports.TimeMinMax = exports.WaterMinMax = exports.TechnicalMinMax = exports.AcaDifficultyFilterOptions = exports.registerDifficultyFilterOptionsParser = exports.DifficultyFilterOptions = exports.Q_ACA_RISK = exports.Q_ACA_TIME = exports.Q_ACA_WATER = exports.Q_ACA_TECHNICAL = exports.Q_DIFFICULTY_TYPE = exports.AcaDifficultyParams = exports.isDifficultyParamsActive = exports.registerDifficultyParamsQueryParser = exports.registerDifficultyParamsQueryInference = exports.DifficultyParams = exports.DifficultyRisk = exports.DifficultyTime = exports.DifficultyWater = exports.DifficultyTechnical = exports.AcaDifficulty = exports.RISK_ORDER = exports.AcaWaterRating = exports.AcaTimeRating = exports.AcaTechnicalRating = exports.AcaRiskRating = exports.ACA_WATER_ORDER = exports.ACA_TIME_ORDER = exports.ACA_TECHNICAL_ORDER = exports.ACA_RISK_ORDER = exports.registerDifficultyParser = exports.Difficulty = exports.DifficultyType = exports.PageDataSource = void 0;
4
- exports.RegionPreviewsCursor = exports.RopewikiRegionViewResult = exports.RopewikiRegionView = exports.SearchResults = exports.SearchParams = exports.SearchCursor = exports.MapDataTileKeysResults = exports.registerPaginationParser = exports.PaginationResultType = exports.PaginationResults = exports.registerCursorPaginationParser = exports.CursorPaginationResultType = exports.CursorPaginationResults = exports.registerResultParser = exports.ResultType = exports.Result = exports.PaginationParams = exports.CursorPaginationParams = exports.CursorType = exports.Cursor = exports.RopewikiPageLinkPreviewResult = exports.LinkPreviewImage = exports.LinkPreview = exports.OfflineRopewikiPageView = exports.OnlineRopewikiPageView = exports.BaseRopewikiPageView = exports.PageViewType = exports.RopewikiPageViewResult = exports.RopewikiPageView = exports.OfflineCenteredRegionMiniMap = exports.OnlineCenteredRegionMiniMap = exports.OfflineRegionMiniMap = exports.OnlineRegionMiniMap = exports.OfflinePageMiniMap = exports.OnlinePageMiniMap = exports.CenteredRegionMiniMap = exports.PageMiniMap = exports.RegionMiniMap = exports.MiniMap = exports.MiniMapType = exports.Bounds = exports.OfflineBetaSection = exports.OnlineBetaSection = exports.BetaSection = exports.DownloadBytes = exports.OfflineBetaSectionImage = exports.OnlineBetaSectionImage = exports.BetaSectionImage = exports.RoutesParams = exports.RouteResult = void 0;
5
- exports.DOWNLOADED_ROUTE_PREVIEWS_STORAGE_KEY = exports.SAVED_PAGES_STORAGE_KEY = exports.SavedPage = exports.ImageVersions = exports.VERSION_FORMAT = exports.ImageVersion = exports.RoutePreviewResult = exports.RopewikiRegionImagesResult = exports.RopewikiRegionImagesParams = exports.RopewikiRegionImageView = exports.RegionImagesCursor = exports.RopewikiRegionPreviewsResult = exports.RopewikiRegionPreviewsParams = void 0;
4
+ exports.registerPaginationParser = exports.PaginationResultType = exports.PaginationResults = exports.registerCursorPaginationParser = exports.CursorPaginationResultType = exports.CursorPaginationResults = exports.registerResultParser = exports.ResultType = exports.Result = exports.PaginationParams = exports.CursorPaginationParams = exports.CursorType = exports.Cursor = exports.RopewikiPageLinkPreviewResult = exports.LinkPreviewImage = exports.LinkPreview = exports.OfflineRopewikiPageView = exports.OnlineRopewikiPageView = exports.BaseRopewikiPageView = exports.PageViewType = exports.RopewikiPageViewResult = exports.RopewikiPageView = exports.OfflineCenteredRegionMiniMap = exports.OnlineCenteredRegionMiniMap = exports.OfflineRegionMiniMap = exports.OnlineRegionMiniMap = exports.OfflinePageMiniMap = exports.OnlinePageMiniMap = exports.CenteredRegionMiniMap = exports.PageMiniMap = exports.RegionMiniMap = exports.MiniMap = exports.MiniMapType = exports.PolygonLegendItem = exports.LineLegendItem = exports.PointLegendItem = exports.registerLegendItemParser = exports.LegendItem = exports.LEGEND_FEATURE_TYPES = exports.LegendFeatureType = exports.Bounds = exports.OfflineBetaSection = exports.OnlineBetaSection = exports.BetaSection = exports.DownloadBytes = exports.OfflineBetaSectionImage = exports.OnlineBetaSectionImage = exports.BetaSectionImage = exports.RoutesParams = exports.RouteResult = void 0;
5
+ exports.DOWNLOADED_ROUTE_PREVIEWS_STORAGE_KEY = exports.SAVED_PAGES_STORAGE_KEY = exports.SavedPage = exports.ImageVersions = exports.VERSION_FORMAT = exports.ImageVersion = exports.RoutePreviewResult = exports.RopewikiRegionImagesResult = exports.RopewikiRegionImagesParams = exports.RopewikiRegionImageView = exports.RegionImagesCursor = exports.RopewikiRegionPreviewsResult = exports.RopewikiRegionPreviewsParams = exports.RegionPreviewsCursor = exports.RopewikiRegionViewResult = exports.RopewikiRegionView = exports.SearchResults = exports.SearchParams = exports.SearchCursor = exports.MapDataTileKeysResults = void 0;
6
6
  require("./api/results/registerAllResultParsers");
7
7
  require("./difficulty/registerDifficultyParsers");
8
8
  require("./filters/registerDifficultyFilterOptionsParsers");
@@ -109,6 +109,18 @@ var offlineBetaSection_1 = require("./betaSections/offlineBetaSection");
109
109
  Object.defineProperty(exports, "OfflineBetaSection", { enumerable: true, get: function () { return offlineBetaSection_1.OfflineBetaSection; } });
110
110
  var bounds_1 = require("./minimap/bounds");
111
111
  Object.defineProperty(exports, "Bounds", { enumerable: true, get: function () { return bounds_1.Bounds; } });
112
+ var legendFeatureType_1 = require("./minimap/legend/abstract/legendFeatureType");
113
+ Object.defineProperty(exports, "LegendFeatureType", { enumerable: true, get: function () { return legendFeatureType_1.LegendFeatureType; } });
114
+ Object.defineProperty(exports, "LEGEND_FEATURE_TYPES", { enumerable: true, get: function () { return legendFeatureType_1.LEGEND_FEATURE_TYPES; } });
115
+ var legendItem_1 = require("./minimap/legend/abstract/legendItem");
116
+ Object.defineProperty(exports, "LegendItem", { enumerable: true, get: function () { return legendItem_1.LegendItem; } });
117
+ Object.defineProperty(exports, "registerLegendItemParser", { enumerable: true, get: function () { return legendItem_1.registerLegendItemParser; } });
118
+ var pointLegendItem_1 = require("./minimap/legend/concrete/pointLegendItem");
119
+ Object.defineProperty(exports, "PointLegendItem", { enumerable: true, get: function () { return pointLegendItem_1.PointLegendItem; } });
120
+ var lineLegendItem_1 = require("./minimap/legend/concrete/lineLegendItem");
121
+ Object.defineProperty(exports, "LineLegendItem", { enumerable: true, get: function () { return lineLegendItem_1.LineLegendItem; } });
122
+ var polygonLegendItem_1 = require("./minimap/legend/concrete/polygonLegendItem");
123
+ Object.defineProperty(exports, "PolygonLegendItem", { enumerable: true, get: function () { return polygonLegendItem_1.PolygonLegendItem; } });
112
124
  var miniMapType_1 = require("./minimap/abstract/miniMapType");
113
125
  Object.defineProperty(exports, "MiniMapType", { enumerable: true, get: function () { return miniMapType_1.MiniMapType; } });
114
126
  var miniMap_1 = require("./minimap/abstract/miniMap");
@@ -1,5 +1,9 @@
1
1
  import type { FetchType } from '../../fetchType';
2
2
  import { Bounds } from '../bounds';
3
+ import { LegendItem } from '../legend/abstract/legendItem';
4
+ import '../legend/concrete/lineLegendItem';
5
+ import '../legend/concrete/pointLegendItem';
6
+ import '../legend/concrete/polygonLegendItem';
3
7
  import { MiniMap } from './miniMap';
4
8
  import { MiniMapType } from './miniMapType';
5
9
  export declare function registerPageMiniMapParser(fetchType: FetchType, parse: (result: unknown) => PageMiniMap): void;
@@ -11,7 +15,8 @@ export declare abstract class PageMiniMap extends MiniMap {
11
15
  readonly miniMapType = MiniMapType.Page;
12
16
  layerId: string;
13
17
  bounds: Bounds;
14
- protected constructor(layerId: string, bounds: Bounds, title: string);
18
+ legend?: Record<string, LegendItem>;
19
+ protected constructor(layerId: string, bounds: Bounds, title: string, legend?: Record<string, LegendItem>);
15
20
  static fromResult(result: unknown): PageMiniMap;
16
21
  protected static validateCommonFields(r: Record<string, unknown>, expectedFetchType: FetchType, context: string): void;
17
22
  protected static assertTemplate(value: unknown, keyName: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"pageMiniMap.d.ts","sourceRoot":"","sources":["../../../../src/models/minimap/abstract/pageMiniMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,wBAAgB,yBAAyB,CACrC,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,WAAW,GACxC,IAAI,CAEN;AAED;;GAEG;AACH,8BAAsB,WAAY,SAAQ,OAAO;IAC7C,QAAQ,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IACvC,QAAQ,CAAC,WAAW,oBAAoB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IAEf,SAAS,aAAa,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAMpE,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,WAAW;IAuB/C,SAAS,CAAC,MAAM,CAAC,oBAAoB,CACjC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1B,iBAAiB,EAAE,SAAS,EAC5B,OAAO,EAAE,MAAM,GAChB,IAAI;IAoBP,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;CAQzE"}
1
+ {"version":3,"file":"pageMiniMap.d.ts","sourceRoot":"","sources":["../../../../src/models/minimap/abstract/pageMiniMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,mCAAmC,CAAC;AAC3C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,sCAAsC,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,wBAAgB,yBAAyB,CACrC,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,WAAW,GACxC,IAAI,CAEN;AAED;;GAEG;AACH,8BAAsB,WAAY,SAAQ,OAAO;IAC7C,QAAQ,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IACvC,QAAQ,CAAC,WAAW,oBAAoB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAEpC,SAAS,aAAa,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;IAOzG,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,WAAW;IAuB/C,SAAS,CAAC,MAAM,CAAC,oBAAoB,CACjC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1B,iBAAiB,EAAE,SAAS,EAC5B,OAAO,EAAE,MAAM,GAChB,IAAI;IAuBP,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;CAQzE"}
@@ -3,6 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PageMiniMap = void 0;
4
4
  exports.registerPageMiniMapParser = registerPageMiniMapParser;
5
5
  const bounds_1 = require("../bounds");
6
+ const legendItem_1 = require("../legend/abstract/legendItem");
7
+ require("../legend/concrete/lineLegendItem");
8
+ require("../legend/concrete/pointLegendItem");
9
+ require("../legend/concrete/polygonLegendItem");
6
10
  const miniMap_1 = require("./miniMap");
7
11
  const miniMapType_1 = require("./miniMapType");
8
12
  const pageMiniMapParsers = new Map();
@@ -13,11 +17,12 @@ function registerPageMiniMapParser(fetchType, parse) {
13
17
  * Page minimap: vector tiles for a single route/page.
14
18
  */
15
19
  class PageMiniMap extends miniMap_1.MiniMap {
16
- constructor(layerId, bounds, title) {
20
+ constructor(layerId, bounds, title, legend) {
17
21
  super(title);
18
22
  this.miniMapType = miniMapType_1.MiniMapType.Page;
19
23
  this.layerId = layerId;
20
24
  this.bounds = bounds;
25
+ this.legend = legend;
21
26
  }
22
27
  static fromResult(result) {
23
28
  if (result == null || typeof result !== 'object') {
@@ -51,6 +56,9 @@ class PageMiniMap extends miniMap_1.MiniMap {
51
56
  }
52
57
  r.title = title;
53
58
  r.bounds = bounds_1.Bounds.fromResult(r.bounds);
59
+ if ('legend' in r && r.legend !== undefined) {
60
+ r.legend = legendItem_1.LegendItem.legendRecordFromResult(r.legend, `${context}.legend`);
61
+ }
54
62
  }
55
63
  static assertTemplate(value, keyName) {
56
64
  if (typeof value !== 'string') {
@@ -1,10 +1,11 @@
1
1
  import { Bounds } from '../bounds';
2
2
  import type { OfflineMiniMap } from '../abstract/offlineMiniMap';
3
3
  import { PageMiniMap } from '../abstract/pageMiniMap';
4
+ import type { LegendItem } from '../legend/abstract/legendItem';
4
5
  export declare class OfflinePageMiniMap extends PageMiniMap implements OfflineMiniMap {
5
6
  readonly fetchType: "offline";
6
7
  offlineTilesTemplate: string;
7
- constructor(layerId: string, offlineTilesTemplate: string, bounds: Bounds, title: string);
8
+ constructor(layerId: string, offlineTilesTemplate: string, bounds: Bounds, title: string, legend?: Record<string, LegendItem>);
8
9
  toPlain(): Record<string, unknown>;
9
10
  static fromResult(result: unknown): OfflinePageMiniMap;
10
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"offlinePageMiniMap.d.ts","sourceRoot":"","sources":["../../../../src/models/minimap/concrete/offlinePageMiniMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,WAAW,EAA6B,MAAM,yBAAyB,CAAC;AAEjF,qBAAa,kBAAmB,SAAQ,WAAY,YAAW,cAAc;IACzE,QAAQ,CAAC,SAAS,EAAG,SAAS,CAAU;IACxC,oBAAoB,EAAE,MAAM,CAAC;gBAEjB,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAKxF,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAgBlC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,kBAAkB;CAUzD"}
1
+ {"version":3,"file":"offlinePageMiniMap.d.ts","sourceRoot":"","sources":["../../../../src/models/minimap/concrete/offlinePageMiniMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,WAAW,EAA6B,MAAM,yBAAyB,CAAC;AACjF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,qBAAa,kBAAmB,SAAQ,WAAY,YAAW,cAAc;IACzE,QAAQ,CAAC,SAAS,EAAG,SAAS,CAAU;IACxC,oBAAoB,EAAE,MAAM,CAAC;gBAGzB,OAAO,EAAE,MAAM,EACf,oBAAoB,EAAE,MAAM,EAC5B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;IAMvC,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAsBlC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,kBAAkB;CAUzD"}
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OfflinePageMiniMap = void 0;
4
4
  const pageMiniMap_1 = require("../abstract/pageMiniMap");
5
5
  class OfflinePageMiniMap extends pageMiniMap_1.PageMiniMap {
6
- constructor(layerId, offlineTilesTemplate, bounds, title) {
7
- super(layerId, bounds, title);
6
+ constructor(layerId, offlineTilesTemplate, bounds, title, legend) {
7
+ super(layerId, bounds, title, legend);
8
8
  this.fetchType = 'offline';
9
9
  this.offlineTilesTemplate = offlineTilesTemplate;
10
10
  }
11
11
  toPlain() {
12
- return {
12
+ const plain = {
13
13
  fetchType: this.fetchType,
14
14
  miniMapType: this.miniMapType,
15
15
  layerId: this.layerId,
@@ -22,6 +22,10 @@ class OfflinePageMiniMap extends pageMiniMap_1.PageMiniMap {
22
22
  },
23
23
  title: this.title,
24
24
  };
25
+ if (this.legend !== undefined) {
26
+ plain.legend = Object.fromEntries(Object.entries(this.legend).map(([key, item]) => [key, item.toPlain()]));
27
+ }
28
+ return plain;
25
29
  }
26
30
  static fromResult(result) {
27
31
  if (result == null || typeof result !== 'object') {
@@ -1,11 +1,12 @@
1
1
  import { Bounds } from '../bounds';
2
2
  import type { OnlineMiniMap } from '../abstract/onlineMiniMap';
3
3
  import { PageMiniMap } from '../abstract/pageMiniMap';
4
+ import type { LegendItem } from '../legend/abstract/legendItem';
4
5
  import { OfflinePageMiniMap } from './offlinePageMiniMap';
5
6
  export declare class OnlinePageMiniMap extends PageMiniMap implements OnlineMiniMap {
6
7
  readonly fetchType: "online";
7
8
  onlineTilesTemplate: string;
8
- constructor(layerId: string, onlineTilesTemplate: string, bounds: Bounds, title: string);
9
+ constructor(layerId: string, onlineTilesTemplate: string, bounds: Bounds, title: string, legend?: Record<string, LegendItem>);
9
10
  toOffline(offlineTilesTemplate: string): OfflinePageMiniMap;
10
11
  static fromResult(result: unknown): OnlinePageMiniMap;
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"onlinePageMiniMap.d.ts","sourceRoot":"","sources":["../../../../src/models/minimap/concrete/onlinePageMiniMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAA6B,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,qBAAa,iBAAkB,SAAQ,WAAY,YAAW,aAAa;IACvE,QAAQ,CAAC,SAAS,EAAG,QAAQ,CAAU;IACvC,mBAAmB,EAAE,MAAM,CAAC;gBAEhB,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAKvF,SAAS,CAAC,oBAAoB,EAAE,MAAM,GAAG,kBAAkB;IAI3D,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,iBAAiB;CAUxD"}
1
+ {"version":3,"file":"onlinePageMiniMap.d.ts","sourceRoot":"","sources":["../../../../src/models/minimap/concrete/onlinePageMiniMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAA6B,MAAM,yBAAyB,CAAC;AACjF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,qBAAa,iBAAkB,SAAQ,WAAY,YAAW,aAAa;IACvE,QAAQ,CAAC,SAAS,EAAG,QAAQ,CAAU;IACvC,mBAAmB,EAAE,MAAM,CAAC;gBAGxB,OAAO,EAAE,MAAM,EACf,mBAAmB,EAAE,MAAM,EAC3B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;IAMvC,SAAS,CAAC,oBAAoB,EAAE,MAAM,GAAG,kBAAkB;IAI3D,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,iBAAiB;CAUxD"}
@@ -4,13 +4,13 @@ exports.OnlinePageMiniMap = void 0;
4
4
  const pageMiniMap_1 = require("../abstract/pageMiniMap");
5
5
  const offlinePageMiniMap_1 = require("./offlinePageMiniMap");
6
6
  class OnlinePageMiniMap extends pageMiniMap_1.PageMiniMap {
7
- constructor(layerId, onlineTilesTemplate, bounds, title) {
8
- super(layerId, bounds, title);
7
+ constructor(layerId, onlineTilesTemplate, bounds, title, legend) {
8
+ super(layerId, bounds, title, legend);
9
9
  this.fetchType = 'online';
10
10
  this.onlineTilesTemplate = onlineTilesTemplate;
11
11
  }
12
12
  toOffline(offlineTilesTemplate) {
13
- return new offlinePageMiniMap_1.OfflinePageMiniMap(this.layerId, offlineTilesTemplate, this.bounds, this.title);
13
+ return new offlinePageMiniMap_1.OfflinePageMiniMap(this.layerId, offlineTilesTemplate, this.bounds, this.title, this.legend);
14
14
  }
15
15
  static fromResult(result) {
16
16
  if (result == null || typeof result !== 'object') {
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Discriminator for {@link LegendItem} wire payloads (`featureType` field).
3
+ */
4
+ export declare enum LegendFeatureType {
5
+ Point = "point",
6
+ Line = "line",
7
+ Polygon = "polygon"
8
+ }
9
+ export declare const LEGEND_FEATURE_TYPES: ReadonlySet<string>;
10
+ //# sourceMappingURL=legendFeatureType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legendFeatureType.d.ts","sourceRoot":"","sources":["../../../../../src/models/minimap/legend/abstract/legendFeatureType.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,iBAAiB;IACzB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,OAAO,YAAY;CACtB;AAED,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,MAAM,CAEpD,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LEGEND_FEATURE_TYPES = exports.LegendFeatureType = void 0;
4
+ /**
5
+ * Discriminator for {@link LegendItem} wire payloads (`featureType` field).
6
+ */
7
+ var LegendFeatureType;
8
+ (function (LegendFeatureType) {
9
+ LegendFeatureType["Point"] = "point";
10
+ LegendFeatureType["Line"] = "line";
11
+ LegendFeatureType["Polygon"] = "polygon";
12
+ })(LegendFeatureType || (exports.LegendFeatureType = LegendFeatureType = {}));
13
+ exports.LEGEND_FEATURE_TYPES = new Set(Object.values(LegendFeatureType));
@@ -0,0 +1,23 @@
1
+ import { LegendFeatureType } from './legendFeatureType';
2
+ export declare function registerLegendItemParser(featureType: LegendFeatureType, parse: (result: unknown) => LegendItem): void;
3
+ /**
4
+ * Base type for page minimap legend entries. Use {@link LegendItem.fromResult} to parse API wire shapes.
5
+ */
6
+ export declare abstract class LegendItem {
7
+ abstract readonly featureType: LegendFeatureType;
8
+ readonly id: string;
9
+ readonly name: string;
10
+ protected constructor(id: string, name: string);
11
+ /** Serialized shape suitable for JSON / offline persistence. */
12
+ abstract toPlain(): Record<string, unknown>;
13
+ /**
14
+ * Validates `featureType` and delegates to the matching legend item parser.
15
+ */
16
+ static fromResult(result: unknown): LegendItem;
17
+ static assertNonEmptyString(value: unknown, context: string): string;
18
+ /**
19
+ * Parses an optional `legend` object keyed by arbitrary ids to {@link LegendItem} instances.
20
+ */
21
+ static legendRecordFromResult(value: unknown, context: string): Record<string, LegendItem>;
22
+ }
23
+ //# sourceMappingURL=legendItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legendItem.d.ts","sourceRoot":"","sources":["../../../../../src/models/minimap/legend/abstract/legendItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAI9E,wBAAgB,wBAAwB,CACpC,WAAW,EAAE,iBAAiB,EAC9B,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,UAAU,GACvC,IAAI,CAEN;AAED;;GAEG;AACH,8BAAsB,UAAU;IAC5B,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IACjD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,SAAS,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAO9C,gEAAgE;IAChE,QAAQ,CAAC,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAE3C;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,UAAU;IAkB9C,MAAM,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;IAOpE;;OAEG;IACH,MAAM,CAAC,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;CAW7F"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LegendItem = void 0;
4
+ exports.registerLegendItemParser = registerLegendItemParser;
5
+ const legendFeatureType_1 = require("./legendFeatureType");
6
+ const legendItemParsers = new Map();
7
+ function registerLegendItemParser(featureType, parse) {
8
+ legendItemParsers.set(featureType, parse);
9
+ }
10
+ /**
11
+ * Base type for page minimap legend entries. Use {@link LegendItem.fromResult} to parse API wire shapes.
12
+ */
13
+ class LegendItem {
14
+ constructor(id, name) {
15
+ LegendItem.assertNonEmptyString(id, 'LegendItem.id');
16
+ LegendItem.assertNonEmptyString(name, 'LegendItem.name');
17
+ this.id = id;
18
+ this.name = name;
19
+ }
20
+ /**
21
+ * Validates `featureType` and delegates to the matching legend item parser.
22
+ */
23
+ static fromResult(result) {
24
+ if (result == null || typeof result !== 'object') {
25
+ throw new Error('LegendItem result must be an object');
26
+ }
27
+ const r = result;
28
+ const ft = r.featureType;
29
+ if (typeof ft !== 'string' || !legendFeatureType_1.LEGEND_FEATURE_TYPES.has(ft)) {
30
+ throw new Error(`LegendItem.featureType must be one of [${[...legendFeatureType_1.LEGEND_FEATURE_TYPES].join(', ')}], got: ${JSON.stringify(ft)}`);
31
+ }
32
+ const parser = legendItemParsers.get(ft);
33
+ if (parser === undefined) {
34
+ throw new Error(`No LegendItem parser registered for featureType ${JSON.stringify(ft)}`);
35
+ }
36
+ return parser(result);
37
+ }
38
+ static assertNonEmptyString(value, context) {
39
+ if (typeof value !== 'string' || value.trim().length === 0) {
40
+ throw new Error(`${context} must be a non-empty string`);
41
+ }
42
+ return value;
43
+ }
44
+ /**
45
+ * Parses an optional `legend` object keyed by arbitrary ids to {@link LegendItem} instances.
46
+ */
47
+ static legendRecordFromResult(value, context) {
48
+ if (value === null || typeof value !== 'object' || Array.isArray(value)) {
49
+ throw new Error(`${context} must be a non-array object`);
50
+ }
51
+ const raw = value;
52
+ const out = {};
53
+ for (const [key, entry] of Object.entries(raw)) {
54
+ out[key] = LegendItem.fromResult(entry);
55
+ }
56
+ return out;
57
+ }
58
+ }
59
+ exports.LegendItem = LegendItem;
@@ -0,0 +1,13 @@
1
+ import { Bounds } from '../../bounds';
2
+ import { LegendFeatureType } from '../abstract/legendFeatureType';
3
+ import { LegendItem } from '../abstract/legendItem';
4
+ export declare class LineLegendItem extends LegendItem {
5
+ readonly featureType = LegendFeatureType.Line;
6
+ bounds: Bounds;
7
+ strokeColor?: string;
8
+ strokeWidth?: string;
9
+ constructor(id: string, name: string, bounds: Bounds, strokeColor?: string, strokeWidth?: string);
10
+ toPlain(): Record<string, unknown>;
11
+ static fromResult(result: unknown): LineLegendItem;
12
+ }
13
+ //# sourceMappingURL=lineLegendItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lineLegendItem.d.ts","sourceRoot":"","sources":["../../../../../src/models/minimap/legend/concrete/lineLegendItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAA4B,MAAM,wBAAwB,CAAC;AAE9E,qBAAa,cAAe,SAAQ,UAAU;IAC1C,QAAQ,CAAC,WAAW,0BAA0B;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;gBAGjB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,MAAM,EACpB,WAAW,CAAC,EAAE,MAAM;IAQxB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAqBlC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,cAAc;CA6BrD"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LineLegendItem = void 0;
4
+ const bounds_1 = require("../../bounds");
5
+ const legendFeatureType_1 = require("../abstract/legendFeatureType");
6
+ const legendItem_1 = require("../abstract/legendItem");
7
+ class LineLegendItem extends legendItem_1.LegendItem {
8
+ constructor(id, name, bounds, strokeColor, strokeWidth) {
9
+ super(id, name);
10
+ this.featureType = legendFeatureType_1.LegendFeatureType.Line;
11
+ this.bounds = bounds;
12
+ this.strokeColor = strokeColor;
13
+ this.strokeWidth = strokeWidth;
14
+ }
15
+ toPlain() {
16
+ const base = {
17
+ featureType: this.featureType,
18
+ id: this.id,
19
+ name: this.name,
20
+ bounds: {
21
+ north: this.bounds.north,
22
+ south: this.bounds.south,
23
+ east: this.bounds.east,
24
+ west: this.bounds.west,
25
+ },
26
+ };
27
+ if (this.strokeColor !== undefined) {
28
+ base.strokeColor = this.strokeColor;
29
+ }
30
+ if (this.strokeWidth !== undefined) {
31
+ base.strokeWidth = this.strokeWidth;
32
+ }
33
+ return base;
34
+ }
35
+ static fromResult(result) {
36
+ if (result == null || typeof result !== 'object') {
37
+ throw new Error('LineLegendItem result must be an object');
38
+ }
39
+ const r = result;
40
+ if (r.featureType !== legendFeatureType_1.LegendFeatureType.Line) {
41
+ throw new Error(`LineLegendItem.featureType must be "${legendFeatureType_1.LegendFeatureType.Line}", got: ${JSON.stringify(r.featureType)}`);
42
+ }
43
+ const id = legendItem_1.LegendItem.assertNonEmptyString(r.id, 'LineLegendItem.id');
44
+ const name = legendItem_1.LegendItem.assertNonEmptyString(r.name, 'LineLegendItem.name');
45
+ const bounds = bounds_1.Bounds.fromResult(r.bounds);
46
+ let strokeColor;
47
+ if (r.strokeColor !== undefined) {
48
+ if (typeof r.strokeColor !== 'string') {
49
+ throw new Error(`LineLegendItem.strokeColor must be a string, got: ${typeof r.strokeColor}`);
50
+ }
51
+ strokeColor = r.strokeColor;
52
+ }
53
+ let strokeWidth;
54
+ if (r.strokeWidth !== undefined) {
55
+ if (typeof r.strokeWidth !== 'string') {
56
+ throw new Error(`LineLegendItem.strokeWidth must be a string, got: ${typeof r.strokeWidth}`);
57
+ }
58
+ strokeWidth = r.strokeWidth;
59
+ }
60
+ return new LineLegendItem(id, name, bounds, strokeColor, strokeWidth);
61
+ }
62
+ }
63
+ exports.LineLegendItem = LineLegendItem;
64
+ (0, legendItem_1.registerLegendItemParser)(legendFeatureType_1.LegendFeatureType.Line, (res) => LineLegendItem.fromResult(res));
@@ -0,0 +1,18 @@
1
+ import { LegendFeatureType } from '../abstract/legendFeatureType';
2
+ import { LegendItem } from '../abstract/legendItem';
3
+ export declare class PointLegendItem extends LegendItem {
4
+ readonly featureType = LegendFeatureType.Point;
5
+ coordinates: {
6
+ lat: number;
7
+ lon: number;
8
+ };
9
+ icon?: string;
10
+ constructor(id: string, name: string, coordinates: {
11
+ lat: number;
12
+ lon: number;
13
+ }, icon?: string);
14
+ toPlain(): Record<string, unknown>;
15
+ static fromResult(result: unknown): PointLegendItem;
16
+ private static assertNumber;
17
+ }
18
+ //# sourceMappingURL=pointLegendItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pointLegendItem.d.ts","sourceRoot":"","sources":["../../../../../src/models/minimap/legend/concrete/pointLegendItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAA4B,MAAM,wBAAwB,CAAC;AAE9E,qBAAa,eAAgB,SAAQ,UAAU;IAC3C,QAAQ,CAAC,WAAW,2BAA2B;IAC/C,WAAW,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;gBAGV,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EACzC,IAAI,CAAC,EAAE,MAAM;IAOjB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAalC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,eAAe;IA6BnD,OAAO,CAAC,MAAM,CAAC,YAAY;CAK9B"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PointLegendItem = void 0;
4
+ const legendFeatureType_1 = require("../abstract/legendFeatureType");
5
+ const legendItem_1 = require("../abstract/legendItem");
6
+ class PointLegendItem extends legendItem_1.LegendItem {
7
+ constructor(id, name, coordinates, icon) {
8
+ super(id, name);
9
+ this.featureType = legendFeatureType_1.LegendFeatureType.Point;
10
+ this.coordinates = coordinates;
11
+ this.icon = icon;
12
+ }
13
+ toPlain() {
14
+ const base = {
15
+ featureType: this.featureType,
16
+ id: this.id,
17
+ name: this.name,
18
+ coordinates: { lat: this.coordinates.lat, lon: this.coordinates.lon },
19
+ };
20
+ if (this.icon !== undefined) {
21
+ base.icon = this.icon;
22
+ }
23
+ return base;
24
+ }
25
+ static fromResult(result) {
26
+ if (result == null || typeof result !== 'object') {
27
+ throw new Error('PointLegendItem result must be an object');
28
+ }
29
+ const r = result;
30
+ if (r.featureType !== legendFeatureType_1.LegendFeatureType.Point) {
31
+ throw new Error(`PointLegendItem.featureType must be "${legendFeatureType_1.LegendFeatureType.Point}", got: ${JSON.stringify(r.featureType)}`);
32
+ }
33
+ const id = legendItem_1.LegendItem.assertNonEmptyString(r.id, 'PointLegendItem.id');
34
+ const name = legendItem_1.LegendItem.assertNonEmptyString(r.name, 'PointLegendItem.name');
35
+ const coords = r.coordinates;
36
+ if (coords == null || typeof coords !== 'object' || Array.isArray(coords)) {
37
+ throw new Error('PointLegendItem.coordinates must be an object');
38
+ }
39
+ const c = coords;
40
+ PointLegendItem.assertNumber(c.lat, 'PointLegendItem.coordinates.lat');
41
+ PointLegendItem.assertNumber(c.lon, 'PointLegendItem.coordinates.lon');
42
+ let icon;
43
+ if (r.icon !== undefined) {
44
+ if (typeof r.icon !== 'string') {
45
+ throw new Error(`PointLegendItem.icon must be a string, got: ${typeof r.icon}`);
46
+ }
47
+ icon = r.icon;
48
+ }
49
+ return new PointLegendItem(id, name, { lat: c.lat, lon: c.lon }, icon);
50
+ }
51
+ static assertNumber(value, context) {
52
+ if (typeof value !== 'number' || Number.isNaN(value)) {
53
+ throw new Error(`${context} must be a number, got: ${typeof value}`);
54
+ }
55
+ }
56
+ }
57
+ exports.PointLegendItem = PointLegendItem;
58
+ (0, legendItem_1.registerLegendItemParser)(legendFeatureType_1.LegendFeatureType.Point, (res) => PointLegendItem.fromResult(res));
@@ -0,0 +1,13 @@
1
+ import { Bounds } from '../../bounds';
2
+ import { LegendFeatureType } from '../abstract/legendFeatureType';
3
+ import { LegendItem } from '../abstract/legendItem';
4
+ export declare class PolygonLegendItem extends LegendItem {
5
+ readonly featureType = LegendFeatureType.Polygon;
6
+ bounds: Bounds;
7
+ borderColor?: string;
8
+ fillColor?: string;
9
+ constructor(id: string, name: string, bounds: Bounds, borderColor?: string, fillColor?: string);
10
+ toPlain(): Record<string, unknown>;
11
+ static fromResult(result: unknown): PolygonLegendItem;
12
+ }
13
+ //# sourceMappingURL=polygonLegendItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polygonLegendItem.d.ts","sourceRoot":"","sources":["../../../../../src/models/minimap/legend/concrete/polygonLegendItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAA4B,MAAM,wBAAwB,CAAC;AAE9E,qBAAa,iBAAkB,SAAQ,UAAU;IAC7C,QAAQ,CAAC,WAAW,6BAA6B;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;gBAGf,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,MAAM,EACpB,SAAS,CAAC,EAAE,MAAM;IAQtB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAqBlC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,iBAAiB;CA6BxD"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PolygonLegendItem = void 0;
4
+ const bounds_1 = require("../../bounds");
5
+ const legendFeatureType_1 = require("../abstract/legendFeatureType");
6
+ const legendItem_1 = require("../abstract/legendItem");
7
+ class PolygonLegendItem extends legendItem_1.LegendItem {
8
+ constructor(id, name, bounds, borderColor, fillColor) {
9
+ super(id, name);
10
+ this.featureType = legendFeatureType_1.LegendFeatureType.Polygon;
11
+ this.bounds = bounds;
12
+ this.borderColor = borderColor;
13
+ this.fillColor = fillColor;
14
+ }
15
+ toPlain() {
16
+ const base = {
17
+ featureType: this.featureType,
18
+ id: this.id,
19
+ name: this.name,
20
+ bounds: {
21
+ north: this.bounds.north,
22
+ south: this.bounds.south,
23
+ east: this.bounds.east,
24
+ west: this.bounds.west,
25
+ },
26
+ };
27
+ if (this.borderColor !== undefined) {
28
+ base.borderColor = this.borderColor;
29
+ }
30
+ if (this.fillColor !== undefined) {
31
+ base.fillColor = this.fillColor;
32
+ }
33
+ return base;
34
+ }
35
+ static fromResult(result) {
36
+ if (result == null || typeof result !== 'object') {
37
+ throw new Error('PolygonLegendItem result must be an object');
38
+ }
39
+ const r = result;
40
+ if (r.featureType !== legendFeatureType_1.LegendFeatureType.Polygon) {
41
+ throw new Error(`PolygonLegendItem.featureType must be "${legendFeatureType_1.LegendFeatureType.Polygon}", got: ${JSON.stringify(r.featureType)}`);
42
+ }
43
+ const id = legendItem_1.LegendItem.assertNonEmptyString(r.id, 'PolygonLegendItem.id');
44
+ const name = legendItem_1.LegendItem.assertNonEmptyString(r.name, 'PolygonLegendItem.name');
45
+ const bounds = bounds_1.Bounds.fromResult(r.bounds);
46
+ let borderColor;
47
+ if (r.borderColor !== undefined) {
48
+ if (typeof r.borderColor !== 'string') {
49
+ throw new Error(`PolygonLegendItem.borderColor must be a string, got: ${typeof r.borderColor}`);
50
+ }
51
+ borderColor = r.borderColor;
52
+ }
53
+ let fillColor;
54
+ if (r.fillColor !== undefined) {
55
+ if (typeof r.fillColor !== 'string') {
56
+ throw new Error(`PolygonLegendItem.fillColor must be a string, got: ${typeof r.fillColor}`);
57
+ }
58
+ fillColor = r.fillColor;
59
+ }
60
+ return new PolygonLegendItem(id, name, bounds, borderColor, fillColor);
61
+ }
62
+ }
63
+ exports.PolygonLegendItem = PolygonLegendItem;
64
+ (0, legendItem_1.registerLegendItemParser)(legendFeatureType_1.LegendFeatureType.Polygon, (res) => PolygonLegendItem.fromResult(res));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ropegeo-common",
3
- "version": "1.12.13",
3
+ "version": "1.13.0",
4
4
  "description": "Shared domain models and helpers for RopeGeo and WebScraper",
5
5
  "license": "ISC",
6
6
  "repository": {