add addzone and update zone in map-adapter interface

This commit is contained in:
2025-09-29 14:55:14 -04:00
parent 67c94197e1
commit db3ec6cddd
7851 changed files with 833548 additions and 18 deletions
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
+15
View File
@@ -0,0 +1,15 @@
# Installation
> `npm install --save @types/geojson-vt`
# Summary
This package contains type definitions for geojson-vt (https://github.com/mapbox/geojson-vt).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/geojson-vt.
### Additional Details
* Last updated: Fri, 01 Dec 2023 21:06:51 GMT
* Dependencies: [@types/geojson](https://npmjs.com/package/@types/geojson)
# Credits
These definitions were written by [Cody Duong](https://github.com/codyduong).
+128
View File
@@ -0,0 +1,128 @@
import * as GJ from "geojson";
declare namespace geojsonvt {
interface Options {
/** max zoom to preserve detail on; can't be higher than 24 */
maxZoom?: number;
/** simplification tolerance (higher means simpler) */
tolerance?: number;
/** tile extent (both width and height) */
extent?: number;
/** tile buffer on each side */
buffer?: number;
/** logging level (0 to disable, 1 or 2) */
debug?: 0 | 1 | 2;
/** whether to enable line metrics tracking for LineString/MultiLineString features */
lineMetrics?: boolean;
/** name of a feature property to promote to feature.id. Cannot be used with `generateId` */
promoteId?: null | string;
/** whether to generate feature ids. Cannot be used with `promoteId` */
generateId?: boolean;
/** max zoom in the initial tile index */
indexMaxZoom?: number;
/** max number of points per tile in the index */
indexMaxPoints?: number;
}
enum FeatureTypes {
Unknown = 0,
Point = 1,
Linestring = 2,
Polygon = 3,
}
type Geometry = [number, number];
/**
* https://github.com/mapbox/vector-tile-spec/tree/master/2.1#42-features
*/
interface Feature {
/**
* A feature MUST contain a geometry field.
*/
geometry: Geometry[];
/**
* A feature MAY contain an id field. If a feature has an id field, the value of the id SHOULD be unique among the features of the parent layer.
*/
id?: `${number}`;
/**
* A feature MUST contain a type field as described in the Geometry Types section.
*/
type: FeatureTypes;
/**
* A feature MAY contain a tags field. Feature-level metadata, if any, SHOULD be stored in the tags field.
*/
tags?: Record<string, any>;
}
type Features = Feature[];
interface Source {
geometry: number[][];
maxX: number;
maxY: number;
minX: number;
minY: number;
tags?: Record<string, any>;
type?: Exclude<GJ.GeoJsonGeometryTypes, "GeometryCollection">; // Converts all collections to single types
}
/**
* Resulting tiles conform to the JSON equivalent of the vector tile specification.
* https://github.com/mapbox/vector-tile-spec/
*/
interface Tile {
features: Features;
numPoints: number;
numSimplified: number;
numFeatures: number;
source: Source | null;
x: number;
y: number;
z: number;
// z2: number -- In the development/demo distribution this is z2, but in source code it is z?;
transformed: boolean;
minX: number;
minY: number;
maxX: number;
maxY: number;
}
interface TileCoord {
x: number;
y: number;
z: number;
}
type TileCoords = TileCoord[];
type Data = GJ.GeoJSON;
}
declare class GeoJSONVT {
constructor(data: geojsonvt.Data, options: geojsonvt.Options);
options: geojsonvt.Options;
/**
* Resulting tiles conform to the JSON equivalent of the vector tile specification.
* https://github.com/mapbox/vector-tile-spec/
*/
tiles: Record<`${number}`, geojsonvt.Tile>;
tileCoords: geojsonvt.TileCoords;
total: number;
stats: Record<`z${number}`, number>;
/**
* splits features from a parent tile to sub-tiles.
* @param features
* @param z z / zoom coordinate of the parent tile
* @param x x coordinate of the parent tile
* @param y y coordinate of the parent tile
* @param cz z / zoom coordinate of the target tile
* @param cx x coordinate of the target tile
* @param cy y coordinate of the target tile
*/
splitTile(features: geojsonvt.Tile, z: number, x: number, y: number, cz: number, cx: number, cy: number): void;
/**
* gets a tile based on coordinates
* @param z z / zoom coordinate (supports both number or string input)
* @param x x coordinate (supports both number or string input)
* @param y y coordinate (supports both number or string input)
*/
getTile(z: number | string, x: number | string, y: number | string): null | geojsonvt.Tile;
}
declare function geojsonvt(data: geojsonvt.Data, options: geojsonvt.Options): GeoJSONVT;
export = geojsonvt;
+27
View File
@@ -0,0 +1,27 @@
{
"name": "@types/geojson-vt",
"version": "3.2.5",
"description": "TypeScript definitions for geojson-vt",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/geojson-vt",
"license": "MIT",
"contributors": [
{
"name": "Cody Duong",
"githubUsername": "codyduong",
"url": "https://github.com/codyduong"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/geojson-vt"
},
"scripts": {},
"dependencies": {
"@types/geojson": "*"
},
"typesPublisherContentHash": "1cdbbc023f01bb5d2cdccfd42e5262a01d0fc93231a65b1b9a5a1e4a33c9ad53",
"typeScriptVersion": "4.6"
}
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
+15
View File
@@ -0,0 +1,15 @@
# Installation
> `npm install --save @types/geojson`
# Summary
This package contains type definitions for geojson (https://geojson.org/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/geojson.
### Additional Details
* Last updated: Thu, 23 Jan 2025 18:36:51 GMT
* Dependencies: none
# Credits
These definitions were written by [Jacob Bruun](https://github.com/cobster), [Arne Schubert](https://github.com/atd-schubert), [Jeff Jacobson](https://github.com/JeffJacobson), [Ilia Choly](https://github.com/icholy), and [Dan Vanderkam](https://github.com/danvk).
+202
View File
@@ -0,0 +1,202 @@
// Note: as of the RFC 7946 version of GeoJSON, Coordinate Reference Systems
// are no longer supported. (See https://tools.ietf.org/html/rfc7946#appendix-B)}
export as namespace GeoJSON;
/**
* The valid values for the "type" property of GeoJSON geometry objects.
* https://tools.ietf.org/html/rfc7946#section-1.4
*/
export type GeoJsonGeometryTypes = Geometry["type"];
/**
* The value values for the "type" property of GeoJSON Objects.
* https://tools.ietf.org/html/rfc7946#section-1.4
*/
export type GeoJsonTypes = GeoJSON["type"];
/**
* Bounding box
* https://tools.ietf.org/html/rfc7946#section-5
*/
export type BBox = [number, number, number, number] | [number, number, number, number, number, number];
/**
* A Position is an array of coordinates.
* https://tools.ietf.org/html/rfc7946#section-3.1.1
* Array should contain between two and three elements.
* The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values),
* but the current specification only allows X, Y, and (optionally) Z to be defined.
*
* Note: the type will not be narrowed down to `[number, number] | [number, number, number]` due to
* marginal benefits and the large impact of breaking change.
*
* See previous discussions on the type narrowing:
* - {@link https://github.com/DefinitelyTyped/DefinitelyTyped/pull/21590|Nov 2017}
* - {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/67773|Dec 2023}
* - {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/71441| Dec 2024}
*
* One can use a
* {@link https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates|user-defined type guard that returns a type predicate}
* to determine if a position is a 2D or 3D position.
*
* @example
* import type { Position } from 'geojson';
*
* type StrictPosition = [x: number, y: number] | [x: number, y: number, z: number]
*
* function isStrictPosition(position: Position): position is StrictPosition {
* return position.length === 2 || position.length === 3
* };
*
* let position: Position = [-116.91, 45.54];
*
* let x: number;
* let y: number;
* let z: number | undefined;
*
* if (isStrictPosition(position)) {
* // `tsc` would throw an error if we tried to destructure a fourth parameter
* [x, y, z] = position;
* } else {
* throw new TypeError("Position is not a 2D or 3D point");
* }
*/
export type Position = number[];
/**
* The base GeoJSON object.
* https://tools.ietf.org/html/rfc7946#section-3
* The GeoJSON specification also allows foreign members
* (https://tools.ietf.org/html/rfc7946#section-6.1)
* Developers should use "&" type in TypeScript or extend the interface
* to add these foreign members.
*/
export interface GeoJsonObject {
// Don't include foreign members directly into this type def.
// in order to preserve type safety.
// [key: string]: any;
/**
* Specifies the type of GeoJSON object.
*/
type: GeoJsonTypes;
/**
* Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections.
* The value of the bbox member is an array of length 2*n where n is the number of dimensions
* represented in the contained geometries, with all axes of the most southwesterly point
* followed by all axes of the more northeasterly point.
* The axes order of a bbox follows the axes order of geometries.
* https://tools.ietf.org/html/rfc7946#section-5
*/
bbox?: BBox | undefined;
}
/**
* Union of GeoJSON objects.
*/
export type GeoJSON<G extends Geometry | null = Geometry, P = GeoJsonProperties> =
| G
| Feature<G, P>
| FeatureCollection<G, P>;
/**
* Geometry object.
* https://tools.ietf.org/html/rfc7946#section-3
*/
export type Geometry = Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon | GeometryCollection;
export type GeometryObject = Geometry;
/**
* Point geometry object.
* https://tools.ietf.org/html/rfc7946#section-3.1.2
*/
export interface Point extends GeoJsonObject {
type: "Point";
coordinates: Position;
}
/**
* MultiPoint geometry object.
* https://tools.ietf.org/html/rfc7946#section-3.1.3
*/
export interface MultiPoint extends GeoJsonObject {
type: "MultiPoint";
coordinates: Position[];
}
/**
* LineString geometry object.
* https://tools.ietf.org/html/rfc7946#section-3.1.4
*/
export interface LineString extends GeoJsonObject {
type: "LineString";
coordinates: Position[];
}
/**
* MultiLineString geometry object.
* https://tools.ietf.org/html/rfc7946#section-3.1.5
*/
export interface MultiLineString extends GeoJsonObject {
type: "MultiLineString";
coordinates: Position[][];
}
/**
* Polygon geometry object.
* https://tools.ietf.org/html/rfc7946#section-3.1.6
*/
export interface Polygon extends GeoJsonObject {
type: "Polygon";
coordinates: Position[][];
}
/**
* MultiPolygon geometry object.
* https://tools.ietf.org/html/rfc7946#section-3.1.7
*/
export interface MultiPolygon extends GeoJsonObject {
type: "MultiPolygon";
coordinates: Position[][][];
}
/**
* Geometry Collection
* https://tools.ietf.org/html/rfc7946#section-3.1.8
*/
export interface GeometryCollection<G extends Geometry = Geometry> extends GeoJsonObject {
type: "GeometryCollection";
geometries: G[];
}
export type GeoJsonProperties = { [name: string]: any } | null;
/**
* A feature object which contains a geometry and associated properties.
* https://tools.ietf.org/html/rfc7946#section-3.2
*/
export interface Feature<G extends Geometry | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject {
type: "Feature";
/**
* The feature's geometry
*/
geometry: G;
/**
* A value that uniquely identifies this feature in a
* https://tools.ietf.org/html/rfc7946#section-3.2.
*/
id?: string | number | undefined;
/**
* Properties associated with this feature.
*/
properties: P;
}
/**
* A collection of feature objects.
* https://tools.ietf.org/html/rfc7946#section-3.3
*/
export interface FeatureCollection<G extends Geometry | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject {
type: "FeatureCollection";
features: Array<Feature<G, P>>;
}
+46
View File
@@ -0,0 +1,46 @@
{
"name": "@types/geojson",
"version": "7946.0.16",
"description": "TypeScript definitions for geojson",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/geojson",
"license": "MIT",
"contributors": [
{
"name": "Jacob Bruun",
"githubUsername": "cobster",
"url": "https://github.com/cobster"
},
{
"name": "Arne Schubert",
"githubUsername": "atd-schubert",
"url": "https://github.com/atd-schubert"
},
{
"name": "Jeff Jacobson",
"githubUsername": "JeffJacobson",
"url": "https://github.com/JeffJacobson"
},
{
"name": "Ilia Choly",
"githubUsername": "icholy",
"url": "https://github.com/icholy"
},
{
"name": "Dan Vanderkam",
"githubUsername": "danvk",
"url": "https://github.com/danvk"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/geojson"
},
"scripts": {},
"dependencies": {},
"peerDependencies": {},
"typesPublisherContentHash": "e7997f4827a9a92b60c7a6cb27e8f18fa760803e9dd021965e95604338b72e88",
"typeScriptVersion": "5.0"
}
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
+15
View File
@@ -0,0 +1,15 @@
# Installation
> `npm install --save @types/supercluster`
# Summary
This package contains type definitions for supercluster (https://github.com/mapbox/supercluster).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/supercluster.
### Additional Details
* Last updated: Tue, 07 Nov 2023 15:11:36 GMT
* Dependencies: [@types/geojson](https://npmjs.com/package/@types/geojson)
# Credits
These definitions were written by [Denis Carriere](https://github.com/DenisCarriere), and [Nick Zahn](https://github.com/Manc).
+185
View File
@@ -0,0 +1,185 @@
import * as GeoJSON from "geojson";
export as namespace supercluster;
declare namespace Supercluster {
interface Options<P, C> {
/**
* Minimum zoom level at which clusters are generated.
*
* @default 0
*/
minZoom?: number | undefined;
/**
* Maximum zoom level at which clusters are generated.
*
* @default 16
*/
maxZoom?: number | undefined;
/**
* Minimum number of points to form a cluster.
*
* @default 2
*/
minPoints?: number | undefined;
/**
* Cluster radius, in pixels.
*
* @default 40
*/
radius?: number | undefined;
/**
* (Tiles) Tile extent. Radius is calculated relative to this value.
*
* @default 512
*/
extent?: number | undefined;
/**
* Size of the KD-tree leaf node. Affects performance.
*
* @default 64
*/
nodeSize?: number | undefined;
/**
* Whether timing info should be logged.
*
* @default false
*/
log?: boolean | undefined;
/**
* Whether to generate ids for input features in vector tiles.
*
* @default false
*/
generateId?: boolean | undefined;
/**
* A function that returns cluster properties corresponding to a single point.
*
* @example
* (props) => ({sum: props.myValue})
*/
map?: ((props: P) => C) | undefined;
/**
* A reduce function that merges properties of two clusters into one.
*
* @example
* (accumulated, props) => { accumulated.sum += props.sum; }
*/
reduce?: ((accumulated: C, props: Readonly<C>) => void) | undefined;
}
/**
* Default properties type, allowing any properties.
* Try to avoid this for better typesafety by using proper types.
*/
interface AnyProps {
[name: string]: any;
}
/**
* [GeoJSON Feature](https://tools.ietf.org/html/rfc7946#section-3.2),
* with the geometry being a
* [GeoJSON Point](https://tools.ietf.org/html/rfc7946#section-3.1.2).
*/
type PointFeature<P> = GeoJSON.Feature<GeoJSON.Point, P>;
interface ClusterProperties {
/**
* Always `true` to indicate that the Feature is a Cluster and not
* an individual point.
*/
cluster: true;
/** Cluster ID */
cluster_id: number;
/** Number of points in the cluster. */
point_count: number;
/**
* Abbreviated number of points in the cluster as string if the number
* is 1000 or greater (e.g. `1.3k` if the number is 1298).
*
* For less than 1000 points it is the same value as `point_count`.
*/
point_count_abbreviated: string | number;
}
type ClusterFeature<C> = PointFeature<ClusterProperties & C>;
interface TileFeature<C, P> {
type: 1;
geometry: Array<[number, number]>;
tags: (ClusterProperties & C) | P;
}
interface Tile<C, P> {
features: Array<TileFeature<C, P>>;
}
}
/**
* A very fast geospatial point clustering library for browsers and Node.
*/
declare class Supercluster<
P extends GeoJSON.GeoJsonProperties = Supercluster.AnyProps,
C extends GeoJSON.GeoJsonProperties = Supercluster.AnyProps,
> {
constructor(options?: Supercluster.Options<P, C>);
/**
* Loads an array of GeoJSON Feature objects. Each feature's geometry
* must be a GeoJSON Point. Once loaded, index is immutable.
*
* @param points Array of GeoJSON Features, the geometries being GeoJSON Points.
*/
load(points: Array<Supercluster.PointFeature<P>>): Supercluster<P, C>;
/**
* Returns an array of clusters and points as `GeoJSON.Feature` objects
* for the given bounding box (`bbox`) and zoom level (`zoom`).
*
* @param bbox Bounding box (`[westLng, southLat, eastLng, northLat]`).
* @param zoom Zoom level.
*/
getClusters(bbox: GeoJSON.BBox, zoom: number): Array<Supercluster.ClusterFeature<C> | Supercluster.PointFeature<P>>;
/**
* For a given zoom and x/y coordinates, returns a
* [geojson-vt](https://github.com/mapbox/geojson-vt)-compatible JSON
* tile object with cluster any point features.
*/
getTile(zoom: number, x: number, y: number): Supercluster.Tile<C, P> | null;
/**
* Returns the children of a cluster (on the next zoom level).
*
* @param clusterId Cluster ID (`cluster_id` value from feature properties).
* @throws {Error} If `clusterId` does not exist.
*/
getChildren(clusterId: number): Array<Supercluster.ClusterFeature<C> | Supercluster.PointFeature<P>>;
/**
* Returns all the points of a cluster (with pagination support).
*
* @param clusterId Cluster ID (`cluster_id` value from feature properties).
* @param limit The number of points to return (set to `Infinity` for all points).
* @param offset The amount of points to skip (for pagination).
*/
getLeaves(clusterId: number, limit?: number, offset?: number): Array<Supercluster.PointFeature<P>>;
/**
* Returns the zoom level on which the cluster expands into several
* children (useful for "click to zoom" feature).
*
* @param clusterId Cluster ID (`cluster_id` value from feature properties).
*/
getClusterExpansionZoom(clusterId: number): number;
}
export = Supercluster;
+32
View File
@@ -0,0 +1,32 @@
{
"name": "@types/supercluster",
"version": "7.1.3",
"description": "TypeScript definitions for supercluster",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/supercluster",
"license": "MIT",
"contributors": [
{
"name": "Denis Carriere",
"githubUsername": "DenisCarriere",
"url": "https://github.com/DenisCarriere"
},
{
"name": "Nick Zahn",
"githubUsername": "Manc",
"url": "https://github.com/Manc"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/supercluster"
},
"scripts": {},
"dependencies": {
"@types/geojson": "*"
},
"typesPublisherContentHash": "883fb7311fcd4f97d0f1472bc6b1c31899cd1888f8ba52ccc2a2e4022ca85d22",
"typeScriptVersion": "4.5"
}