solid-map-gl 1.12.0 → 2.0.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/README.md +157 -30
- package/dist/index.d.ts +489 -0
- package/dist/index.js +11 -0
- package/dist/index.jsx +2320 -0
- package/package.json +46 -35
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -1
- package/dist/source/components/Atmosphere/index.jsx +0 -13
- package/dist/source/components/Camera/index.jsx +0 -108
- package/dist/source/components/Control/index.jsx +0 -33
- package/dist/source/components/Draw/drawingStyles.js +0 -225
- package/dist/source/components/Draw/index.jsx +0 -55
- package/dist/source/components/Draw/modes/index.js +0 -9
- package/dist/source/components/Draw/modes/line_string.js +0 -43
- package/dist/source/components/Draw/modes/measurements.js +0 -76
- package/dist/source/components/Draw/modes/multi_point.js +0 -37
- package/dist/source/components/Draw/modes/point.js +0 -25
- package/dist/source/components/Draw/modes/polygon.js +0 -25
- package/dist/source/components/Draw/modes/radius.js +0 -138
- package/dist/source/components/Draw/modes/rectangle.js +0 -118
- package/dist/source/components/Draw/modes/rectangle_assisted.js +0 -233
- package/dist/source/components/Image/index.jsx +0 -135
- package/dist/source/components/Layer/index.jsx +0 -125
- package/dist/source/components/Layer3D/index.jsx +0 -330
- package/dist/source/components/Light/index.jsx +0 -10
- package/dist/source/components/MapGL/index.jsx +0 -272
- package/dist/source/components/MapProvider/index.jsx +0 -9
- package/dist/source/components/Marker/index.jsx +0 -57
- package/dist/source/components/Popup/index.jsx +0 -38
- package/dist/source/components/Source/index.jsx +0 -89
- package/dist/source/components/Terrain/index.jsx +0 -30
- package/dist/source/events.js +0 -78
- package/dist/source/index.jsx +0 -14
- package/dist/source/mapStyles.js +0 -116
- package/dist/source/styles.js +0 -62
- package/dist/types/components/Atmosphere/index.d.ts +0 -8
- package/dist/types/components/Camera/index.d.ts +0 -54
- package/dist/types/components/Control/index.d.ts +0 -15
- package/dist/types/components/Draw/drawingStyles.d.ts +0 -20
- package/dist/types/components/Draw/index.d.ts +0 -16
- package/dist/types/components/Draw/modes/index.d.ts +0 -6
- package/dist/types/components/Draw/modes/line_string.d.ts +0 -2
- package/dist/types/components/Draw/modes/multi_point.d.ts +0 -2
- package/dist/types/components/Draw/modes/point.d.ts +0 -2
- package/dist/types/components/Draw/modes/polygon.d.ts +0 -2
- package/dist/types/components/Draw/modes/radius.d.ts +0 -2
- package/dist/types/components/Draw/modes/rectangle.d.ts +0 -2
- package/dist/types/components/Draw/modes/rectangle_assisted.d.ts +0 -18
- package/dist/types/components/Image/index.d.ts +0 -28
- package/dist/types/components/Layer/index.d.ts +0 -32
- package/dist/types/components/Layer3D/index.d.ts +0 -22
- package/dist/types/components/Light/index.d.ts +0 -8
- package/dist/types/components/MapGL/index.d.ts +0 -95
- package/dist/types/components/MapProvider/index.d.ts +0 -11
- package/dist/types/components/Marker/index.d.ts +0 -28
- package/dist/types/components/Popup/index.d.ts +0 -18
- package/dist/types/components/Source/index.d.ts +0 -13
- package/dist/types/components/Terrain/index.d.ts +0 -7
- package/dist/types/events.d.ts +0 -103
- package/dist/types/index.d.ts +0 -16
- package/dist/types/mapStyles.d.ts +0 -2
- package/dist/types/styles.d.ts +0 -2
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { onCleanup, createEffect, splitProps } from 'solid-js';
|
|
2
|
-
import { useMapContext } from '../MapProvider';
|
|
3
|
-
export const Marker = (props) => {
|
|
4
|
-
if (!props.lngLat)
|
|
5
|
-
throw new Error('Marker - lngLat is required');
|
|
6
|
-
const [update, create_popup, create_marker] = splitProps(props, ['lngLat', 'children', 'showPopup', 'draggable'], ['popup', 'onOpen', 'onClose']);
|
|
7
|
-
const [ctx] = useMapContext();
|
|
8
|
-
let marker = null;
|
|
9
|
-
let popup = null;
|
|
10
|
-
const LNGLAT = update.lngLat;
|
|
11
|
-
// Add or Update Popup
|
|
12
|
-
createEffect(() => {
|
|
13
|
-
if (!ctx.map)
|
|
14
|
-
return;
|
|
15
|
-
popup?.remove();
|
|
16
|
-
popup = new window.MapLib.Popup({
|
|
17
|
-
closeOnClick: false,
|
|
18
|
-
focusAfterOpen: false,
|
|
19
|
-
...create_popup.popup,
|
|
20
|
-
})
|
|
21
|
-
.on('open', () => create_popup.onOpen?.())
|
|
22
|
-
.on('close', () => create_popup.onClose?.());
|
|
23
|
-
// Update Popup Content
|
|
24
|
-
createEffect(() => {
|
|
25
|
-
if (update.children === undefined)
|
|
26
|
-
return;
|
|
27
|
-
typeof update.children === 'string'
|
|
28
|
-
? popup?.setHTML(update.children)
|
|
29
|
-
: popup?.setDOMContent(update.children);
|
|
30
|
-
marker?.setPopup(popup);
|
|
31
|
-
});
|
|
32
|
-
// Toggle Popup
|
|
33
|
-
createEffect(() => update.showPopup !== popup?.isOpen() && marker?.togglePopup());
|
|
34
|
-
});
|
|
35
|
-
// Add or Update Marker
|
|
36
|
-
createEffect(() => {
|
|
37
|
-
if (!ctx.map)
|
|
38
|
-
return;
|
|
39
|
-
marker?.remove();
|
|
40
|
-
marker = new window.MapLib.Marker(create_marker.options)
|
|
41
|
-
.on('dragstart', () => create_marker.onDragStart?.())
|
|
42
|
-
.on('dragend', () => create_marker.onDragEnd?.())
|
|
43
|
-
.on('drag', () => create_marker.onDrag?.(marker?.getLngLat().toArray()))
|
|
44
|
-
.setPopup(popup)
|
|
45
|
-
.setLngLat(LNGLAT)
|
|
46
|
-
.addTo(ctx.map);
|
|
47
|
-
// Toggle Popup
|
|
48
|
-
createEffect(() => update.showPopup !== popup?.isOpen() && marker?.togglePopup());
|
|
49
|
-
});
|
|
50
|
-
// Update Position
|
|
51
|
-
createEffect(() => marker?.setLngLat(update.lngLat));
|
|
52
|
-
// Update Draggable
|
|
53
|
-
createEffect(() => marker?.setDraggable(update.draggable));
|
|
54
|
-
// Remove Marker
|
|
55
|
-
onCleanup(() => marker?.remove());
|
|
56
|
-
return null;
|
|
57
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { onCleanup, createEffect, splitProps } from "solid-js";
|
|
2
|
-
import { useMapContext } from "../MapProvider";
|
|
3
|
-
export const Popup = (props) => {
|
|
4
|
-
if (!props.trackPointer && !props.lngLat)
|
|
5
|
-
throw new Error("Popup - lngLat or trackPointer is required");
|
|
6
|
-
const [update, create] = splitProps(props, [
|
|
7
|
-
"lngLat",
|
|
8
|
-
"children",
|
|
9
|
-
"trackPointer",
|
|
10
|
-
]);
|
|
11
|
-
const [ctx] = useMapContext();
|
|
12
|
-
let popup;
|
|
13
|
-
// Update Popup
|
|
14
|
-
createEffect(() => {
|
|
15
|
-
if (!ctx.map)
|
|
16
|
-
return;
|
|
17
|
-
popup?.remove();
|
|
18
|
-
popup = new window.MapLib.Popup({
|
|
19
|
-
closeOnClick: false,
|
|
20
|
-
focusAfterOpen: false,
|
|
21
|
-
...create.options,
|
|
22
|
-
})
|
|
23
|
-
.on("open", () => create.onOpen?.())
|
|
24
|
-
.on("close", () => create.onClose?.())
|
|
25
|
-
.addTo(ctx.map);
|
|
26
|
-
// Update Position
|
|
27
|
-
createEffect(() => update.trackPointer
|
|
28
|
-
? popup.trackPointer()
|
|
29
|
-
: popup.setLngLat(update.lngLat));
|
|
30
|
-
// Update Content
|
|
31
|
-
createEffect(() => typeof update.children === "string"
|
|
32
|
-
? popup.setHTML(update.children)
|
|
33
|
-
: popup.setDOMContent(update.children));
|
|
34
|
-
});
|
|
35
|
-
// Remove Popup
|
|
36
|
-
onCleanup(() => popup?.remove());
|
|
37
|
-
return null;
|
|
38
|
-
};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { onCleanup, createEffect, createContext, useContext, createUniqueId, } from 'solid-js';
|
|
2
|
-
import { useMapContext } from '../MapProvider';
|
|
3
|
-
import { rasterStyleList } from '../../mapStyles';
|
|
4
|
-
const SourceContext = createContext();
|
|
5
|
-
export const useSourceId = () => useContext(SourceContext);
|
|
6
|
-
export const Source = props => {
|
|
7
|
-
const [ctx] = useMapContext();
|
|
8
|
-
props.id ??= createUniqueId();
|
|
9
|
-
const debug = (text, value) => {
|
|
10
|
-
ctx.map.debug &&
|
|
11
|
-
console.debug('%c[MapGL]', 'color: #ec4899', text, value || '');
|
|
12
|
-
};
|
|
13
|
-
const lookup = url => {
|
|
14
|
-
const s = url?.split(':').reduce((p, c) => p && p[c], rasterStyleList);
|
|
15
|
-
const source = s
|
|
16
|
-
? {
|
|
17
|
-
...props.source,
|
|
18
|
-
url: '',
|
|
19
|
-
tiles: [
|
|
20
|
-
s
|
|
21
|
-
.replace('{apikey}', //@ts-ignore
|
|
22
|
-
props.source.apikey || import.meta.env.VITE_RASTER_API_KEY)
|
|
23
|
-
.replace('{r}', window.devicePixelRatio > 1 ? '@2x' : ''),
|
|
24
|
-
],
|
|
25
|
-
attribution: rasterStyleList[url.split(':')[0]]._copy,
|
|
26
|
-
}
|
|
27
|
-
: props.source;
|
|
28
|
-
source.tiles &&
|
|
29
|
-
(source.tiles = ['a', 'b', 'c'].map(i => source.tiles[0].replace('{s}', i)));
|
|
30
|
-
return source;
|
|
31
|
-
};
|
|
32
|
-
// Add Source
|
|
33
|
-
ctx.map.addSource(props.id, lookup(props.source.url));
|
|
34
|
-
ctx.map.sourceIdList.push(props.id);
|
|
35
|
-
debug('Add Source:', props.id);
|
|
36
|
-
// Update Data
|
|
37
|
-
const source = ctx.map.getSource(props.id);
|
|
38
|
-
switch (props.source.type) {
|
|
39
|
-
case 'geojson':
|
|
40
|
-
createEffect(() => {
|
|
41
|
-
const data = props.source.data;
|
|
42
|
-
if (!ctx.map.isSourceLoaded(props.id))
|
|
43
|
-
return;
|
|
44
|
-
source.setData(data || {});
|
|
45
|
-
debug('Update GeoJSON Data:', props.id);
|
|
46
|
-
});
|
|
47
|
-
break;
|
|
48
|
-
case 'image':
|
|
49
|
-
createEffect(() => {
|
|
50
|
-
const url = props.source.url;
|
|
51
|
-
const coords = props.source.coordinates;
|
|
52
|
-
if (!ctx.map.isSourceLoaded(props.id))
|
|
53
|
-
return;
|
|
54
|
-
source.updateImage(url, coords);
|
|
55
|
-
debug('Update Image Data:', props.id);
|
|
56
|
-
});
|
|
57
|
-
break;
|
|
58
|
-
case 'vector':
|
|
59
|
-
createEffect(() => {
|
|
60
|
-
const url = props.source.url;
|
|
61
|
-
const tiles = props.source.tiles;
|
|
62
|
-
if (!ctx.map.isSourceLoaded(props.id))
|
|
63
|
-
return;
|
|
64
|
-
url ? source.setUrl(url) : source.setTiles(tiles);
|
|
65
|
-
debug('Update Vector Data:', props.id);
|
|
66
|
-
});
|
|
67
|
-
break;
|
|
68
|
-
case 'raster':
|
|
69
|
-
createEffect(() => {
|
|
70
|
-
const src = lookup(props.source.url);
|
|
71
|
-
if (!ctx.map.isSourceLoaded(props.id))
|
|
72
|
-
return;
|
|
73
|
-
src.url ? source.setUrl(src.url) : source.setTiles(src.tiles);
|
|
74
|
-
debug('Update Raster Data:', props.id);
|
|
75
|
-
});
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
// Remove Source
|
|
79
|
-
onCleanup(() => {
|
|
80
|
-
ctx.map
|
|
81
|
-
?.getStyle()
|
|
82
|
-
.layers.forEach(layer => layer.source === props.id && ctx.map.removeLayer(layer.id));
|
|
83
|
-
ctx.map?.getSource(props.id) && ctx.map?.removeSource(props.id);
|
|
84
|
-
debug('Remove Source:', props.id);
|
|
85
|
-
});
|
|
86
|
-
return (<SourceContext.Provider value={props.id}>
|
|
87
|
-
{props.children}
|
|
88
|
-
</SourceContext.Provider>);
|
|
89
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { createEffect, createUniqueId, onCleanup, } from 'solid-js';
|
|
2
|
-
import { useMapContext } from '../MapProvider';
|
|
3
|
-
import { useSourceId } from '../Source';
|
|
4
|
-
export const Terrain = (props) => {
|
|
5
|
-
const [ctx] = useMapContext();
|
|
6
|
-
let sourceId = useSourceId();
|
|
7
|
-
// Add Terrain Source if not already defined
|
|
8
|
-
if (!sourceId && !props?.source) {
|
|
9
|
-
sourceId = createUniqueId();
|
|
10
|
-
ctx.map.addSource(sourceId, {
|
|
11
|
-
type: 'raster-dem',
|
|
12
|
-
url: ctx.map.isMapLibre
|
|
13
|
-
? 'https://demotiles.maplibre.org/terrain-tiles/tiles.json'
|
|
14
|
-
: 'mapbox://mapbox.terrain-rgb',
|
|
15
|
-
tileSize: ctx.map.isMapLibre ? 256 : 512,
|
|
16
|
-
maxzoom: ctx.map.isMapLibre ? undefined : 14,
|
|
17
|
-
});
|
|
18
|
-
ctx.map.sourceIdList.push(sourceId);
|
|
19
|
-
}
|
|
20
|
-
// Add or Update Terrain Layer
|
|
21
|
-
createEffect(() => {
|
|
22
|
-
ctx.map.setTerrain({
|
|
23
|
-
exaggeration: props.exaggeration || 1,
|
|
24
|
-
source: props?.source || sourceId,
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
//Remove Terrain
|
|
28
|
-
onCleanup(() => ctx.map?.setTerrain(null));
|
|
29
|
-
return null;
|
|
30
|
-
};
|
package/dist/source/events.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
const mapEvents = [
|
|
2
|
-
'onMouseDown',
|
|
3
|
-
'onMouseUp',
|
|
4
|
-
'onMouseOver',
|
|
5
|
-
'onMouseOut',
|
|
6
|
-
'onMouseMove',
|
|
7
|
-
'onMouseEnter',
|
|
8
|
-
'onMouseLeave',
|
|
9
|
-
'onPreClick',
|
|
10
|
-
'onClick',
|
|
11
|
-
'onDblClick',
|
|
12
|
-
'onContextMenu',
|
|
13
|
-
'onTouchStart',
|
|
14
|
-
'onTouchEnd',
|
|
15
|
-
'onTouchCancel',
|
|
16
|
-
'onWheel',
|
|
17
|
-
'onResize',
|
|
18
|
-
'onRemove',
|
|
19
|
-
'onTouchMove',
|
|
20
|
-
'onMoveStart',
|
|
21
|
-
'onMove',
|
|
22
|
-
'onMoveEnd',
|
|
23
|
-
'onDragStart',
|
|
24
|
-
'onDrag',
|
|
25
|
-
'onDragEnd',
|
|
26
|
-
'onZoomStart',
|
|
27
|
-
'onZoom',
|
|
28
|
-
'onZoomEnd',
|
|
29
|
-
'onRotateStart',
|
|
30
|
-
'onRotate',
|
|
31
|
-
'onRotatEnd',
|
|
32
|
-
'onPitchStart',
|
|
33
|
-
'onPitch',
|
|
34
|
-
'onPitchEnd',
|
|
35
|
-
'onBoxZoomStart',
|
|
36
|
-
'onBoxZoomEnd',
|
|
37
|
-
'onBoxZoomCancel',
|
|
38
|
-
'onWebglContextLost',
|
|
39
|
-
'onWebglContextRestored',
|
|
40
|
-
'onLoad',
|
|
41
|
-
'onRender',
|
|
42
|
-
'onIdle',
|
|
43
|
-
'onError',
|
|
44
|
-
'onData',
|
|
45
|
-
'onStyleData',
|
|
46
|
-
'onSourceData',
|
|
47
|
-
'onDataLoading',
|
|
48
|
-
'onStyleDataLoading',
|
|
49
|
-
'onSourceDataLoading',
|
|
50
|
-
'onStyleImageMissing',
|
|
51
|
-
];
|
|
52
|
-
const layerEvents = [
|
|
53
|
-
'onMouseDown',
|
|
54
|
-
'onMouseUp',
|
|
55
|
-
'onMouseOver',
|
|
56
|
-
'onMouseOut',
|
|
57
|
-
'onMouseMove',
|
|
58
|
-
'onMouseEnter',
|
|
59
|
-
'onMouseLeave',
|
|
60
|
-
'onClick',
|
|
61
|
-
'onDblClick',
|
|
62
|
-
'onContextMenu',
|
|
63
|
-
'onTouchStart',
|
|
64
|
-
'onTouchEnd',
|
|
65
|
-
'onTouchCancel',
|
|
66
|
-
];
|
|
67
|
-
const drawEvents = [
|
|
68
|
-
'onCreate',
|
|
69
|
-
'onDelete',
|
|
70
|
-
'onCombine',
|
|
71
|
-
'onUncombine',
|
|
72
|
-
'onUpdate',
|
|
73
|
-
'onSelectionchange',
|
|
74
|
-
'onModechange',
|
|
75
|
-
'onRender',
|
|
76
|
-
'onActionable',
|
|
77
|
-
];
|
|
78
|
-
export { mapEvents, layerEvents, drawEvents };
|
package/dist/source/index.jsx
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export { MapGL as default } from "./components/MapGL";
|
|
2
|
-
export { MapProvider, useMapContext } from "./components/MapProvider";
|
|
3
|
-
export { Source, useSourceId } from "./components/Source";
|
|
4
|
-
export { Layer } from "./components/Layer";
|
|
5
|
-
export { Layer3D, useScene } from "./components/Layer3D";
|
|
6
|
-
export { Atmosphere } from "./components/Atmosphere";
|
|
7
|
-
export { Terrain } from "./components/Terrain";
|
|
8
|
-
export { Control } from "./components/Control";
|
|
9
|
-
export { Marker } from "./components/Marker";
|
|
10
|
-
export { Popup } from "./components/Popup";
|
|
11
|
-
export { MGL_Image as Image, patternList } from "./components/Image";
|
|
12
|
-
export { Camera } from "./components/Camera";
|
|
13
|
-
export { Light } from "./components/Light";
|
|
14
|
-
export { Draw } from "./components/Draw";
|
package/dist/source/mapStyles.js
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
const mapBase = 'mapbox://styles/mapbox';
|
|
2
|
-
const gitBase = 'https://raw.githubusercontent.com/';
|
|
3
|
-
const gishub = 'https://raw.githubusercontent.com/GIShub4/map-styles/main/';
|
|
4
|
-
const hereBase = 'https://assets.vector.hereapi.com/styles/';
|
|
5
|
-
export const vectorStyleList = {
|
|
6
|
-
mb: {
|
|
7
|
-
standard: `${mapBase}/standard`,
|
|
8
|
-
light: `${mapBase}/light-v11`,
|
|
9
|
-
dark: `${mapBase}/dark-v11`,
|
|
10
|
-
street: `${mapBase}/streets-v12`,
|
|
11
|
-
outdoor: `${mapBase}/outdoors-v12`,
|
|
12
|
-
sat: `${mapBase}/satellite-v9`,
|
|
13
|
-
sat_street: `${mapBase}/satellite-streets-v12`,
|
|
14
|
-
nav_base: `${mapBase}/navigation-guidance-day-v4`,
|
|
15
|
-
nav_base_night: `${mapBase}/navigation-guidance-night-v4`,
|
|
16
|
-
nav: `${mapBase}/navigation-day-v1`,
|
|
17
|
-
nav_night: `${mapBase}/navigation-night-v1`,
|
|
18
|
-
basic: `${mapBase}/cjf4m44iw0uza2spb3q0a7s41`,
|
|
19
|
-
monochrome: `${mapBase}/cjv6rzz4j3m4b1fqcchuxclhb`,
|
|
20
|
-
leshine: `${mapBase}/cjcunv5ae262f2sm9tfwg8i0w`,
|
|
21
|
-
icecream: `${mapBase}/cj7t3i5yj0unt2rmt3y4b5e32`,
|
|
22
|
-
cali: `${mapBase}/cjerxnqt3cgvp2rmyuxbeqme7`,
|
|
23
|
-
northstar: `${mapBase}/cj44mfrt20f082snokim4ungi`,
|
|
24
|
-
mineral: `${mapBase}/cjtep62gq54l21frr1whf27ak`,
|
|
25
|
-
moonlight: `${mapBase}/cj3kbeqzo00022smj7akz3o1e`,
|
|
26
|
-
frank: `${mapBase}-map-design/ckshxkppe0gge18nz20i0nrwq`,
|
|
27
|
-
minimo: `${mapBase}-map-design/cksjc2nsq1bg117pnekb655h1`,
|
|
28
|
-
decimal: `${mapBase}-map-design/ck4014y110wt61ctt07egsel6`,
|
|
29
|
-
stand: `${mapBase}-map-design/ckr0svm3922ki18qntevm857n`,
|
|
30
|
-
blueprint: `${mapBase}-map-design/cks97e1e37nsd17nzg7p0308g`,
|
|
31
|
-
bubble: `${mapBase}-map-design/cksysy2nl62zp17quosctdtcc`,
|
|
32
|
-
pencil: `${mapBase}-map-design/cks9iema71es417mlrft4go2k`,
|
|
33
|
-
swiss_ski: `${gitBase}mapbox/mapbox-gl-swiss-ski-style/master/cij1zoclj002y8rkkdjl69psd.json`,
|
|
34
|
-
vintage: `${gitBase}mapbox/mapbox-gl-vintage-style/master/cif5p01n202nisaktvljx9mv3.json`,
|
|
35
|
-
whaam: `${gitBase}mapbox/mapbox-gl-whaam-style/master/cii8323c8004w0nlvtss3dbm2.json`,
|
|
36
|
-
neon: `${gitBase}NatEvatt/awesome-mapbox-gl-styles/master/styles/Neon/style.json`,
|
|
37
|
-
camoflauge: `${gitBase}jingsam/mapbox-gl-styles/master/Camouflage.json`,
|
|
38
|
-
emerald: `${gitBase}jingsam/mapbox-gl-styles/master/Emerald.json`,
|
|
39
|
-
runner: `${gitBase}jingsam/mapbox-gl-styles/master/Runner.json`,
|
|
40
|
-
x_ray: `${gitBase}jingsam/mapbox-gl-styles/master/X-ray.json`,
|
|
41
|
-
},
|
|
42
|
-
here: {
|
|
43
|
-
base: `${hereBase}berlin/base/mapbox/tilezen?apikey={apikey}`,
|
|
44
|
-
day: `${hereBase}berlin/day/mapbox/tilezen?apikey={apikey}`,
|
|
45
|
-
night: `${hereBase}berlin/night/mapbox/tilezen?apikey={apikey}`,
|
|
46
|
-
},
|
|
47
|
-
esri: {
|
|
48
|
-
blueprint: `${gishub}esri:blueprint.json`,
|
|
49
|
-
charted_territory: `${gishub}esri:charted-territory.json`,
|
|
50
|
-
colored_pencil: `${gishub}esri:colored-pencil.json`,
|
|
51
|
-
community: `${gishub}esri:community.json`,
|
|
52
|
-
mid_century: `${gishub}esri:mid-century.json`,
|
|
53
|
-
modern_antique: `${gishub}esri:modern-antique.json`,
|
|
54
|
-
nat_geo: `${gishub}esri:national-geographic.json`,
|
|
55
|
-
newspaper: `${gishub}esri:newspaper.json`,
|
|
56
|
-
open_street_map: `${gishub}esri:open-street-map.json`,
|
|
57
|
-
light_gray_canvas: `${gishub}esri:light-gray-canvas.json`,
|
|
58
|
-
dark_gray_canvas: `${gishub}esri:dark-gray-canvas.json`,
|
|
59
|
-
human_geo_light: `${gishub}esri:human-geography-light.json`,
|
|
60
|
-
human_geo_dark: `${gishub}esri:human-geography-dark.json`,
|
|
61
|
-
world_navigation: `${gishub}esri:world-navigation.json`,
|
|
62
|
-
world_street: `${gishub}esri:world-street.json`,
|
|
63
|
-
world_street_night: `${gishub}esri:world-street-night.json`,
|
|
64
|
-
world_terrain: `${gishub}esri:world-terrain.json`,
|
|
65
|
-
world_terrain_hybrid: `${gishub}esri:world-terrain-hybrid.json`,
|
|
66
|
-
world_topographic: `${gishub}esri:world-topographic.json`,
|
|
67
|
-
chromium: `${gishub}esri:chromium.json`,
|
|
68
|
-
dreamcatcher: `${gishub}esri:dreamcatcher.json`,
|
|
69
|
-
seahaven: `${gishub}esri:seahaven.json`,
|
|
70
|
-
sangria: `${gishub}esri:sangria.json`,
|
|
71
|
-
mercurial: `${gishub}esri:mercurial.json`,
|
|
72
|
-
imagery: `${gishub}esri:imagery.json`,
|
|
73
|
-
imagery_hybrid: `${gishub}esri:imagery-hybrid.json`,
|
|
74
|
-
firefly: `${gishub}esri:firefly.json`,
|
|
75
|
-
firefly_hybrid: `${gishub}esri:firefly-hybrid.json`,
|
|
76
|
-
oceans: `${gishub}esri:oceans.json`,
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
const carto = 'https://{s}.basemaps.cartocdn.com/rastertiles/';
|
|
80
|
-
const stamen = 'https://stamen-tiles-{s}.a.ssl.fastly.net/';
|
|
81
|
-
const tf = 'https://{s}.tile.thunderforest.com/';
|
|
82
|
-
export const rasterStyleList = {
|
|
83
|
-
osm: {
|
|
84
|
-
org: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
|
85
|
-
human: 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
|
|
86
|
-
cycle: 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png',
|
|
87
|
-
topo: 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png',
|
|
88
|
-
_copy: '<a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap</a>',
|
|
89
|
-
},
|
|
90
|
-
carto: {
|
|
91
|
-
voyager: `${carto}voyager_labels_under/{z}/{x}/{y}{r}.png`,
|
|
92
|
-
positron: `${carto}light_all/{z}/{x}/{y}{r}.png`,
|
|
93
|
-
dark: `${carto}dark_all/{z}/{x}/{y}{r}.png`,
|
|
94
|
-
_copy: '<a href="https://carto.com/attribution" target="_blank">© Carto</a>',
|
|
95
|
-
},
|
|
96
|
-
stamen: {
|
|
97
|
-
toner: `${stamen}toner/{z}/{x}/{y}{r}.png`,
|
|
98
|
-
toner_lite: `${stamen}toner-lite/{z}/{x}/{y}{r}.png`,
|
|
99
|
-
watercolor: `${stamen}watercolor/{z}/{x}/{y}.png`,
|
|
100
|
-
terrain: `${stamen}terrain/{z}/{x}/{y}{r}.png`,
|
|
101
|
-
_copy: '<a href="https://stamen.com/privacy-policy" target="_blank">© Stamen Design</a>',
|
|
102
|
-
},
|
|
103
|
-
tf: {
|
|
104
|
-
cycle: `${tf}cycle/{z}/{x}/{y}{r}.png?apikey={apikey}`,
|
|
105
|
-
trans: `${tf}transport/{z}/{x}/{y}{r}.png?apikey={apikey}`,
|
|
106
|
-
trans_dark: `${tf}transport-dark/{z}/{x}/{y}{r}.png?apikey={apikey}`,
|
|
107
|
-
landscape: `${tf}landscape/{z}/{x}/{y}{r}.png?apikey={apikey}`,
|
|
108
|
-
outdoors: `${tf}outdoors/{z}/{x}/{y}{r}.png?apikey={apikey}`,
|
|
109
|
-
neighbourhood: `${tf}neighbourhood/{z}/{x}/{y}{r}.png?apikey={apikey}`,
|
|
110
|
-
spinal: `${tf}spinal-map/{z}/{x}/{y}{r}.png?apikey={apikey}`,
|
|
111
|
-
pioneer: `${tf}pioneer/{z}/{x}/{y}{r}.png?apikey={apikey}`,
|
|
112
|
-
atlas: `${tf}atlas/{z}/{x}/{y}{r}.png?apikey={apikey}`,
|
|
113
|
-
mobile: `${tf}mobile-atlas/{z}/{x}/{y}{r}.png?apikey={apikey}`,
|
|
114
|
-
_copy: '<a href="https://thunderforest.com/privacy" target="_blank">© Thunderforest</a>',
|
|
115
|
-
},
|
|
116
|
-
};
|
package/dist/source/styles.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
export const baseStyle = [
|
|
2
|
-
'id',
|
|
3
|
-
'type',
|
|
4
|
-
'filter',
|
|
5
|
-
'source',
|
|
6
|
-
'source-layer',
|
|
7
|
-
'minzoom',
|
|
8
|
-
'metadata',
|
|
9
|
-
'maxzoom',
|
|
10
|
-
'paint',
|
|
11
|
-
'layout'
|
|
12
|
-
];
|
|
13
|
-
export const layoutStyles = [
|
|
14
|
-
'visibility',
|
|
15
|
-
'line-join',
|
|
16
|
-
'line-cap',
|
|
17
|
-
'line-miter-limit',
|
|
18
|
-
'line-round-limit',
|
|
19
|
-
'line-sort-key',
|
|
20
|
-
'circle-sort-key',
|
|
21
|
-
'symbol-avoid-edges',
|
|
22
|
-
'symbol-placement',
|
|
23
|
-
'symbol-sort-key',
|
|
24
|
-
'symbol-spacing',
|
|
25
|
-
'symbol-z-order',
|
|
26
|
-
'icon-allow-overlap',
|
|
27
|
-
'icon-anchor',
|
|
28
|
-
'icon-ignore-placement',
|
|
29
|
-
'icon-image',
|
|
30
|
-
'icon-keep-upright',
|
|
31
|
-
'icon-offset',
|
|
32
|
-
'icon-optional',
|
|
33
|
-
'icon-padding',
|
|
34
|
-
'icon-pitch-alignment',
|
|
35
|
-
'icon-rotate',
|
|
36
|
-
'icon-rotation-alignment',
|
|
37
|
-
'icon-size',
|
|
38
|
-
'icon-text-fit',
|
|
39
|
-
'icon-text-fit-padding',
|
|
40
|
-
'text-allow-overlap',
|
|
41
|
-
'text-anchor',
|
|
42
|
-
'text-field',
|
|
43
|
-
'text-font',
|
|
44
|
-
'text-ignore-placement',
|
|
45
|
-
'text-justify',
|
|
46
|
-
'text-keep-upright',
|
|
47
|
-
'text-letter-spacing',
|
|
48
|
-
'text-line-height',
|
|
49
|
-
'text-max-angle',
|
|
50
|
-
'text-max-width',
|
|
51
|
-
'text-offset',
|
|
52
|
-
'text-optional',
|
|
53
|
-
'text-padding',
|
|
54
|
-
'text-pitch-alignment',
|
|
55
|
-
'text-radial-offset',
|
|
56
|
-
'text-rotate',
|
|
57
|
-
'text-rotation-alignment',
|
|
58
|
-
'text-size',
|
|
59
|
-
'text-transform',
|
|
60
|
-
'text-variable-anchor',
|
|
61
|
-
'text-writing-mode'
|
|
62
|
-
];
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Component } from 'solid-js';
|
|
2
|
-
import type { LngLatLike } from 'mapbox-gl';
|
|
3
|
-
/** Options for rotating the globe. */
|
|
4
|
-
interface RotateGlobeOptions {
|
|
5
|
-
/** The number of seconds per revolution. */
|
|
6
|
-
secPerRev?: number;
|
|
7
|
-
/** The maximum zoom level for spinning the globe. */
|
|
8
|
-
maxSpinZoom?: number;
|
|
9
|
-
/** The zoom level at which the spinning slows down. */
|
|
10
|
-
slowSpinZoom?: number;
|
|
11
|
-
}
|
|
12
|
-
/** Options for rotating the viewport. */
|
|
13
|
-
interface RotateViewportOptions {
|
|
14
|
-
/** The number of seconds per revolution. */
|
|
15
|
-
secPerRev?: number;
|
|
16
|
-
/** The pitch angle in degrees. */
|
|
17
|
-
pitch?: number;
|
|
18
|
-
/** The center of rotation. */
|
|
19
|
-
around?: LngLatLike;
|
|
20
|
-
}
|
|
21
|
-
/** Props for the component. */
|
|
22
|
-
type Props = {
|
|
23
|
-
/** Whether to rotate the globe. */
|
|
24
|
-
rotateGlobe?: boolean | RotateGlobeOptions;
|
|
25
|
-
/** Whether to rotate the viewport. */
|
|
26
|
-
rotateViewport?: boolean | RotateViewportOptions;
|
|
27
|
-
/** Whether to reverse the rotation direction. */
|
|
28
|
-
reverse?: boolean;
|
|
29
|
-
/** Whether to reset the rotation when stopped. */
|
|
30
|
-
resetWhenStopped?: boolean;
|
|
31
|
-
/** Translation options. */
|
|
32
|
-
translate?: {
|
|
33
|
-
/** The type of translation. */
|
|
34
|
-
type?: 'line' | 'sphere';
|
|
35
|
-
/** The starting position. */
|
|
36
|
-
start: [number, number, number];
|
|
37
|
-
/** The ending position. */
|
|
38
|
-
end: [number, number, number];
|
|
39
|
-
/** The target position. */
|
|
40
|
-
target: LngLatLike;
|
|
41
|
-
/** The ending target position. */
|
|
42
|
-
targetEnd?: LngLatLike;
|
|
43
|
-
/** The easing function to use. */
|
|
44
|
-
easing?: 'in' | 'out' | 'inOut';
|
|
45
|
-
/** Whether to loop the translation. */
|
|
46
|
-
loop?: boolean;
|
|
47
|
-
/** The duration of the translation in milliseconds. */
|
|
48
|
-
duration: number;
|
|
49
|
-
};
|
|
50
|
-
/** The children to render. */
|
|
51
|
-
children?: any;
|
|
52
|
-
};
|
|
53
|
-
export declare const Camera: Component<Props>;
|
|
54
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { VoidComponent } from "solid-js";
|
|
2
|
-
import type { Options as AttributionOptions } from "mapbox-gl/src/ui/control/attribution_control";
|
|
3
|
-
import type { Options as FullscreenOptions } from "mapbox-gl/src/ui/control/fullscreen_control";
|
|
4
|
-
import type { Options as GeolocateOptions } from "mapbox-gl/src/ui/control/geolocate_control";
|
|
5
|
-
import type { Options as NavigationOptions } from "mapbox-gl/src/ui/control/navigation_control";
|
|
6
|
-
import type { Options as ScaleOptions } from "mapbox-gl/src/ui/control/scale_control";
|
|
7
|
-
type ControlType = "navigation" | "scale" | "attribution" | "fullscreen" | "geolocate" | "logo" | "terrain";
|
|
8
|
-
type Props = {
|
|
9
|
-
type?: ControlType;
|
|
10
|
-
options?: NavigationOptions | ScaleOptions | AttributionOptions | FullscreenOptions | GeolocateOptions | object;
|
|
11
|
-
custom?: any;
|
|
12
|
-
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
13
|
-
};
|
|
14
|
-
export declare const Control: VoidComponent<Props>;
|
|
15
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
id: string;
|
|
3
|
-
type: string;
|
|
4
|
-
filter: (string | string[])[];
|
|
5
|
-
layout: {
|
|
6
|
-
"text-field": string[];
|
|
7
|
-
"text-anchor": string[];
|
|
8
|
-
"text-offset": (string | string[] | number[])[];
|
|
9
|
-
"text-size": number;
|
|
10
|
-
"text-allow-overlap": boolean;
|
|
11
|
-
"text-ignore-placement": boolean;
|
|
12
|
-
};
|
|
13
|
-
paint: {
|
|
14
|
-
"text-halo-color": string;
|
|
15
|
-
"text-halo-width": number;
|
|
16
|
-
"text-halo-blur": number;
|
|
17
|
-
"text-color": string;
|
|
18
|
-
};
|
|
19
|
-
}[];
|
|
20
|
-
export default _default;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { VoidComponent } from "solid-js";
|
|
2
|
-
import type { drawEventTypes } from "../../events";
|
|
3
|
-
type Props = {
|
|
4
|
-
/** Draw Library */
|
|
5
|
-
lib: any;
|
|
6
|
-
/** Draw Options */
|
|
7
|
-
options?: object;
|
|
8
|
-
/** Draw Control Position */
|
|
9
|
-
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
10
|
-
/** Draw Control Instance */
|
|
11
|
-
getInstance?: (object: any) => void;
|
|
12
|
-
showLength?: boolean;
|
|
13
|
-
showArea?: boolean;
|
|
14
|
-
} & drawEventTypes;
|
|
15
|
-
export declare const Draw: VoidComponent<Props>;
|
|
16
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import draw_point from "./point";
|
|
2
|
-
import draw_polygon from "./polygon";
|
|
3
|
-
import draw_line_string from "./line_string";
|
|
4
|
-
import draw_radius from "./radius";
|
|
5
|
-
import draw_rectangle from "./rectangle";
|
|
6
|
-
export { draw_point, draw_polygon, draw_line_string, draw_radius, draw_rectangle, };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare const RectangleAssistedMode: {
|
|
2
|
-
onSetup: (opts: any) => {
|
|
3
|
-
rectangle: any;
|
|
4
|
-
currentVertexPosition: number;
|
|
5
|
-
};
|
|
6
|
-
onTap: (state: any, e: any) => void;
|
|
7
|
-
onClick: (state: any, e: any) => any;
|
|
8
|
-
onMouseMove: (state: any, e: any) => void;
|
|
9
|
-
deegrees2meters(px: any): number[];
|
|
10
|
-
meters2degress(px: any): number[];
|
|
11
|
-
calculateOrientedAnglePolygon: (state: any) => void;
|
|
12
|
-
calculatepXY3: (state: any, e: any, tmp: any) => any;
|
|
13
|
-
onKeyUp: (state: any, e: any) => any;
|
|
14
|
-
onStop: (state: any) => void;
|
|
15
|
-
toDisplayFeatures: (state: any, geojson: any, display: any) => any;
|
|
16
|
-
onTrash: (state: any) => void;
|
|
17
|
-
};
|
|
18
|
-
export default RectangleAssistedMode;
|