-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #244 from wri/feat/TM-905-create-map-instance
[TM-905] Update map instance
- Loading branch information
Showing
29 changed files
with
3,929 additions
and
644 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
export as namespace GeoJSON; | ||
export type GeoJsonGeometryTypes = Geometry["type"]; | ||
|
||
export type GeoJsonTypes = GeoJSON["type"]; | ||
|
||
export type BBox = [number, number, number, number]; | ||
|
||
export type Position = number[]; | ||
|
||
export interface GeoJsonObject { | ||
type: GeoJsonTypes; | ||
bbox?: BBox | undefined; | ||
} | ||
export type GeoJSON = Geometry | Feature | FeatureCollection; | ||
export type Geometry = Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon | GeometryCollection; | ||
export type GeometryObject = Geometry; | ||
|
||
export interface Point extends GeoJsonObject { | ||
type: "Point"; | ||
coordinates: Position; | ||
} | ||
|
||
export interface MultiPoint extends GeoJsonObject { | ||
type: "MultiPoint"; | ||
coordinates: Position[]; | ||
} | ||
|
||
export interface LineString extends GeoJsonObject { | ||
type: "LineString"; | ||
coordinates: Position[]; | ||
} | ||
|
||
export interface MultiLineString extends GeoJsonObject { | ||
type: "MultiLineString"; | ||
coordinates: Position[][]; | ||
} | ||
export interface Polygon extends GeoJsonObject { | ||
type: "Polygon"; | ||
coordinates: Position[][]; | ||
} | ||
|
||
export interface MultiPolygon extends GeoJsonObject { | ||
type: "MultiPolygon"; | ||
coordinates: Position[][][]; | ||
} | ||
|
||
export type GeoJsonProperties = { [name: string]: unknown } | null; | ||
|
||
export interface Feature<G extends Geometry | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject { | ||
type: "Feature"; | ||
geometry: G; | ||
id?: string | number | undefined; | ||
properties: P; | ||
} | ||
|
||
export interface FeatureCollection<G extends Geometry | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject { | ||
type: "FeatureCollection"; | ||
features: Array<Feature<G, P>>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import mapboxgl, { FillLayer, LineLayer } from "mapbox-gl"; | ||
|
||
type LayerStyle = Pick<mapboxgl.Style, "metadata"> & (FillLayer | LineLayer); | ||
|
||
export type LayerWithStyle = LayerStyle; | ||
|
||
export interface LayerType { | ||
name: string; | ||
styles: LayerWithStyle[]; | ||
} | ||
|
||
export type ControlType = Control | IControl; | ||
|
||
export type TooltipType = "edit" | "goTo" | "view"; |
Oops, something went wrong.