@yappkit/front-module-map 0.1.8 → 0.2.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/lib/DeckGLOverlay.js +76 -0
- package/lib/providers/deckgl.js +111 -110
- package/lib/providers/google-maps.js +287 -332
- package/lib/providers/mapbox.js +230 -238
- package/lib/providers/maplibre.js +27 -244
- package/lib/searoute.js +38321 -59
- package/lib/types/main.d.ts +27 -0
- package/lib/types/providers/DeckGL.d.ts +10 -0
- package/lib/types/providers/DeckGLOverlay.d.ts +30 -0
- package/lib/types/providers/GoogleMaps.d.ts +41 -0
- package/lib/types/providers/Mapbox.d.ts +114 -0
- package/lib/types/providers/Maplibre.d.ts +13 -0
- package/lib/types/searoute/searoute.d.ts +1 -0
- package/lib/types/utils/getAirRoute.d.ts +6 -0
- package/lib/types/utils/getWaterRoute.d.ts +6 -0
- package/lib/types/utils/normalizeRoute.d.ts +1 -0
- package/lib/yappkit-map.js +60 -729
- package/package.json +21 -17
- package/lib/mapbox-gl.css +0 -1
- package/lib/mapbox-gl.js +0 -32271
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Mapbox from './providers/Mapbox.js';
|
|
2
|
+
import Maplibre from './providers/Maplibre.js';
|
|
3
|
+
import GoogleMaps from './providers/GoogleMaps.js';
|
|
4
|
+
import DeckGL from './providers/DeckGL.js';
|
|
5
|
+
import getAirRoute from './utils/getAirRoute.js';
|
|
6
|
+
import getWaterRoute from './utils/getWaterRoute.js';
|
|
7
|
+
import normalizeRoute from './utils/normalizeRoute.js';
|
|
8
|
+
export declare const utils: {
|
|
9
|
+
getAirRoute: typeof getAirRoute;
|
|
10
|
+
getWaterRoute: typeof getWaterRoute;
|
|
11
|
+
normalizeRoute: typeof normalizeRoute;
|
|
12
|
+
};
|
|
13
|
+
export declare const mapProviders: {
|
|
14
|
+
mapbox: typeof Mapbox;
|
|
15
|
+
maplibre: typeof Maplibre;
|
|
16
|
+
'maplibre-gl': typeof Maplibre;
|
|
17
|
+
google: typeof GoogleMaps;
|
|
18
|
+
'google-maps': typeof GoogleMaps;
|
|
19
|
+
deckgl: typeof DeckGL;
|
|
20
|
+
'deck-gl': typeof DeckGL;
|
|
21
|
+
};
|
|
22
|
+
export default class MapModule {
|
|
23
|
+
install(yAppKit: any): {
|
|
24
|
+
onAfterSetup: () => void;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export declare const loadMapModule: () => MapModule;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared deck.gl overlay wiring (#174): the class and the component below used to be duplicated
|
|
3
|
+
* verbatim in Mapbox.js and GoogleMaps.js — every fix (#151, #156, #165) had to be applied twice.
|
|
4
|
+
* Providers subclass DeckGLOverlay with their `_detach()` and build their component through
|
|
5
|
+
* makeDeckGLOverlayComponent with their inject key.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DeckGLOverlay {
|
|
8
|
+
overlay: any;
|
|
9
|
+
watching: {
|
|
10
|
+
options: boolean;
|
|
11
|
+
layers: boolean;
|
|
12
|
+
};
|
|
13
|
+
unwatchFn: any;
|
|
14
|
+
trackedIn: any;
|
|
15
|
+
constructor({ unwatchFn, trackedIn }: {
|
|
16
|
+
trackedIn?: null | undefined;
|
|
17
|
+
unwatchFn: any;
|
|
18
|
+
});
|
|
19
|
+
/** Stop the watchers, leave the map's tracking list and detach the overlay from the map (#151).
|
|
20
|
+
* @returns {void}
|
|
21
|
+
*/
|
|
22
|
+
destroy(): void;
|
|
23
|
+
watchOptions(opts: any, options?: {}): void;
|
|
24
|
+
watchLayers(layers: any, options?: {}): void;
|
|
25
|
+
}
|
|
26
|
+
/** Build the provider's DeckGLOverlay component, bound to its injected map key (#174).
|
|
27
|
+
* @param {string} mapInjectKey - The provide/inject key of the provider's map ref.
|
|
28
|
+
* @returns {import('vue').Component} The overlay component definition.
|
|
29
|
+
*/
|
|
30
|
+
export declare const makeDeckGLOverlayComponent: (mapInjectKey: string) => import('vue').Component;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export default class GoogleMaps {
|
|
2
|
+
apiKey: any;
|
|
3
|
+
libraries: any[];
|
|
4
|
+
version: any;
|
|
5
|
+
_mapsApiConfigured: boolean;
|
|
6
|
+
authFailed: boolean;
|
|
7
|
+
sdk: {};
|
|
8
|
+
deckgl: {
|
|
9
|
+
Tile3DLayer: typeof import("@deck.gl/geo-layers").Tile3DLayer;
|
|
10
|
+
} | null;
|
|
11
|
+
_MapComponent: any;
|
|
12
|
+
_Map3DComponent: any;
|
|
13
|
+
_DeckGLOverlayComponent: any;
|
|
14
|
+
_DeckGL3DTileLayerComponent: any;
|
|
15
|
+
ready: Promise<any>;
|
|
16
|
+
constructor(mapConfig: any);
|
|
17
|
+
get Map(): any;
|
|
18
|
+
get Map3D(): any;
|
|
19
|
+
get DeckGLOverlay(): any;
|
|
20
|
+
get DeckGL3DTileLayer(): any;
|
|
21
|
+
loadGoogleMapsSDK({ libraries }?: {
|
|
22
|
+
libraries?: never[] | undefined;
|
|
23
|
+
}): Promise<void>;
|
|
24
|
+
getSDK(options: any): Promise<any>;
|
|
25
|
+
createMap(elemRef: any, options?: {}): Promise<any>;
|
|
26
|
+
createMap3D(elemRef: any, options?: {}): Promise<any>;
|
|
27
|
+
loadDeckGL(): Promise<void>;
|
|
28
|
+
createDeckGL3DTileLayer(credits: any, options?: {}): Promise<import("@deck.gl/geo-layers").Tile3DLayer<any, {
|
|
29
|
+
id: "google-3d-tiles";
|
|
30
|
+
data: "https://tile.googleapis.com/v1/3dtiles/root.json";
|
|
31
|
+
loadOptions: {
|
|
32
|
+
fetch: {
|
|
33
|
+
headers: {
|
|
34
|
+
'X-GOOG-API-KEY': any;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
onTilesetLoad: (tileset3d: import("@loaders.gl/tiles").Tileset3D) => void;
|
|
39
|
+
operation: "terrain+draw";
|
|
40
|
+
}>>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export default class Mapbox {
|
|
2
|
+
apiKey: any;
|
|
3
|
+
services: any[];
|
|
4
|
+
sdk: {};
|
|
5
|
+
mapboxgl: {
|
|
6
|
+
AttributionControl: typeof import("mapbox-gl/esm").AttributionControl;
|
|
7
|
+
CanvasSource: typeof import("mapbox-gl/esm").CanvasSource;
|
|
8
|
+
CustomSource: typeof import("mapbox-gl/esm").CustomSource;
|
|
9
|
+
ErrorEvent: typeof import("mapbox-gl/esm").ErrorEvent;
|
|
10
|
+
Event: typeof import("mapbox-gl/esm").Event;
|
|
11
|
+
Evented: typeof import("mapbox-gl/esm").Evented;
|
|
12
|
+
FreeCameraOptions: typeof import("mapbox-gl/esm").FreeCameraOptions;
|
|
13
|
+
FullscreenControl: typeof import("mapbox-gl/esm").FullscreenControl;
|
|
14
|
+
GeoJSONSource: typeof import("mapbox-gl/esm").GeoJSONSource;
|
|
15
|
+
GeolocateControl: typeof import("mapbox-gl/esm").GeolocateControl;
|
|
16
|
+
ImageSource: typeof import("mapbox-gl/esm").ImageSource;
|
|
17
|
+
IndoorControl: typeof import("mapbox-gl/esm").IndoorControl;
|
|
18
|
+
InteractionEvent: typeof import("mapbox-gl/esm").InteractionEvent;
|
|
19
|
+
LngLat: typeof import("mapbox-gl/esm").LngLat;
|
|
20
|
+
LngLatBounds: typeof import("mapbox-gl/esm").LngLatBounds;
|
|
21
|
+
Map: typeof import("mapbox-gl/esm").Map;
|
|
22
|
+
MapMouseEvent: typeof import("mapbox-gl/esm").MapMouseEvent;
|
|
23
|
+
MapTouchEvent: typeof import("mapbox-gl/esm").MapTouchEvent;
|
|
24
|
+
MapWheelEvent: typeof import("mapbox-gl/esm").MapWheelEvent;
|
|
25
|
+
Marker: typeof import("mapbox-gl/esm").Marker;
|
|
26
|
+
MercatorCoordinate: typeof import("mapbox-gl/esm").MercatorCoordinate;
|
|
27
|
+
ModelSource: typeof import("mapbox-gl/esm").ModelSource;
|
|
28
|
+
NavigationControl: typeof import("mapbox-gl/esm").NavigationControl;
|
|
29
|
+
Point: typeof import("mapbox-gl/esm").Point;
|
|
30
|
+
Popup: typeof import("mapbox-gl/esm").Popup;
|
|
31
|
+
RasterArrayTileSource: typeof import("mapbox-gl/esm").RasterArrayTileSource;
|
|
32
|
+
RasterDemTileSource: typeof import("mapbox-gl/esm").RasterDemTileSource;
|
|
33
|
+
RasterTileSource: typeof import("mapbox-gl/esm").RasterTileSource;
|
|
34
|
+
ResourceType: {
|
|
35
|
+
readonly Unknown: "Unknown";
|
|
36
|
+
readonly Style: "Style";
|
|
37
|
+
readonly Source: "Source";
|
|
38
|
+
readonly Tile: "Tile";
|
|
39
|
+
readonly Glyphs: "Glyphs";
|
|
40
|
+
readonly SpriteImage: "SpriteImage";
|
|
41
|
+
readonly SpriteJSON: "SpriteJSON";
|
|
42
|
+
readonly Iconset: "Iconset";
|
|
43
|
+
readonly Image: "Image";
|
|
44
|
+
readonly Model: "Model";
|
|
45
|
+
};
|
|
46
|
+
ScaleControl: typeof import("mapbox-gl/esm").ScaleControl;
|
|
47
|
+
Style: typeof import("mapbox-gl/esm").Style;
|
|
48
|
+
TargetFeature: typeof import("mapbox-gl/esm").TargetFeature;
|
|
49
|
+
Tiled3DModelSource: typeof import("mapbox-gl/esm").Tiled3DModelSource;
|
|
50
|
+
VectorTileSource: typeof import("mapbox-gl/esm").VectorTileSource;
|
|
51
|
+
VideoSource: typeof import("mapbox-gl/esm").VideoSource;
|
|
52
|
+
addTileProvider: typeof import("mapbox-gl/esm").addTileProvider;
|
|
53
|
+
clearPrewarmedResources: typeof import("mapbox-gl/esm").clearPrewarmedResources;
|
|
54
|
+
clearStorage: typeof import("mapbox-gl/esm").clearStorage;
|
|
55
|
+
getBuildingGenUrl: typeof import("mapbox-gl/esm").getBuildingGenUrl;
|
|
56
|
+
getDracoUrl: typeof import("mapbox-gl/esm").getDracoUrl;
|
|
57
|
+
getMeshoptUrl: typeof import("mapbox-gl/esm").getMeshoptUrl;
|
|
58
|
+
getRTLTextPluginStatus: () => import("mapbox-gl/esm").PluginStatus;
|
|
59
|
+
getWorkerCount: typeof import("mapbox-gl/esm").getWorkerCount;
|
|
60
|
+
prewarm: typeof import("mapbox-gl/esm").prewarm;
|
|
61
|
+
restoreNow: () => void;
|
|
62
|
+
setAccessToken: typeof import("mapbox-gl/esm").setAccessToken;
|
|
63
|
+
setBaseApiUrl: typeof import("mapbox-gl/esm").setBaseApiUrl;
|
|
64
|
+
setBuildingGenUrl: typeof import("mapbox-gl/esm").setBuildingGenUrl;
|
|
65
|
+
setDracoUrl: typeof import("mapbox-gl/esm").setDracoUrl;
|
|
66
|
+
setMaxParallelImageRequests: typeof import("mapbox-gl/esm").setMaxParallelImageRequests;
|
|
67
|
+
setMeshoptUrl: typeof import("mapbox-gl/esm").setMeshoptUrl;
|
|
68
|
+
setNow: (time: number) => void;
|
|
69
|
+
setRTLTextPlugin: (url: string, callback?: ((error?: Error | null, result?: {
|
|
70
|
+
err: Error | null | undefined;
|
|
71
|
+
} | null | undefined) => void) | null, deferred?: boolean) => void;
|
|
72
|
+
setSdkInfo: typeof import("mapbox-gl/esm").setSdkInfo;
|
|
73
|
+
setWorkerCount: typeof import("mapbox-gl/esm").setWorkerCount;
|
|
74
|
+
setWorkerUrl: typeof import("mapbox-gl/esm").setWorkerUrl;
|
|
75
|
+
supported: typeof import("mapbox-gl/esm").supported;
|
|
76
|
+
version: string;
|
|
77
|
+
default: typeof import("mapbox-gl/esm");
|
|
78
|
+
} | null;
|
|
79
|
+
_MapComponent: any;
|
|
80
|
+
_DeckGLOverlayComponent: any;
|
|
81
|
+
ready: Promise<any>;
|
|
82
|
+
get requiresApiKey(): boolean;
|
|
83
|
+
constructor(mapConfig: any);
|
|
84
|
+
get Map(): any;
|
|
85
|
+
get DeckGLOverlay(): any;
|
|
86
|
+
loadMapbox(): Promise<void>;
|
|
87
|
+
get servicesLoader(): {
|
|
88
|
+
datasets: () => Promise<any>;
|
|
89
|
+
directions: () => Promise<any>;
|
|
90
|
+
geocoding: () => Promise<any>;
|
|
91
|
+
geocodingV6: () => Promise<any>;
|
|
92
|
+
mapMatching: () => Promise<any>;
|
|
93
|
+
matrix: () => Promise<any>;
|
|
94
|
+
optimization: () => Promise<any>;
|
|
95
|
+
static: () => Promise<any>;
|
|
96
|
+
styles: () => Promise<any>;
|
|
97
|
+
tilequery: () => Promise<any>;
|
|
98
|
+
tilesets: () => Promise<any>;
|
|
99
|
+
tokens: () => Promise<any>;
|
|
100
|
+
uploads: () => Promise<any>;
|
|
101
|
+
isochrone: () => Promise<any>;
|
|
102
|
+
};
|
|
103
|
+
loadMapboxSDK({ services }?: {
|
|
104
|
+
services?: never[] | undefined;
|
|
105
|
+
}): Promise<void>;
|
|
106
|
+
getSDK(options: any): Promise<any>;
|
|
107
|
+
/** Map constructor options, overridable per subclass (maplibre-gl has no accessToken option, #154).
|
|
108
|
+
* @param {HTMLElement} container - The map container element.
|
|
109
|
+
* @param {object} options - Consumer-provided map options.
|
|
110
|
+
* @returns {object} The options passed to `new mapboxgl.Map()`.
|
|
111
|
+
*/
|
|
112
|
+
_getMapOptions(container: HTMLElement, options: object): object;
|
|
113
|
+
createMap(elemRef: any, options?: {}): Promise<any>;
|
|
114
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Mapbox from './Mapbox.js';
|
|
2
|
+
export default class Maplibre extends Mapbox {
|
|
3
|
+
get requiresApiKey(): boolean;
|
|
4
|
+
loadMapbox(): Promise<void>;
|
|
5
|
+
/** No Mapbox REST SDK on maplibre (#154): the constructor preload resolves to an empty sdk,
|
|
6
|
+
* and requesting a service (argument or configured `services`) is a consumer error.
|
|
7
|
+
* @param {string|object} [options] - Service name or `{ services }` object, like Mapbox's getSDK.
|
|
8
|
+
* @returns {Promise<object>} The (empty) sdk registry.
|
|
9
|
+
* @throws {Error} When a service is requested.
|
|
10
|
+
*/
|
|
11
|
+
getSDK(options?: string | object): Promise<object>;
|
|
12
|
+
_getMapOptions(container: any, options: any): any;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function searoute(origin: any, destination: any, units?: string): import("geojson").Feature<import("geojson").LineString, import("geojson").GeoJsonProperties> | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export default function getWaterRoute({ origin, destination, includeBoundaries, units }: {
|
|
2
|
+
destination: any;
|
|
3
|
+
includeBoundaries?: boolean | undefined;
|
|
4
|
+
origin: any;
|
|
5
|
+
units?: string | undefined;
|
|
6
|
+
}): Promise<import("geojson").Feature<import("geojson").LineString, import("geojson").GeoJsonProperties> | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function normalizeRoute(coords: any): any;
|