ropegeo-common 1.12.14 → 1.15.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.
- package/README.md +18 -4
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +14 -2
- package/dist/models/minimap/abstract/pageMiniMap.d.ts +10 -2
- package/dist/models/minimap/abstract/pageMiniMap.d.ts.map +1 -1
- package/dist/models/minimap/abstract/pageMiniMap.js +18 -5
- package/dist/models/minimap/concrete/offlinePageMiniMap.d.ts +2 -1
- package/dist/models/minimap/concrete/offlinePageMiniMap.d.ts.map +1 -1
- package/dist/models/minimap/concrete/offlinePageMiniMap.js +9 -4
- package/dist/models/minimap/concrete/onlinePageMiniMap.d.ts +2 -1
- package/dist/models/minimap/concrete/onlinePageMiniMap.d.ts.map +1 -1
- package/dist/models/minimap/concrete/onlinePageMiniMap.js +3 -3
- package/dist/models/minimap/legend/abstract/legendFeatureType.d.ts +10 -0
- package/dist/models/minimap/legend/abstract/legendFeatureType.d.ts.map +1 -0
- package/dist/models/minimap/legend/abstract/legendFeatureType.js +13 -0
- package/dist/models/minimap/legend/abstract/legendItem.d.ts +23 -0
- package/dist/models/minimap/legend/abstract/legendItem.d.ts.map +1 -0
- package/dist/models/minimap/legend/abstract/legendItem.js +59 -0
- package/dist/models/minimap/legend/concrete/lineLegendItem.d.ts +13 -0
- package/dist/models/minimap/legend/concrete/lineLegendItem.d.ts.map +1 -0
- package/dist/models/minimap/legend/concrete/lineLegendItem.js +64 -0
- package/dist/models/minimap/legend/concrete/pointLegendItem.d.ts +18 -0
- package/dist/models/minimap/legend/concrete/pointLegendItem.d.ts.map +1 -0
- package/dist/models/minimap/legend/concrete/pointLegendItem.js +58 -0
- package/dist/models/minimap/legend/concrete/polygonLegendItem.d.ts +13 -0
- package/dist/models/minimap/legend/concrete/polygonLegendItem.d.ts.map +1 -0
- package/dist/models/minimap/legend/concrete/polygonLegendItem.js +64 -0
- package/dist/models/pageViews/offlineRopewikiPageView.d.ts +1 -1
- package/dist/models/pageViews/offlineRopewikiPageView.d.ts.map +1 -1
- package/dist/models/pageViews/offlineRopewikiPageView.js +3 -3
- package/dist/models/pageViews/onlineRopewikiPageView.d.ts +1 -1
- package/dist/models/pageViews/onlineRopewikiPageView.d.ts.map +1 -1
- package/dist/models/pageViews/onlineRopewikiPageView.js +4 -4
- package/dist/models/pageViews/ropewikiPageView.d.ts +4 -1
- package/dist/models/pageViews/ropewikiPageView.d.ts.map +1 -1
- package/dist/models/pageViews/ropewikiPageView.js +13 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -178,7 +178,7 @@ Helper tables use columns **Name**, **Description**, **Import**. Model tables ad
|
|
|
178
178
|
| Name | Base class | Description | Import |
|
|
179
179
|
| --- | --- | --- | --- |
|
|
180
180
|
| `RopewikiPageView` | `BaseRopewikiPageView` | Backward-compatible alias exported as the online page view class. | `import { RopewikiPageView } from 'ropegeo-common/models'` |
|
|
181
|
-
| `BaseRopewikiPageView` | N/A | Abstract Ropewiki page view base
|
|
181
|
+
| `BaseRopewikiPageView` | N/A | Abstract Ropewiki page view base; includes optional `mapDataId` (vector tile record id) alongside shared validation/fields. | `import { BaseRopewikiPageView } from 'ropegeo-common/models'` |
|
|
182
182
|
| `OnlineRopewikiPageView` | `BaseRopewikiPageView` | Online Ropewiki page view with API image URLs and online minimap variants. | `import { OnlineRopewikiPageView } from 'ropegeo-common/models'` |
|
|
183
183
|
| `OfflineRopewikiPageView` | `BaseRopewikiPageView` | Offline Ropewiki page view with downloaded paths and offline minimap variants. | `import { OfflineRopewikiPageView } from 'ropegeo-common/models'` |
|
|
184
184
|
| `OnlinePageView` | N/A | Interface for online page-view behavior (`toOffline`, `toSavedPage`, etc.). | `import type { OnlinePageView } from 'ropegeo-common/models'` |
|
|
@@ -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`);
|
|
258
|
-
| `OnlinePageMiniMap` | `PageMiniMap` | API page tiles
|
|
259
|
-
| `OfflinePageMiniMap` | `PageMiniMap` |
|
|
257
|
+
| `PageMiniMap` | `MiniMap` | Abstract page minimap (`miniMapType: page`); MVT `polyLineLayerId` / `pointLayerId`, tile templates, optional `legend`. | `import { PageMiniMap } from 'ropegeo-common/models'` |
|
|
258
|
+
| `OnlinePageMiniMap` | `PageMiniMap` | API page tiles (`onlineTilesTemplate`, `fetchType: "online"`). | `import { OnlinePageMiniMap } from 'ropegeo-common/models'` |
|
|
259
|
+
| `OfflinePageMiniMap` | `PageMiniMap` | Local page tiles (`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 |
|
package/dist/models/index.d.ts
CHANGED
|
@@ -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;AAClD,OAAO,EACH,cAAc,EACd,UAAU,EACV,wBAAwB,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACH,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,UAAU,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,yCAAyC;AACzC,OAAO,EAAE,kBAAkB,IAAI,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACpF,qCAAqC;AACrC,OAAO,EAAE,cAAc,IAAI,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC5E,oCAAoC;AACpC,OAAO,EAAE,aAAa,I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,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,YAAY,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EACH,SAAS,EACT,uBAAuB,EACvB,qCAAqC,EACrC,KAAK,oBAAoB,EACzB,KAAK,iCAAiC,GACzC,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/models/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { 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.
|
|
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;
|
|
@@ -9,9 +13,13 @@ export declare function registerPageMiniMapParser(fetchType: FetchType, parse: (
|
|
|
9
13
|
export declare abstract class PageMiniMap extends MiniMap {
|
|
10
14
|
abstract readonly fetchType: FetchType;
|
|
11
15
|
readonly miniMapType = MiniMapType.Page;
|
|
12
|
-
|
|
16
|
+
/** Vector tile source-layer id for line and polygon features. */
|
|
17
|
+
polyLineLayerId: string;
|
|
18
|
+
/** Vector tile source-layer id for point features. */
|
|
19
|
+
pointLayerId: string;
|
|
13
20
|
bounds: Bounds;
|
|
14
|
-
|
|
21
|
+
legend?: Record<string, LegendItem>;
|
|
22
|
+
protected constructor(polyLineLayerId: string, pointLayerId: string, bounds: Bounds, title: string, legend?: Record<string, LegendItem>);
|
|
15
23
|
static fromResult(result: unknown): PageMiniMap;
|
|
16
24
|
protected static validateCommonFields(r: Record<string, unknown>, expectedFetchType: FetchType, context: string): void;
|
|
17
25
|
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,
|
|
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,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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,13 @@ 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(
|
|
20
|
+
constructor(polyLineLayerId, pointLayerId, bounds, title, legend) {
|
|
17
21
|
super(title);
|
|
18
22
|
this.miniMapType = miniMapType_1.MiniMapType.Page;
|
|
19
|
-
this.
|
|
23
|
+
this.polyLineLayerId = polyLineLayerId;
|
|
24
|
+
this.pointLayerId = pointLayerId;
|
|
20
25
|
this.bounds = bounds;
|
|
26
|
+
this.legend = legend;
|
|
21
27
|
}
|
|
22
28
|
static fromResult(result) {
|
|
23
29
|
if (result == null || typeof result !== 'object') {
|
|
@@ -45,12 +51,19 @@ class PageMiniMap extends miniMap_1.MiniMap {
|
|
|
45
51
|
throw new Error(`${context}.fetchType must be "${expectedFetchType}", got: ${JSON.stringify(r.fetchType)}`);
|
|
46
52
|
}
|
|
47
53
|
const title = miniMap_1.MiniMap.assertNonEmptyTitle(r.title, `${context}.title`);
|
|
48
|
-
const
|
|
49
|
-
if (typeof
|
|
50
|
-
throw new Error(`${context}.
|
|
54
|
+
const polyLineLayerId = r.polyLineLayerId;
|
|
55
|
+
if (typeof polyLineLayerId !== 'string' || polyLineLayerId.length === 0) {
|
|
56
|
+
throw new Error(`${context}.polyLineLayerId must be a non-empty string, got: ${typeof polyLineLayerId}`);
|
|
57
|
+
}
|
|
58
|
+
const pointLayerId = r.pointLayerId;
|
|
59
|
+
if (typeof pointLayerId !== 'string' || pointLayerId.length === 0) {
|
|
60
|
+
throw new Error(`${context}.pointLayerId must be a non-empty string, got: ${typeof pointLayerId}`);
|
|
51
61
|
}
|
|
52
62
|
r.title = title;
|
|
53
63
|
r.bounds = bounds_1.Bounds.fromResult(r.bounds);
|
|
64
|
+
if ('legend' in r && r.legend !== undefined) {
|
|
65
|
+
r.legend = legendItem_1.LegendItem.legendRecordFromResult(r.legend, `${context}.legend`);
|
|
66
|
+
}
|
|
54
67
|
}
|
|
55
68
|
static assertTemplate(value, keyName) {
|
|
56
69
|
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(
|
|
8
|
+
constructor(polyLineLayerId: string, pointLayerId: 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;
|
|
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,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,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;IAuBlC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,kBAAkB;CAUzD"}
|
|
@@ -3,16 +3,17 @@ 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(
|
|
7
|
-
super(
|
|
6
|
+
constructor(polyLineLayerId, pointLayerId, offlineTilesTemplate, bounds, title, legend) {
|
|
7
|
+
super(polyLineLayerId, pointLayerId, bounds, title, legend);
|
|
8
8
|
this.fetchType = 'offline';
|
|
9
9
|
this.offlineTilesTemplate = offlineTilesTemplate;
|
|
10
10
|
}
|
|
11
11
|
toPlain() {
|
|
12
|
-
|
|
12
|
+
const plain = {
|
|
13
13
|
fetchType: this.fetchType,
|
|
14
14
|
miniMapType: this.miniMapType,
|
|
15
|
-
|
|
15
|
+
polyLineLayerId: this.polyLineLayerId,
|
|
16
|
+
pointLayerId: this.pointLayerId,
|
|
16
17
|
offlineTilesTemplate: this.offlineTilesTemplate,
|
|
17
18
|
bounds: {
|
|
18
19
|
north: this.bounds.north,
|
|
@@ -22,6 +23,10 @@ class OfflinePageMiniMap extends pageMiniMap_1.PageMiniMap {
|
|
|
22
23
|
},
|
|
23
24
|
title: this.title,
|
|
24
25
|
};
|
|
26
|
+
if (this.legend !== undefined) {
|
|
27
|
+
plain.legend = Object.fromEntries(Object.entries(this.legend).map(([key, item]) => [key, item.toPlain()]));
|
|
28
|
+
}
|
|
29
|
+
return plain;
|
|
25
30
|
}
|
|
26
31
|
static fromResult(result) {
|
|
27
32
|
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(
|
|
9
|
+
constructor(polyLineLayerId: string, pointLayerId: 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;
|
|
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,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,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;IAW3D,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(
|
|
8
|
-
super(
|
|
7
|
+
constructor(polyLineLayerId, pointLayerId, onlineTilesTemplate, bounds, title, legend) {
|
|
8
|
+
super(polyLineLayerId, pointLayerId, 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.
|
|
13
|
+
return new offlinePageMiniMap_1.OfflinePageMiniMap(this.polyLineLayerId, this.pointLayerId, 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));
|
|
@@ -29,7 +29,7 @@ export declare class OfflineRopewikiPageView extends RopewikiPageView implements
|
|
|
29
29
|
} | number | null, exitTime: {
|
|
30
30
|
min: number;
|
|
31
31
|
max: number;
|
|
32
|
-
} | number | null, approachElevGain: number | null, descentElevGain: number | null, exitElevGain: number | null, months: string[], latestRevisionDate: Date, bannerImage: OfflineBetaSectionImage | null, betaSections: OfflineBetaSection[], miniMap: OfflinePageMiniMap | OfflineCenteredRegionMiniMap | null, coordinates: {
|
|
32
|
+
} | number | null, approachElevGain: number | null, descentElevGain: number | null, exitElevGain: number | null, months: string[], latestRevisionDate: Date, bannerImage: OfflineBetaSectionImage | null, betaSections: OfflineBetaSection[], mapDataId: string | null, miniMap: OfflinePageMiniMap | OfflineCenteredRegionMiniMap | null, coordinates: {
|
|
33
33
|
lat: number;
|
|
34
34
|
lon: number;
|
|
35
35
|
} | null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offlineRopewikiPageView.d.ts","sourceRoot":"","sources":["../../../src/models/pageViews/offlineRopewikiPageView.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAkC,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,qBAAa,uBAAwB,SAAQ,gBAAiB,YAAW,eAAe;IACpF,QAAQ,CAAC,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AA;KAAE,GAAG,MAAM,GAAG,IAAI,EACtD,gBAAgB,EAAE,MAAM,GAAG,IAAI,EAC/B,eAAe,EAAE,MAAM,GAAG,IAAI,EAC9B,YAAY,EAAE,MAAM,GAAG,IAAI,EAC3B,MAAM,EAAE,MAAM,EAAE,EAChB,kBAAkB,EAAE,IAAI,EACxB,WAAW,EAAE,uBAAuB,GAAG,IAAI,EAC3C,YAAY,EAAE,kBAAkB,EAAE,EAClC,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,OAAO,EAAE,kBAAkB,GAAG,4BAA4B,GAAG,IAAI,EACjE,WAAW,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAuCpD,aAAa,IAAI,kBAAkB;IAqBnC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,uBAAuB;CAuC9D"}
|
|
@@ -10,8 +10,8 @@ const offlinePagePreview_1 = require("../previews/offlinePagePreview");
|
|
|
10
10
|
const pageDataSource_1 = require("../pageDataSource");
|
|
11
11
|
const ropewikiPageView_1 = require("./ropewikiPageView");
|
|
12
12
|
class OfflineRopewikiPageView extends ropewikiPageView_1.RopewikiPageView {
|
|
13
|
-
constructor(id, routeType, name, aka, url, quality, userVotes, regions, difficulty, permit, rappelCount, jumps, vehicle, rappelLongest, shuttleTime, overallLength, descentLength, exitLength, approachLength, overallTime, approachTime, descentTime, exitTime, approachElevGain, descentElevGain, exitElevGain, months, latestRevisionDate, bannerImage, betaSections, miniMap, coordinates) {
|
|
14
|
-
super(id, routeType, name, aka, url, quality, userVotes, regions, difficulty, permit, rappelCount, jumps, vehicle, rappelLongest, shuttleTime, overallLength, descentLength, exitLength, approachLength, overallTime, approachTime, descentTime, exitTime, approachElevGain, descentElevGain, exitElevGain, months, latestRevisionDate, coordinates);
|
|
13
|
+
constructor(id, routeType, name, aka, url, quality, userVotes, regions, difficulty, permit, rappelCount, jumps, vehicle, rappelLongest, shuttleTime, overallLength, descentLength, exitLength, approachLength, overallTime, approachTime, descentTime, exitTime, approachElevGain, descentElevGain, exitElevGain, months, latestRevisionDate, bannerImage, betaSections, mapDataId, miniMap, coordinates) {
|
|
14
|
+
super(id, routeType, name, aka, url, quality, userVotes, regions, difficulty, permit, rappelCount, jumps, vehicle, rappelLongest, shuttleTime, overallLength, descentLength, exitLength, approachLength, overallTime, approachTime, descentTime, exitTime, approachElevGain, descentElevGain, exitElevGain, months, latestRevisionDate, mapDataId, coordinates);
|
|
15
15
|
this.fetchType = 'offline';
|
|
16
16
|
this.bannerImage = bannerImage;
|
|
17
17
|
this.betaSections = betaSections;
|
|
@@ -19,7 +19,7 @@ class OfflineRopewikiPageView extends ropewikiPageView_1.RopewikiPageView {
|
|
|
19
19
|
}
|
|
20
20
|
toPagePreview() {
|
|
21
21
|
const mapData = this.miniMap != null && this.miniMap.miniMapType === miniMapType_1.MiniMapType.Page
|
|
22
|
-
? this.
|
|
22
|
+
? this.mapDataId
|
|
23
23
|
: null;
|
|
24
24
|
return new offlinePagePreview_1.OfflinePagePreview(this.id, pageDataSource_1.PageDataSource.Ropewiki, this.bannerImage?.downloadedBannerPath ?? null, this.quality, this.userVotes, this.name, this.regions.map((region) => region.name), this.aka, this.difficulty, mapData, this.url, this.permit);
|
|
25
25
|
}
|
|
@@ -35,7 +35,7 @@ export declare class OnlineRopewikiPageView extends RopewikiPageView implements
|
|
|
35
35
|
} | number | null, exitTime: {
|
|
36
36
|
min: number;
|
|
37
37
|
max: number;
|
|
38
|
-
} | number | null, approachElevGain: number | null, descentElevGain: number | null, exitElevGain: number | null, months: string[], latestRevisionDate: Date, bannerImage: OnlineBetaSectionImage | null, betaSections: OnlineBetaSection[], miniMap: OnlinePageMiniMap | OnlineCenteredRegionMiniMap | null, coordinates: {
|
|
38
|
+
} | number | null, approachElevGain: number | null, descentElevGain: number | null, exitElevGain: number | null, months: string[], latestRevisionDate: Date, bannerImage: OnlineBetaSectionImage | null, betaSections: OnlineBetaSection[], mapDataId: string | null, miniMap: OnlinePageMiniMap | OnlineCenteredRegionMiniMap | null, coordinates: {
|
|
39
39
|
lat: number;
|
|
40
40
|
lon: number;
|
|
41
41
|
} | null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onlineRopewikiPageView.d.ts","sourceRoot":"","sources":["../../../src/models/pageViews/onlineRopewikiPageView.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,OAAO,EAAE,2BAA2B,EAAE,MAAM,iDAAiD,CAAC;AAC9F,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAgB,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAkC,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD,qBAAa,sBAAuB,SAAQ,gBAAiB,YAAW,cAAc;IAClF,QAAQ,CAAC,SAAS,EAAG,QAAQ,CAAU;IACvC,WAAW,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC3C,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAClC,OAAO,EAAE,iBAAiB,GAAG,2BAA2B,GAAG,IAAI,CAA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EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,GAAG,IAAI,EACzD,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,GAAG,IAAI,EACtD,gBAAgB,EAAE,MAAM,GAAG,IAAI,EAC/B,eAAe,EAAE,MAAM,GAAG,IAAI,EAC9B,YAAY,EAAE,MAAM,GAAG,IAAI,EAC3B,MAAM,EAAE,MAAM,EAAE,EAChB,kBAAkB,EAAE,IAAI,EACxB,WAAW,EAAE,sBAAsB,GAAG,IAAI,EAC1C,YAAY,EAAE,iBAAiB,EAAE,EACjC,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,OAAO,EAAE,iBAAiB,GAAG,2BAA2B,GAAG,IAAI,EAC/D,WAAW,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAuCpD,qBAAqB,IAAI,KAAK,CAAC,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAkBvD,SAAS,CACL,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACtD,iBAAiB,CAAC,EAAE,kBAAkB,GAAG,4BAA4B,GAAG,IAAI,GAC7E,uBAAuB;IAwE1B,aAAa,IAAI,iBAAiB;IAqBlC,WAAW,IAAI,SAAS;IAIxB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,sBAAsB;CAuC7D"}
|
|
@@ -14,8 +14,8 @@ const pageDataSource_1 = require("../pageDataSource");
|
|
|
14
14
|
const offlineRopewikiPageView_1 = require("./offlineRopewikiPageView");
|
|
15
15
|
const ropewikiPageView_1 = require("./ropewikiPageView");
|
|
16
16
|
class OnlineRopewikiPageView extends ropewikiPageView_1.RopewikiPageView {
|
|
17
|
-
constructor(id, routeType, name, aka, url, quality, userVotes, regions, difficulty, permit, rappelCount, jumps, vehicle, rappelLongest, shuttleTime, overallLength, descentLength, exitLength, approachLength, overallTime, approachTime, descentTime, exitTime, approachElevGain, descentElevGain, exitElevGain, months, latestRevisionDate, bannerImage, betaSections, miniMap, coordinates) {
|
|
18
|
-
super(id, routeType, name, aka, url, quality, userVotes, regions, difficulty, permit, rappelCount, jumps, vehicle, rappelLongest, shuttleTime, overallLength, descentLength, exitLength, approachLength, overallTime, approachTime, descentTime, exitTime, approachElevGain, descentElevGain, exitElevGain, months, latestRevisionDate, coordinates);
|
|
17
|
+
constructor(id, routeType, name, aka, url, quality, userVotes, regions, difficulty, permit, rappelCount, jumps, vehicle, rappelLongest, shuttleTime, overallLength, descentLength, exitLength, approachLength, overallTime, approachTime, descentTime, exitTime, approachElevGain, descentElevGain, exitElevGain, months, latestRevisionDate, bannerImage, betaSections, mapDataId, miniMap, coordinates) {
|
|
18
|
+
super(id, routeType, name, aka, url, quality, userVotes, regions, difficulty, permit, rappelCount, jumps, vehicle, rappelLongest, shuttleTime, overallLength, descentLength, exitLength, approachLength, overallTime, approachTime, descentTime, exitTime, approachElevGain, descentElevGain, exitElevGain, months, latestRevisionDate, mapDataId, coordinates);
|
|
19
19
|
this.fetchType = 'online';
|
|
20
20
|
this.bannerImage = bannerImage;
|
|
21
21
|
this.betaSections = betaSections;
|
|
@@ -56,11 +56,11 @@ class OnlineRopewikiPageView extends ropewikiPageView_1.RopewikiPageView {
|
|
|
56
56
|
}
|
|
57
57
|
offlineMiniMap = downloadedMiniMap;
|
|
58
58
|
}
|
|
59
|
-
return new offlineRopewikiPageView_1.OfflineRopewikiPageView(this.id, this.routeType, this.name, this.aka, this.url, this.quality, this.userVotes, this.regions, this.difficulty, this.permit, this.rappelCount, this.jumps, this.vehicle, this.rappelLongest, this.shuttleTime, this.overallLength, this.descentLength, this.exitLength, this.approachLength, this.overallTime, this.approachTime, this.descentTime, this.exitTime, this.approachElevGain, this.descentElevGain, this.exitElevGain, this.months, this.latestRevisionDate, offlineBannerImage, offlineSections, offlineMiniMap, this.coordinates);
|
|
59
|
+
return new offlineRopewikiPageView_1.OfflineRopewikiPageView(this.id, this.routeType, this.name, this.aka, this.url, this.quality, this.userVotes, this.regions, this.difficulty, this.permit, this.rappelCount, this.jumps, this.vehicle, this.rappelLongest, this.shuttleTime, this.overallLength, this.descentLength, this.exitLength, this.approachLength, this.overallTime, this.approachTime, this.descentTime, this.exitTime, this.approachElevGain, this.descentElevGain, this.exitElevGain, this.months, this.latestRevisionDate, offlineBannerImage, offlineSections, this.mapDataId, offlineMiniMap, this.coordinates);
|
|
60
60
|
}
|
|
61
61
|
toPagePreview() {
|
|
62
62
|
const mapData = this.miniMap != null && this.miniMap.miniMapType === miniMapType_1.MiniMapType.Page
|
|
63
|
-
? this.
|
|
63
|
+
? this.mapDataId
|
|
64
64
|
: null;
|
|
65
65
|
return new onlinePagePreview_1.OnlinePagePreview(this.id, pageDataSource_1.PageDataSource.Ropewiki, this.bannerImage?.bannerUrl ?? null, this.quality, this.userVotes, this.name, this.regions.map((region) => region.name), this.aka, this.difficulty, mapData, this.url, this.permit);
|
|
66
66
|
}
|
|
@@ -43,6 +43,8 @@ export declare abstract class RopewikiPageView {
|
|
|
43
43
|
exitElevGain: number | null;
|
|
44
44
|
months: string[];
|
|
45
45
|
latestRevisionDate: Date;
|
|
46
|
+
/** Map data record id for vector tile fetches; null when no page map or only a region-style minimap. */
|
|
47
|
+
mapDataId: string | null;
|
|
46
48
|
coordinates: {
|
|
47
49
|
lat: number;
|
|
48
50
|
lon: number;
|
|
@@ -50,7 +52,7 @@ export declare abstract class RopewikiPageView {
|
|
|
50
52
|
protected constructor(id: string, routeType: RouteType, name: string, aka: string[], url: string, quality: number, userVotes: number, regions: {
|
|
51
53
|
name: string;
|
|
52
54
|
id: string;
|
|
53
|
-
}[], difficulty: Difficulty, permit: PermitStatus | null, rappelCount: MinMax | number | null, jumps: number | null, vehicle: string | null, rappelLongest: number | null, shuttleTime: number | null, overallLength: number | null, descentLength: number | null, exitLength: number | null, approachLength: number | null, overallTime: MinMax | number | null, approachTime: MinMax | number | null, descentTime: MinMax | number | null, exitTime: MinMax | number | null, approachElevGain: number | null, descentElevGain: number | null, exitElevGain: number | null, months: string[], latestRevisionDate: Date, coordinates: {
|
|
55
|
+
}[], difficulty: Difficulty, permit: PermitStatus | null, rappelCount: MinMax | number | null, jumps: number | null, vehicle: string | null, rappelLongest: number | null, shuttleTime: number | null, overallLength: number | null, descentLength: number | null, exitLength: number | null, approachLength: number | null, overallTime: MinMax | number | null, approachTime: MinMax | number | null, descentTime: MinMax | number | null, exitTime: MinMax | number | null, approachElevGain: number | null, descentElevGain: number | null, exitElevGain: number | null, months: string[], latestRevisionDate: Date, mapDataId: string | null, coordinates: {
|
|
54
56
|
lat: number;
|
|
55
57
|
lon: number;
|
|
56
58
|
} | null);
|
|
@@ -60,6 +62,7 @@ export declare abstract class RopewikiPageView {
|
|
|
60
62
|
private static assertRouteType;
|
|
61
63
|
protected static assertString(obj: Record<string, unknown>, key: string): void;
|
|
62
64
|
protected static assertNullableString(obj: Record<string, unknown>, key: string): void;
|
|
65
|
+
private static assertNullableMapDataId;
|
|
63
66
|
protected static parseCoordinateComponent(value: unknown): number | null;
|
|
64
67
|
protected static assertNullableCoordinates(obj: Record<string, unknown>, key: string): void;
|
|
65
68
|
protected static assertNumber(obj: Record<string, unknown>, key: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ropewikiPageView.d.ts","sourceRoot":"","sources":["../../../src/models/pageViews/ropewikiPageView.ts"],"names":[],"mappings":"AAAA,OAAO,yCAAyC,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB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AoBP,SAAS,CAAC,MAAM,CAAC,gBAAgB,CAC7B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,GAAG,EAAE,MAAM,GACZ,IAAI;IAwBP,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAgB9E,SAAS,CAAC,MAAM,CAAC,iBAAiB,CAC9B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,GAAG,EAAE,MAAM,GACZ,IAAI;IAwBP,SAAS,CAAC,MAAM,CAAC,oBAAoB,CACjC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,GAAG,EAAE,MAAM,GACZ,IAAI;IAIP,SAAS,CAAC,MAAM,CAAC,uBAAuB,CACpC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,GAAG,EAAE,MAAM,GACZ,IAAI;CAcV"}
|
|
@@ -12,7 +12,7 @@ function registerRopewikiPageViewParser(fetchType, parse) {
|
|
|
12
12
|
ropewikiPageViewParsers.set(fetchType, parse);
|
|
13
13
|
}
|
|
14
14
|
class RopewikiPageView {
|
|
15
|
-
constructor(id, routeType, name, aka, url, quality, userVotes, regions, difficulty, permit, rappelCount, jumps, vehicle, rappelLongest, shuttleTime, overallLength, descentLength, exitLength, approachLength, overallTime, approachTime, descentTime, exitTime, approachElevGain, descentElevGain, exitElevGain, months, latestRevisionDate, coordinates) {
|
|
15
|
+
constructor(id, routeType, name, aka, url, quality, userVotes, regions, difficulty, permit, rappelCount, jumps, vehicle, rappelLongest, shuttleTime, overallLength, descentLength, exitLength, approachLength, overallTime, approachTime, descentTime, exitTime, approachElevGain, descentElevGain, exitElevGain, months, latestRevisionDate, mapDataId, coordinates) {
|
|
16
16
|
this.pageViewType = pageViewType_1.PageViewType.Ropewiki;
|
|
17
17
|
this.id = id;
|
|
18
18
|
this.routeType = routeType;
|
|
@@ -42,6 +42,7 @@ class RopewikiPageView {
|
|
|
42
42
|
this.exitElevGain = exitElevGain;
|
|
43
43
|
this.months = Array.isArray(months) ? months.slice() : [];
|
|
44
44
|
this.latestRevisionDate = new Date(latestRevisionDate);
|
|
45
|
+
this.mapDataId = mapDataId;
|
|
45
46
|
this.coordinates =
|
|
46
47
|
coordinates != null
|
|
47
48
|
? { lat: coordinates.lat, lon: coordinates.lon }
|
|
@@ -92,6 +93,7 @@ class RopewikiPageView {
|
|
|
92
93
|
RopewikiPageView.assertNullableNumber(r, 'exitElevGain');
|
|
93
94
|
RopewikiPageView.assertStringArray(r, 'months');
|
|
94
95
|
RopewikiPageView.assertIso8601DateString(r, 'latestRevisionDate');
|
|
96
|
+
RopewikiPageView.assertNullableMapDataId(r, 'mapDataId');
|
|
95
97
|
RopewikiPageView.assertNullableCoordinates(r, 'coordinates');
|
|
96
98
|
if (r.fetchType !== expectedFetchType) {
|
|
97
99
|
throw new Error(`${context}.fetchType must be "${expectedFetchType}", got: ${JSON.stringify(r.fetchType)}`);
|
|
@@ -123,6 +125,16 @@ class RopewikiPageView {
|
|
|
123
125
|
throw new Error(`RopewikiPageView.${key} must be string or null, got: ${typeof v}`);
|
|
124
126
|
}
|
|
125
127
|
}
|
|
128
|
+
static assertNullableMapDataId(obj, key) {
|
|
129
|
+
const v = obj[key];
|
|
130
|
+
if (v === null || v === undefined) {
|
|
131
|
+
obj[key] = null;
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (typeof v !== 'string' || v.length === 0) {
|
|
135
|
+
throw new Error(`RopewikiPageView.${key} must be a non-empty string or null, got: ${typeof v === 'string' ? 'empty string' : typeof v}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
126
138
|
static parseCoordinateComponent(value) {
|
|
127
139
|
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
128
140
|
return value;
|