esri-gl 0.9.0-alpha.10
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/LICENSE +227 -0
- package/README.md +455 -0
- package/dist/esri-gl.esm.js +2694 -0
- package/dist/esri-gl.esm.js.map +1 -0
- package/dist/esri-gl.js +2719 -0
- package/dist/esri-gl.js.map +1 -0
- package/dist/esri-gl.min.js +2 -0
- package/dist/esri-gl.min.js.map +1 -0
- package/dist/types/Services/DynamicMapService.d.ts +35 -0
- package/dist/types/Services/FeatureService.d.ts +48 -0
- package/dist/types/Services/ImageService.d.ts +32 -0
- package/dist/types/Services/MapService.d.ts +30 -0
- package/dist/types/Services/MapServiceTypes.d.ts +87 -0
- package/dist/types/Services/Service.d.ts +118 -0
- package/dist/types/Services/SimpleMapService.d.ts +30 -0
- package/dist/types/Services/TiledMapService.d.ts +28 -0
- package/dist/types/Services/VectorBasemapStyle.d.ts +9 -0
- package/dist/types/Services/VectorTileService.d.ts +41 -0
- package/dist/types/Tasks/Find.d.ts +85 -0
- package/dist/types/Tasks/IdentifyFeatures.d.ts +91 -0
- package/dist/types/Tasks/IdentifyImage.d.ts +107 -0
- package/dist/types/Tasks/Query.d.ts +180 -0
- package/dist/types/Tasks/Task.d.ts +50 -0
- package/dist/types/examples/EsriLeafletStyleAPI.d.ts +8 -0
- package/dist/types/main.d.ts +14 -0
- package/dist/types/types.d.ts +88 -0
- package/dist/types/utils.d.ts +4 -0
- package/package.json +116 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Service } from '@/Services/Service';
|
|
2
|
+
import type { ServiceCallback } from '@/Services/Service';
|
|
3
|
+
export interface TaskOptions {
|
|
4
|
+
url?: string;
|
|
5
|
+
proxy?: boolean;
|
|
6
|
+
useCors?: boolean;
|
|
7
|
+
requestParams?: Record<string, unknown>;
|
|
8
|
+
token?: string;
|
|
9
|
+
apikey?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Base Task class for ArcGIS REST API operations
|
|
13
|
+
* Similar to Esri Leaflet's Task class
|
|
14
|
+
*/
|
|
15
|
+
export declare class Task {
|
|
16
|
+
protected _service?: Service;
|
|
17
|
+
protected options: TaskOptions;
|
|
18
|
+
protected params: Record<string, unknown>;
|
|
19
|
+
protected path: string;
|
|
20
|
+
protected setters: Record<string, string>;
|
|
21
|
+
constructor(endpoint: string | TaskOptions | Service);
|
|
22
|
+
/**
|
|
23
|
+
* Generate a method for each methodName:paramName in the setters for this task
|
|
24
|
+
*/
|
|
25
|
+
generateSetter(param: string, context: Task): (value: unknown) => Task;
|
|
26
|
+
/**
|
|
27
|
+
* Set authentication token
|
|
28
|
+
*/
|
|
29
|
+
token(token: string): Task;
|
|
30
|
+
/**
|
|
31
|
+
* Set API key (alias for token)
|
|
32
|
+
*/
|
|
33
|
+
apikey(apikey: string): Task;
|
|
34
|
+
/**
|
|
35
|
+
* Set whether to return formatted or unformatted values (ArcGIS Server 10.5+)
|
|
36
|
+
*/
|
|
37
|
+
format(formatted: boolean): Task;
|
|
38
|
+
/**
|
|
39
|
+
* Execute the task request with callback (Esri Leaflet style)
|
|
40
|
+
*/
|
|
41
|
+
run(callback: ServiceCallback): void;
|
|
42
|
+
/**
|
|
43
|
+
* Execute the task request with Promise
|
|
44
|
+
*/
|
|
45
|
+
request<T = unknown>(): Promise<T>;
|
|
46
|
+
/**
|
|
47
|
+
* Direct HTTP request (when not using a service)
|
|
48
|
+
*/
|
|
49
|
+
private _request;
|
|
50
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Esri Leaflet Style API Examples
|
|
3
|
+
* This demonstrates how our implementation now matches Esri Leaflet exactly
|
|
4
|
+
* Updated to use Services-only approach
|
|
5
|
+
*/
|
|
6
|
+
declare const service: import("../Services/SimpleMapService").MapService;
|
|
7
|
+
declare function exampleAsync(): Promise<void>;
|
|
8
|
+
export { service, exampleAsync };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { Service } from '@/Services/Service';
|
|
2
|
+
export { DynamicMapService } from '@/Services/DynamicMapService';
|
|
3
|
+
export { TiledMapService } from '@/Services/TiledMapService';
|
|
4
|
+
export { ImageService } from '@/Services/ImageService';
|
|
5
|
+
export { VectorBasemapStyle } from '@/Services/VectorBasemapStyle';
|
|
6
|
+
export { VectorTileService } from '@/Services/VectorTileService';
|
|
7
|
+
export { FeatureService } from '@/Services/FeatureService';
|
|
8
|
+
export { Task } from '@/Tasks/Task';
|
|
9
|
+
export { Query, query } from '@/Tasks/Query';
|
|
10
|
+
export { Find, find } from '@/Tasks/Find';
|
|
11
|
+
export { IdentifyFeatures } from '@/Tasks/IdentifyFeatures';
|
|
12
|
+
export { IdentifyImage, identifyImage } from '@/Tasks/IdentifyImage';
|
|
13
|
+
export { cleanTrailingSlash, getServiceDetails, updateAttribution } from '@/utils';
|
|
14
|
+
export * from '@/types';
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export type { Map } from 'maplibre-gl';
|
|
2
|
+
export interface ServiceMetadata {
|
|
3
|
+
attribution?: string;
|
|
4
|
+
copyrightText?: string;
|
|
5
|
+
tiles?: string[];
|
|
6
|
+
defaultStyles?: string;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
export interface EsriServiceOptions {
|
|
10
|
+
url: string;
|
|
11
|
+
layers?: number[] | number | false;
|
|
12
|
+
layerDefs?: Record<string, string> | false;
|
|
13
|
+
format?: string;
|
|
14
|
+
dpi?: number;
|
|
15
|
+
transparent?: boolean;
|
|
16
|
+
getAttributionFromService?: boolean;
|
|
17
|
+
time?: number[] | false;
|
|
18
|
+
}
|
|
19
|
+
export interface RasterSourceOptions {
|
|
20
|
+
attribution?: string;
|
|
21
|
+
bounds?: [number, number, number, number];
|
|
22
|
+
maxzoom?: number;
|
|
23
|
+
minzoom?: number;
|
|
24
|
+
scheme?: 'xyz' | 'tms';
|
|
25
|
+
tileSize?: number;
|
|
26
|
+
volatile?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface VectorSourceOptions {
|
|
29
|
+
attribution?: string;
|
|
30
|
+
bounds?: [number, number, number, number];
|
|
31
|
+
maxzoom?: number;
|
|
32
|
+
minzoom?: number;
|
|
33
|
+
scheme?: 'xyz' | 'tms';
|
|
34
|
+
volatile?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface ImageServiceOptions extends EsriServiceOptions {
|
|
37
|
+
renderingRule?: Record<string, unknown> | false;
|
|
38
|
+
mosaicRule?: Record<string, unknown> | false;
|
|
39
|
+
bbox?: [number, number, number, number];
|
|
40
|
+
size?: [number, number];
|
|
41
|
+
bboxSR?: string;
|
|
42
|
+
imageSR?: string;
|
|
43
|
+
format?: 'jpgpng' | 'png' | 'png8' | 'png24' | 'jpg' | 'bmp' | 'gif' | 'tiff' | 'png32' | 'bip' | 'bsq' | 'lerc';
|
|
44
|
+
}
|
|
45
|
+
export interface FeatureServiceOptions {
|
|
46
|
+
url: string;
|
|
47
|
+
where?: string;
|
|
48
|
+
outFields?: string | string[];
|
|
49
|
+
f?: 'json' | 'geojson' | string;
|
|
50
|
+
returnGeometry?: boolean;
|
|
51
|
+
geometry?: Record<string, unknown>;
|
|
52
|
+
geometryType?: string;
|
|
53
|
+
spatialRel?: string;
|
|
54
|
+
inSR?: string;
|
|
55
|
+
outSR?: string;
|
|
56
|
+
orderByFields?: string;
|
|
57
|
+
groupByFieldsForStatistics?: string;
|
|
58
|
+
outStatistics?: Array<Record<string, unknown>>;
|
|
59
|
+
having?: string;
|
|
60
|
+
resultOffset?: number;
|
|
61
|
+
resultRecordCount?: number;
|
|
62
|
+
maxRecordCount?: number;
|
|
63
|
+
getAttributionFromService?: boolean;
|
|
64
|
+
useBoundingBox?: boolean;
|
|
65
|
+
useVectorTiles?: boolean;
|
|
66
|
+
token?: string;
|
|
67
|
+
layers?: number[] | number;
|
|
68
|
+
}
|
|
69
|
+
export interface VectorTileServiceOptions {
|
|
70
|
+
url: string;
|
|
71
|
+
getAttributionFromService?: boolean;
|
|
72
|
+
}
|
|
73
|
+
export interface VectorBasemapStyleOptions {
|
|
74
|
+
basemapEnum: string;
|
|
75
|
+
token: string;
|
|
76
|
+
language?: string;
|
|
77
|
+
worldview?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface SourceSpecification {
|
|
80
|
+
type: string;
|
|
81
|
+
[key: string]: unknown;
|
|
82
|
+
}
|
|
83
|
+
export interface LayerSpecification {
|
|
84
|
+
id: string;
|
|
85
|
+
type: string;
|
|
86
|
+
source?: string | SourceSpecification;
|
|
87
|
+
[key: string]: unknown;
|
|
88
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Map, ServiceMetadata } from '@/types';
|
|
2
|
+
export declare function cleanTrailingSlash(url: string): string;
|
|
3
|
+
export declare function getServiceDetails(url: string, fetchOptions?: RequestInit): Promise<ServiceMetadata>;
|
|
4
|
+
export declare function updateAttribution(newAttribution: string, sourceId: string, map: Map): void;
|
package/package.json
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "esri-gl",
|
|
3
|
+
"version": "0.9.0-alpha.10",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A module for making it easier to use Esri services in mapbox-gl or maplibre-gl.",
|
|
6
|
+
"main": "dist/esri-gl.js",
|
|
7
|
+
"module": "dist/esri-gl.esm.js",
|
|
8
|
+
"browser": "dist/esri-gl.js",
|
|
9
|
+
"types": "dist/types/main.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"dev": "vite",
|
|
15
|
+
"build": "npm run clean && npm run type-check && rollup -c",
|
|
16
|
+
"build:prod": "npm run clean && npm run type-check && npm run lint && rollup -c",
|
|
17
|
+
"build:watch": "rollup -c --watch",
|
|
18
|
+
"build:example": "vite build",
|
|
19
|
+
"preview:example": "vite preview",
|
|
20
|
+
"build-docs": "cd docs && npm run build",
|
|
21
|
+
"dev:docs": "cd docs && npm start",
|
|
22
|
+
"serve:docs": "cd docs && npm run serve",
|
|
23
|
+
"clean": "rimraf dist",
|
|
24
|
+
"type-check": "tsc --noEmit",
|
|
25
|
+
"type-check:watch": "tsc --noEmit --watch",
|
|
26
|
+
"lint": "eslint 'src/**/*.{ts,tsx,js,jsx}'",
|
|
27
|
+
"lint:fix": "eslint 'src/**/*.{ts,tsx,js,jsx}' --fix",
|
|
28
|
+
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,css,md}\"",
|
|
29
|
+
"format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,css,md}\"",
|
|
30
|
+
"test": "jest",
|
|
31
|
+
"test:watch": "jest --watch",
|
|
32
|
+
"test:coverage": "jest --coverage",
|
|
33
|
+
"test:ci": "jest --ci --coverage --watchAll=false",
|
|
34
|
+
"validate": "npm run type-check && npm run lint && npm run format:check && npm run test:ci",
|
|
35
|
+
"publish:redirects": "./scripts/publish-redirects.sh",
|
|
36
|
+
"publish:mapbox-redirect": "cd packages/esri-mapbox-gl && npm publish --access=public",
|
|
37
|
+
"publish:maplibre-redirect": "cd packages/esri-maplibre-gl && npm publish --access=public",
|
|
38
|
+
"release:patch": "npm version patch && npm publish",
|
|
39
|
+
"release:minor": "npm version minor && npm publish",
|
|
40
|
+
"release:major": "npm version major && npm publish",
|
|
41
|
+
"release:alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha",
|
|
42
|
+
"release:beta": "npm version prerelease --preid=beta && npm publish --tag beta",
|
|
43
|
+
"publish:alpha-current": "npm publish --tag alpha",
|
|
44
|
+
"publish:beta-current": "npm publish --tag beta",
|
|
45
|
+
"publish:github": "npm publish --registry=https://npm.pkg.github.com/",
|
|
46
|
+
"release:github:patch": "npm version patch && npm run publish:github",
|
|
47
|
+
"release:github:minor": "npm version minor && npm run publish:github",
|
|
48
|
+
"release:github:major": "npm version major && npm run publish:github",
|
|
49
|
+
"github-packages": "./scripts/github-packages.sh",
|
|
50
|
+
"prepublishOnly": "npm run validate && npm run build:prod",
|
|
51
|
+
"postversion": "git push && git push --tags"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@eslint/js": "^9.35.0",
|
|
55
|
+
"@rollup/plugin-alias": "^5.1.1",
|
|
56
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
57
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
58
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
59
|
+
"@types/jest": "^30.0.0",
|
|
60
|
+
"@types/react": "^19.1.13",
|
|
61
|
+
"@types/react-dom": "^19.1.9",
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "^8.44.0",
|
|
63
|
+
"@typescript-eslint/parser": "^8.44.0",
|
|
64
|
+
"@vitejs/plugin-react": "^5.0.3",
|
|
65
|
+
"ant-design-vue": "^4.2.6",
|
|
66
|
+
"ava": "^6.4.1",
|
|
67
|
+
"benchmark": "^2.1.4",
|
|
68
|
+
"cross-env": "^10.0.0",
|
|
69
|
+
"css-loader": "^7.1.2",
|
|
70
|
+
"eslint": "^9.35.0",
|
|
71
|
+
"eslint-config-mourner": "^4.1.0",
|
|
72
|
+
"esm": "^3.2.25",
|
|
73
|
+
"file-loader": "^6.2.0",
|
|
74
|
+
"jest": "^30.1.3",
|
|
75
|
+
"jest-environment-jsdom": "^30.1.2",
|
|
76
|
+
"json-loader": "^0.5.7",
|
|
77
|
+
"load-json-file": "^7.0.1",
|
|
78
|
+
"mapbox-gl": "^3.15.0",
|
|
79
|
+
"maplibre-gl": "^5.7.2",
|
|
80
|
+
"prettier": "^3.6.2",
|
|
81
|
+
"react": "^19.1.1",
|
|
82
|
+
"react-dom": "^19.1.1",
|
|
83
|
+
"remarkable": "^2.0.1",
|
|
84
|
+
"rimraf": "^6.0.1",
|
|
85
|
+
"rollup": "^4.50.2",
|
|
86
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
87
|
+
"style-loader": "^4.0.0",
|
|
88
|
+
"ts-jest": "^29.4.2",
|
|
89
|
+
"typescript": "^5.9.2",
|
|
90
|
+
"vite": "^7.1.5",
|
|
91
|
+
"webpack": "^5.101.3",
|
|
92
|
+
"webpack-cli": "^6.0.1",
|
|
93
|
+
"webpack-dev-server": "^5.2.2"
|
|
94
|
+
},
|
|
95
|
+
"repository": {
|
|
96
|
+
"type": "git",
|
|
97
|
+
"url": "https://github.com/muimsd/esri-gl.git"
|
|
98
|
+
},
|
|
99
|
+
"bugs": {
|
|
100
|
+
"url": "https://github.com/muimsd/esri-gl/issues"
|
|
101
|
+
},
|
|
102
|
+
"homepage": "https://esri-gl.netlify.app",
|
|
103
|
+
"demo": "https://esri-gl-demo.netlify.app",
|
|
104
|
+
"author": "Muhammad Imran Siddique 2025, Rowan Winsemius 2020-2025",
|
|
105
|
+
"license": "MIT",
|
|
106
|
+
"keywords": [
|
|
107
|
+
"mapbox",
|
|
108
|
+
"maplibre",
|
|
109
|
+
"map",
|
|
110
|
+
"esri",
|
|
111
|
+
"gl",
|
|
112
|
+
"typescript",
|
|
113
|
+
"react",
|
|
114
|
+
"react-map-gl"
|
|
115
|
+
]
|
|
116
|
+
}
|