ts-maps 0.3.2 → 0.3.4
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/dist/core-map/control/FullscreenControl.d.ts +39 -0
- package/dist/core-map/control/GeocoderControl.d.ts +61 -0
- package/dist/core-map/control/LocateControl.d.ts +5 -2
- package/dist/core-map/control/NavigationControl.d.ts +39 -0
- package/dist/core-map/control/index.d.ts +6 -0
- package/dist/core-map/game/TerritoryLog.d.ts +66 -0
- package/dist/core-map/game/TerritoryStore.d.ts +59 -0
- package/dist/core-map/game/index.d.ts +11 -0
- package/dist/core-map/game/loop.d.ts +61 -0
- package/dist/core-map/geo/area.d.ts +52 -0
- package/dist/core-map/geo/index.d.ts +30 -0
- package/dist/core-map/geo/index.js +826 -1
- package/dist/core-map/geo/polygonClip.d.ts +75 -0
- package/dist/core-map/geo/validate.d.ts +54 -0
- package/dist/core-map/index.d.ts +7 -2
- package/dist/core-map/layer/GeoJSONTileSource.d.ts +50 -0
- package/dist/core-map/layer/RunTrailLayer.d.ts +35 -0
- package/dist/core-map/layer/TerritoryLayer.d.ts +62 -0
- package/dist/core-map/layer/index.d.ts +6 -0
- package/dist/core-map/layer/tile/RasterDEMLayer.d.ts +4 -0
- package/dist/core-map/layer/tile/VectorTileMapLayer.d.ts +59 -11
- package/dist/core-map/layer/tile/urlTemplate.d.ts +1 -2
- package/dist/core-map/map/Map.d.ts +32 -1
- package/dist/core-map/mvt/DecodedTile.d.ts +20 -0
- package/dist/core-map/mvt/FlatTile.d.ts +25 -0
- package/dist/core-map/mvt/VectorTileFeature.d.ts +8 -0
- package/dist/core-map/style-spec/expressions/formatted.d.ts +36 -0
- package/dist/core-map/style-spec/expressions/operators/binding.d.ts +1 -0
- package/dist/core-map/style-spec/expressions/operators/geometry.d.ts +19 -0
- package/dist/core-map/style-spec/expressions/types.d.ts +3 -0
- package/dist/core-map/style-spec/index.js +459 -42
- package/dist/core-map/style-spec/schema.d.ts +43 -3
- package/dist/core-map/style-spec/types.d.ts +47 -7
- package/dist/core-map/styles/basemap.d.ts +41 -0
- package/dist/core-map/styles/index.d.ts +5 -0
- package/dist/core-map/styles/palette.d.ts +31 -0
- package/dist/core-map/symbols/CollisionIndex.d.ts +22 -5
- package/dist/core-map/symbols/GlyphAtlas.d.ts +6 -1
- package/dist/core-map/symbols/GlyphProvider.d.ts +21 -0
- package/dist/core-map/symbols/GlyphRenderer.d.ts +48 -0
- package/dist/core-map/symbols/IconAtlas.d.ts +10 -1
- package/dist/core-map/symbols/SymbolOverlay.d.ts +47 -0
- package/dist/core-map/symbols/index.d.ts +4 -0
- package/dist/core-map/symbols/index.js +1071 -67
- package/dist/core-map/symbols/loadGlyphs.d.ts +53 -0
- package/dist/core-map/symbols/loadSprite.d.ts +57 -0
- package/dist/core-map/symbols/placement.d.ts +67 -0
- package/dist/core-map/symbols/sdf.d.ts +37 -0
- package/dist/core-map/symbols/sections.d.ts +32 -0
- package/dist/core-map/workers/WorkerPool.d.ts +40 -0
- package/dist/core-map/workers/decodeMvtFlat.d.ts +52 -0
- package/dist/index.js +11548 -5996
- package/package.json +1 -1
- package/src/core-map/ts-maps.css +392 -99
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether these sections are just a string in disguise.
|
|
3
|
+
*
|
|
4
|
+
* Most `format` expressions in real styles carry no options at all — they are
|
|
5
|
+
* written for the newline, or for a conditional the author found easier to
|
|
6
|
+
* express there. Those take the plain text path, which measures and draws in
|
|
7
|
+
* one call instead of per section.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isUniform(sections: FormattedSection[]): boolean;
|
|
10
|
+
/** Duck-typed, so a value crossing a module boundary is still recognised. */
|
|
11
|
+
export declare function isFormatted(value: unknown): value is Formatted;
|
|
12
|
+
// Formatted — the value `format` evaluates to.
|
|
13
|
+
//
|
|
14
|
+
// `["format", "Main", {}, " St", { "font-scale": 0.8 }]` is one label whose
|
|
15
|
+
// parts are drawn differently: a road shield's number larger than its prefix,
|
|
16
|
+
// a place name above a smaller subtitle, a unit in a lighter colour. The
|
|
17
|
+
// sections have to survive as structure all the way to the renderer, because
|
|
18
|
+
// the whole point of them is that they are not one uniform run of text.
|
|
19
|
+
//
|
|
20
|
+
// They also have to keep behaving like a string. `text-field` is read in
|
|
21
|
+
// several places that only want to know whether there is any text and how
|
|
22
|
+
// long it is, and a caller reading a feature's label through the query API
|
|
23
|
+
// expects a string. `toString` concatenates, so every one of those paths keeps
|
|
24
|
+
// working and only the drawing code needs to know sections exist.
|
|
25
|
+
export declare interface FormattedSection {
|
|
26
|
+
text: string
|
|
27
|
+
scale?: number
|
|
28
|
+
fontStack?: string[]
|
|
29
|
+
color?: string
|
|
30
|
+
}
|
|
31
|
+
export declare class Formatted {
|
|
32
|
+
sections: FormattedSection[];
|
|
33
|
+
constructor(sections: FormattedSection[]);
|
|
34
|
+
toString(): string;
|
|
35
|
+
get uniform(): boolean;
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function registerBindingOps(): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Great-circle distance in metres.
|
|
3
|
+
*
|
|
4
|
+
* Haversine rather than a planar approximation: a planar one is wrong by
|
|
5
|
+
* kilometres at high latitude, which is exactly where "is this within 500m"
|
|
6
|
+
* questions stop being decorative.
|
|
7
|
+
*/
|
|
8
|
+
export declare function haversine(a: Position, b: Position): number;
|
|
9
|
+
/**
|
|
10
|
+
* Even-odd ray casting, with the boundary counted as inside.
|
|
11
|
+
*
|
|
12
|
+
* A point exactly on an edge is a real case — shared borders, snapped data —
|
|
13
|
+
* and excluding it makes two adjacent polygons disagree about who owns it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function pointInRing(point: Position, ring: Position[]): boolean;
|
|
16
|
+
/** Inside the outer ring and outside every hole. */
|
|
17
|
+
export declare function pointInPolygon(point: Position, polygon: Position[][]): boolean;
|
|
18
|
+
export declare function registerGeometryOps(): void;
|
|
19
|
+
declare type Position = [number, number];
|
|
@@ -8,14 +8,17 @@ export declare interface EvaluationContext {
|
|
|
8
8
|
type: 1 | 2 | 3
|
|
9
9
|
id?: number | string
|
|
10
10
|
properties: Record<string, unknown>
|
|
11
|
+
geometry?: () => unknown
|
|
11
12
|
}
|
|
12
13
|
featureState?: Record<string, unknown>
|
|
13
14
|
lineProgress?: number
|
|
15
|
+
heatmapDensity?: number
|
|
14
16
|
globalProperties?: {
|
|
15
17
|
bearing?: number
|
|
16
18
|
pitch?: number
|
|
17
19
|
zoom: number
|
|
18
20
|
}
|
|
21
|
+
bindings?: Record<string, unknown>
|
|
19
22
|
}
|
|
20
23
|
// A compiled expression: a closure plus metadata the renderer uses to decide
|
|
21
24
|
// whether it needs to re-evaluate on zoom change, on feature change, or on
|