solid-map-gl 1.1.27 → 1.2.1

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.
Files changed (44) hide show
  1. package/README.md +13 -7
  2. package/dist/cjs/index.css +1 -0
  3. package/dist/cjs/index.js +2 -0
  4. package/dist/cjs/index.js.map +1 -0
  5. package/dist/esm/index.css +1 -0
  6. package/dist/esm/index.js +1 -1
  7. package/dist/esm/index.js.map +1 -1
  8. package/dist/index/components/Camera/index.d.ts +16 -0
  9. package/dist/index/components/Camera/index.jsx +49 -0
  10. package/dist/{types → index}/components/Control/index.d.ts +2 -2
  11. package/dist/{source → index}/components/Control/index.jsx +6 -6
  12. package/dist/{types → index}/components/Fog/index.d.ts +2 -2
  13. package/dist/index/components/Fog/index.jsx +17 -0
  14. package/dist/{types → index}/components/Image/index.d.ts +1 -2
  15. package/dist/{source → index}/components/Image/index.jsx +4 -10
  16. package/dist/{types → index}/components/Layer/index.d.ts +3 -3
  17. package/dist/{source → index}/components/Layer/index.jsx +26 -28
  18. package/dist/{types → index}/components/MapGL/index.d.ts +22 -5
  19. package/dist/{source → index}/components/MapGL/index.jsx +37 -25
  20. package/dist/{types → index}/components/Marker/index.d.ts +2 -2
  21. package/dist/{source → index}/components/Marker/index.jsx +4 -5
  22. package/dist/{types → index}/components/Popup/index.d.ts +2 -2
  23. package/dist/{source → index}/components/Popup/index.jsx +5 -6
  24. package/dist/{types → index}/components/Sky/index.d.ts +2 -2
  25. package/dist/index/components/Sky/index.jsx +18 -0
  26. package/dist/index/components/Source/index.d.ts +10 -0
  27. package/dist/index/components/Source/index.jsx +68 -0
  28. package/dist/{types → index}/components/Terrain/index.d.ts +2 -2
  29. package/dist/index/components/Terrain/index.jsx +19 -0
  30. package/dist/{types → index}/events.d.ts +0 -0
  31. package/dist/{source → index}/events.js +0 -0
  32. package/dist/index/index.d.ts +12 -0
  33. package/dist/index/index.jsx +11 -0
  34. package/dist/index/styles.d.ts +56 -0
  35. package/dist/index/styles.js +121 -0
  36. package/package.json +22 -21
  37. package/dist/esm/styles.css +0 -1
  38. package/dist/source/components/Fog/index.jsx +0 -21
  39. package/dist/source/components/Sky/index.jsx +0 -22
  40. package/dist/source/components/Source/index.jsx +0 -32
  41. package/dist/source/components/Terrain/index.jsx +0 -23
  42. package/dist/source/index.jsx +0 -10
  43. package/dist/types/components/Source/index.d.ts +0 -8
  44. package/dist/types/index.d.ts +0 -11
@@ -1,21 +1,26 @@
1
1
  import { createSignal, createEffect, onMount, onCleanup, createContext, useContext, useTransition, createUniqueId, untrack, on, } from 'solid-js';
2
2
  import { mapEvents } from '../../events';
3
+ import { vectorStyleList } from '../../styles';
3
4
  import mapboxgl from 'mapbox-gl';
4
5
  import 'mapbox-gl/dist/mapbox-gl.css';
5
- const [pending, start] = useTransition();
6
- const [transitionType, setTransitionType] = createSignal('flyTo');
7
6
  const MapContext = createContext();
8
- const useMap = () => useContext(MapContext);
9
- const MapGL = props => {
7
+ /** Provides the Mapbox Map Object */
8
+ export const useMap = () => useContext(MapContext);
9
+ /** Creates a new Map Container */
10
+ export const MapGL = props => {
10
11
  let map;
11
12
  let mapRef;
12
13
  let containerRef;
13
14
  props.id = props.id || createUniqueId();
14
- onMount(() => {
15
+ const [mapRoot, setMapRoot] = createSignal();
16
+ const [pending, start] = useTransition();
17
+ const [transitionType, setTransitionType] = createSignal('flyTo');
18
+ onMount(async () => {
15
19
  map = new mapboxgl.Map({
16
20
  ...props.options,
17
- style: props.options?.style || { version: 8, sources: {}, layers: [] },
18
- container: mapRef,
21
+ style: vectorStyleList[props.options?.style] ||
22
+ props.options?.style || { version: 8, sources: {}, layers: [] },
23
+ container: mapRef || 'map',
19
24
  interactive: !!props.onViewportChange,
20
25
  bounds: props.viewport?.bounds,
21
26
  center: props.viewport?.center,
@@ -25,6 +30,8 @@ const MapGL = props => {
25
30
  fitBoundsOptions: { padding: props.viewport?.padding },
26
31
  });
27
32
  map.container = containerRef;
33
+ await map.once('styledata');
34
+ setMapRoot(map);
28
35
  });
29
36
  onCleanup(() => map.remove());
30
37
  // Hook up events
@@ -37,20 +44,28 @@ const MapGL = props => {
37
44
  }
38
45
  }));
39
46
  // Update debug features
40
- createEffect(() => (map.showTileBoundaries = props.showTileBoundaries));
41
- createEffect(() => (map.showTerrainWireframe = props.showTerrainWireframe));
42
- createEffect(() => (map.showPadding = props.showPadding));
43
- createEffect(() => (map.showCollisionBoxes = props.showCollisionBoxes));
44
- createEffect(() => (map.showOverdrawInspector = props.showOverdrawInspector));
45
- createEffect(() => (map.getCanvas().style.cursor = props.cursorStyle));
47
+ createEffect(() => {
48
+ if (!mapRoot())
49
+ return;
50
+ mapRoot().showTileBoundaries = props.showTileBoundaries;
51
+ mapRoot().showTerrainWireframe = props.showTerrainWireframe;
52
+ mapRoot().showPadding = props.showPadding;
53
+ mapRoot().showCollisionBoxes = props.showCollisionBoxes;
54
+ mapRoot().showOverdrawInspector = props.showOverdrawInspector;
55
+ mapRoot().getCanvas().style.cursor = props.cursorStyle;
56
+ });
57
+ createEffect(() => setTransitionType(props.transitionType));
58
+ // Update projection
59
+ createEffect(on(() => props.options?.projection, proj => map.setProjection(proj), { defer: true }));
46
60
  // Update map style
47
- createEffect(on(() => props.options.style, () => {
61
+ createEffect(on(() => props.options?.style, style => {
48
62
  const oldStyle = map.getStyle();
49
63
  const oldLayers = oldStyle.layers.filter(l => l.id.startsWith('cl-'));
50
64
  const oldSources = Object.keys(oldStyle.sources)
51
65
  .filter(s => s.startsWith('cl-'))
52
66
  .reduce((obj, key) => ({ ...obj, [key]: oldStyle.sources[key] }), {});
53
- map.setStyle(props.options.style);
67
+ map.setStyle(vectorStyleList[style] ||
68
+ style || { version: 8, sources: {}, layers: [] });
54
69
  map.once('styledata', () => {
55
70
  const newStyle = map.getStyle();
56
71
  map.setStyle({
@@ -60,9 +75,6 @@ const MapGL = props => {
60
75
  });
61
76
  });
62
77
  }, { defer: true }));
63
- // Update projection
64
- createEffect(on(() => props.options.projection, () => map.setProjection(props.options.projection), { defer: true }));
65
- createEffect(() => setTransitionType(props.transitionType));
66
78
  // Hook up viewport events
67
79
  createEffect(() => {
68
80
  const viewport = {
@@ -76,12 +88,13 @@ const MapGL = props => {
76
88
  };
77
89
  const callMove = event => {
78
90
  if (event.originalEvent)
79
- props.onViewportChange({ ...viewport, id: props.id });
91
+ props.onViewportChange &&
92
+ props.onViewportChange({ ...viewport, id: props.id });
80
93
  setTransitionType('jumpTo');
81
94
  };
82
95
  const callEnd = event => {
83
96
  if (event.originalEvent)
84
- props.onViewportChange(viewport);
97
+ props.onViewportChange && props.onViewportChange(viewport);
85
98
  setTransitionType(props.transitionType);
86
99
  };
87
100
  map.on('move', callMove).on('moveend', callEnd);
@@ -128,11 +141,10 @@ const MapGL = props => {
128
141
  });
129
142
  }
130
143
  });
131
- return (<MapContext.Provider value={() => map}>
132
- <section ref={containerRef} style={{ height: '100%', width: '100%' }}>
133
- {props.children}
134
- <div ref={mapRef} class={props.class || ''} classList={props.classList} style={{ height: '100%', width: '100%', ...props.style }}/>
144
+ return (<MapContext.Provider value={mapRoot}>
145
+ <section ref={containerRef} style={{ position: 'absolute', 'z-index': 1 }}>
146
+ {mapRoot() ? props.children : null}
135
147
  </section>
148
+ <div id='map' ref={mapRef} class={props.class || null} classList={props.classList || null} style={{ height: '100%', width: '100%', ...props.style }}/>
136
149
  </MapContext.Provider>);
137
150
  };
138
- export { MapGL as default, useMap };
@@ -1,8 +1,8 @@
1
1
  import { Component } from 'solid-js';
2
2
  import type { MarkerSpecification } from 'mapbox-gl/src/style-spec/types.js';
3
3
  import type { LngLatLike } from 'mapbox-gl/src/geo/lng_lat.js';
4
- declare const Marker: Component<{
4
+ export declare const Marker: Component<{
5
5
  options?: MarkerSpecification;
6
6
  lnglat: LngLatLike;
7
+ children?: any;
7
8
  }>;
8
- export default Marker;
@@ -1,11 +1,11 @@
1
- import { onMount, onCleanup, createEffect } from 'solid-js';
1
+ import { onCleanup, createEffect } from 'solid-js';
2
2
  import { useMap } from '../MapGL';
3
3
  import mapboxgl from 'mapbox-gl';
4
- const Marker = props => {
4
+ export const Marker = props => {
5
5
  const map = useMap();
6
6
  let marker = null;
7
7
  // Add Marker
8
- onMount(async () => {
8
+ createEffect(() => {
9
9
  marker = new mapboxgl.Marker(props.options)
10
10
  .setLngLat(props.lnglat)
11
11
  .setPopup(props.children
@@ -16,7 +16,6 @@ const Marker = props => {
16
16
  // Remove Marker
17
17
  onCleanup(() => marker.remove());
18
18
  // Update Position
19
- createEffect(() => marker.setLngLat(props.lnglat));
19
+ createEffect(() => marker && marker.setLngLat(props.lnglat));
20
20
  return <></>;
21
21
  };
22
- export default Marker;
@@ -1,8 +1,8 @@
1
1
  import { Component } from 'solid-js';
2
2
  import type { PopupSpecification } from 'mapbox-gl/src/style-spec/types.js';
3
3
  import type { LngLatLike } from 'mapbox-gl/src/geo/lng_lat.js';
4
- declare const Popup: Component<{
4
+ export declare const Popup: Component<{
5
5
  options?: PopupSpecification;
6
6
  lnglat: LngLatLike;
7
+ children?: any;
7
8
  }>;
8
- export default Popup;
@@ -1,11 +1,11 @@
1
- import { onMount, onCleanup, createEffect } from 'solid-js';
1
+ import { onCleanup, createEffect } from 'solid-js';
2
2
  import { useMap } from '../MapGL';
3
3
  import mapboxgl from 'mapbox-gl';
4
- const Popup = props => {
4
+ export const Popup = props => {
5
5
  const map = useMap();
6
6
  let popup = null;
7
7
  // Add Popup
8
- onMount(async () => {
8
+ createEffect(() => {
9
9
  popup = new mapboxgl.Popup(props.options)
10
10
  .setLngLat(props.lnglat)
11
11
  .setDOMContent(<div>{props.children}</div>)
@@ -14,9 +14,8 @@ const Popup = props => {
14
14
  // Remove Popup
15
15
  onCleanup(() => popup.remove());
16
16
  // Update Position
17
- createEffect(() => popup.setLngLat(props.lnglat));
17
+ createEffect(() => popup && popup.setLngLat(props.lnglat));
18
18
  // Update Content
19
- createEffect(() => popup.setDOMContent(<div>{props.children}</div>));
19
+ createEffect(() => popup && popup.setDOMContent(<div>{props.children}</div>));
20
20
  return <></>;
21
21
  };
22
- export default Popup;
@@ -1,7 +1,7 @@
1
1
  import { Component } from 'solid-js';
2
2
  import type { StyleSpecification } from 'mapbox-gl/src/style-spec/types.js';
3
- declare const Sky: Component<{
3
+ export declare const Sky: Component<{
4
4
  style: StyleSpecification;
5
5
  visible?: boolean;
6
+ children?: any;
6
7
  }>;
7
- export default Sky;
@@ -0,0 +1,18 @@
1
+ import { onCleanup, createEffect } from 'solid-js';
2
+ import { useMap } from '../MapGL';
3
+ export const Sky = props => {
4
+ const map = useMap();
5
+ const layerId = '_sky';
6
+ // Add Sky Layer
7
+ createEffect(() => {
8
+ map().getLayer(layerId) && map().addLayer({ ...props.style, id: layerId });
9
+ });
10
+ // Remove Sky Layer
11
+ onCleanup(() => map().getLayer(layerId) && map().removeLayer(layerId));
12
+ // Update Visibility
13
+ createEffect(() => {
14
+ props.visible !== undefined &&
15
+ map().setLayoutProperty(layerId, 'visibility', props.visible ? 'visible' : 'none');
16
+ });
17
+ return props.children;
18
+ };
@@ -0,0 +1,10 @@
1
+ import { Component } from 'solid-js';
2
+ import type { SourceSpecification } from 'mapbox-gl/src/style-spec/types.js';
3
+ export declare const useSourceId: () => string;
4
+ export declare const Source: Component<{
5
+ /** @optional Source ID for referencing non nexted Layers */
6
+ id?: string;
7
+ /** @see https://docs.mapbox.com/mapbox-gl-js/style-spec/sources/ */
8
+ source: SourceSpecification;
9
+ children?: any;
10
+ }>;
@@ -0,0 +1,68 @@
1
+ import { onCleanup, createEffect, createContext, useContext, createUniqueId, } from 'solid-js';
2
+ import { useMap } from '../MapGL';
3
+ import { rasterStyleList } from '../../styles';
4
+ const SourceContext = createContext();
5
+ export const useSourceId = () => useContext(SourceContext);
6
+ export const Source = props => {
7
+ const map = useMap();
8
+ props.id = props.id || createUniqueId();
9
+ const lookup = url => rasterStyleList[url]
10
+ ? {
11
+ ...props.source,
12
+ url: '',
13
+ tiles: [
14
+ rasterStyleList[url][0].replace('{apikey}', props.source.apikey),
15
+ ],
16
+ attribution: rasterStyleList[url][1],
17
+ }
18
+ : props.source;
19
+ // Add Source
20
+ createEffect(() => {
21
+ const source = lookup(props.source.url);
22
+ source.tiles &&
23
+ (source.tiles = ['a', 'b', 'c'].map(i => source.tiles[0].replace('{s}', i)));
24
+ !map().getSource(props.id) && map().addSource(props.id, source);
25
+ });
26
+ // Remove Source
27
+ onCleanup(() => {
28
+ map()
29
+ .getStyle()
30
+ .layers.forEach(layer => layer.source === props.id && map().removeLayer(layer.id));
31
+ map().getSource(props.id) && map().removeSource(props.id);
32
+ });
33
+ // Update
34
+ createEffect(() => {
35
+ const source = map().getSource(props.id);
36
+ if (!source)
37
+ return;
38
+ // Update GeoJSON Data
39
+ if (props.source.type === 'geojson' && props.source.data)
40
+ source.setData(props.source.data);
41
+ // Update Image URL
42
+ if (props.source.type === 'image' &&
43
+ (props.source.url || props.source.coordinates))
44
+ source.updateImage(props.source.url, props.source.coordinates);
45
+ // Update Vector URL or Tiles
46
+ if (props.source.type === 'vector' &&
47
+ (props.source.url || props.source.tiles))
48
+ props.source.url
49
+ ? source.setUrl(props.source.url)
50
+ : source.setTiles(props.source.tiles);
51
+ // Update Raster URL or Tiles
52
+ if (props.source.type === 'raster' &&
53
+ (props.source.url || props.source.tiles)) {
54
+ const src = lookup(props.source.url);
55
+ src.tiles &&
56
+ (src.tiles = ['a', 'b', 'c'].map(i => src.tiles[0].replace('{s}', i)));
57
+ source._tileJSONRequest?.cancel();
58
+ source.url = src.url;
59
+ source.scheme = src.scheme;
60
+ source._options = { ...source._options, ...src };
61
+ map().style._sourceCaches[`other:${props.id}`]?.clearTiles();
62
+ source.load();
63
+ }
64
+ });
65
+ return (<SourceContext.Provider value={props.id}>
66
+ {props.children}
67
+ </SourceContext.Provider>);
68
+ };
@@ -1,7 +1,7 @@
1
1
  import { Component } from 'solid-js';
2
2
  import type { TerrainSpecification } from 'mapbox-gl/src/style-spec/types.js';
3
- declare const Terrain: Component<{
3
+ export declare const Terrain: Component<{
4
4
  style: TerrainSpecification;
5
5
  visible?: boolean;
6
+ children?: any;
6
7
  }>;
7
- export default Terrain;
@@ -0,0 +1,19 @@
1
+ import { onCleanup, createEffect } from 'solid-js';
2
+ import { useMap } from '../MapGL';
3
+ import { useSourceId } from '../Source';
4
+ export const Terrain = props => {
5
+ const map = useMap();
6
+ const sourceId = useSourceId();
7
+ // Add Terrain Layer
8
+ createEffect(() => {
9
+ map().setTerrain({ ...props.style, source: sourceId });
10
+ });
11
+ // Remove Terrain Layer
12
+ onCleanup(() => map().setTerrain(null));
13
+ // Update Visibility
14
+ createEffect(() => {
15
+ props.visible !== undefined &&
16
+ map().setTerrain(props.visible ? props.style : null);
17
+ });
18
+ return props.children;
19
+ };
File without changes
File without changes
@@ -0,0 +1,12 @@
1
+ export { MapGL as default, useMap } from './components/MapGL';
2
+ export { Source, useSourceId } from './components/Source';
3
+ export { Layer } from './components/Layer';
4
+ export { Fog } from './components/Fog';
5
+ export { Sky } from './components/Sky';
6
+ export { Terrain } from './components/Terrain';
7
+ export { Control } from './components/Control';
8
+ export { Marker } from './components/Marker';
9
+ export { Popup } from './components/Popup';
10
+ export { Image } from './components/Image';
11
+ export { Camera } from './components/Camera';
12
+ export type { Viewport } from './components/MapGL';
@@ -0,0 +1,11 @@
1
+ export { MapGL as default, useMap } from './components/MapGL';
2
+ export { Source, useSourceId } from './components/Source';
3
+ export { Layer } from './components/Layer';
4
+ export { Fog } from './components/Fog';
5
+ export { Sky } from './components/Sky';
6
+ export { Terrain } from './components/Terrain';
7
+ export { Control } from './components/Control';
8
+ export { Marker } from './components/Marker';
9
+ export { Popup } from './components/Popup';
10
+ export { Image } from './components/Image';
11
+ export { Camera } from './components/Camera';
@@ -0,0 +1,56 @@
1
+ export declare const vectorStyleList: {
2
+ 'mb:light': string;
3
+ 'mb:dark': string;
4
+ 'mb:streets': string;
5
+ 'mb:outdoor': string;
6
+ 'mb:sat': string;
7
+ 'mb:sat-streets': string;
8
+ 'mb:nav': string;
9
+ 'mb:nav-night': string;
10
+ 'mb:basic': string;
11
+ 'mb:monochrome': string;
12
+ 'mb:leshine': string;
13
+ 'mb:icecream': string;
14
+ 'mb:cali': string;
15
+ 'mb:northstar': string;
16
+ 'mb:mineral': string;
17
+ 'mb:moonlight': string;
18
+ 'mb:frank': string;
19
+ 'mb:minimo': string;
20
+ 'mb:decimal': string;
21
+ 'mb:standard': string;
22
+ 'mb:blueprint': string;
23
+ 'mb:bubble': string;
24
+ 'mb:pencil': string;
25
+ 'mb:swiss-ski': string;
26
+ 'mb:vintage': string;
27
+ 'mb:whaam': string;
28
+ 'mb:neon': string;
29
+ 'mb:camoflauge': string;
30
+ 'mb:emerald': string;
31
+ 'mb:runner': string;
32
+ 'mb:x-ray': string;
33
+ };
34
+ export declare const rasterStyleList: {
35
+ 'osm:org': string[];
36
+ 'osm:human': string[];
37
+ 'osm:cycle': string[];
38
+ 'carto:voyager': string[];
39
+ 'carto:positron': string[];
40
+ 'carto:dark': string[];
41
+ 'open:topo': string[];
42
+ 'stamen:toner': string[];
43
+ 'stamen:toner-lite': string[];
44
+ 'stamen:watercolor': string[];
45
+ 'stamen:terrain': string[];
46
+ 'tf:cycle': string[];
47
+ 'tf:trans': string[];
48
+ 'tf:trans-dark': string[];
49
+ 'tf:landscape': string[];
50
+ 'tf:outdoors': string[];
51
+ 'tf:neighbourhood': string[];
52
+ 'tf:spinal': string[];
53
+ 'tf:pioneer': string[];
54
+ 'tf:atlas': string[];
55
+ 'tf:mobile': string[];
56
+ };
@@ -0,0 +1,121 @@
1
+ const mapBase = 'mapbox://styles/mapbox';
2
+ const gitBase = 'https://raw.githubusercontent.com';
3
+ export const vectorStyleList = {
4
+ 'mb:light': `${mapBase}/light-v10`,
5
+ 'mb:dark': `${mapBase}/dark-v10`,
6
+ 'mb:streets': `${mapBase}/streets-v11`,
7
+ 'mb:outdoor': `${mapBase}/outdoors-v11`,
8
+ 'mb:sat': `${mapBase}/satellite-v9`,
9
+ 'mb:sat-streets': `${mapBase}/satellite-streets-v11`,
10
+ 'mb:nav': `${mapBase}/navigation-guidance-day-v4`,
11
+ 'mb:nav-night': `${mapBase}/navigation-guidance-night-v4`,
12
+ 'mb:basic': `${mapBase}/cjf4m44iw0uza2spb3q0a7s41`,
13
+ 'mb:monochrome': `${mapBase}/cjv6rzz4j3m4b1fqcchuxclhb`,
14
+ 'mb:leshine': `${mapBase}/cjcunv5ae262f2sm9tfwg8i0w`,
15
+ 'mb:icecream': `${mapBase}/cj7t3i5yj0unt2rmt3y4b5e32`,
16
+ 'mb:cali': `${mapBase}/cjerxnqt3cgvp2rmyuxbeqme7`,
17
+ 'mb:northstar': `${mapBase}/cj44mfrt20f082snokim4ungi`,
18
+ 'mb:mineral': `${mapBase}/cjtep62gq54l21frr1whf27ak`,
19
+ 'mb:moonlight': `${mapBase}/cj3kbeqzo00022smj7akz3o1e`,
20
+ 'mb:frank': `${mapBase}-map-design/ckshxkppe0gge18nz20i0nrwq`,
21
+ 'mb:minimo': `${mapBase}-map-design/cksjc2nsq1bg117pnekb655h1`,
22
+ 'mb:decimal': `${mapBase}-map-design/ck4014y110wt61ctt07egsel6`,
23
+ 'mb:standard': `${mapBase}-map-design/ckr0svm3922ki18qntevm857n`,
24
+ 'mb:blueprint': `${mapBase}-map-design/cks97e1e37nsd17nzg7p0308g`,
25
+ 'mb:bubble': `${mapBase}-map-design/cksysy2nl62zp17quosctdtcc`,
26
+ 'mb:pencil': `${mapBase}-map-design/cks9iema71es417mlrft4go2k`,
27
+ 'mb:swiss-ski': `${gitBase}/mapbox/mapbox-gl-swiss-ski-style/master/cij1zoclj002y8rkkdjl69psd.json`,
28
+ 'mb:vintage': `${gitBase}/mapbox/mapbox-gl-vintage-style/master/cif5p01n202nisaktvljx9mv3.json`,
29
+ 'mb:whaam': `${gitBase}/mapbox/mapbox-gl-whaam-style/master/cii8323c8004w0nlvtss3dbm2.json`,
30
+ 'mb:neon': `${gitBase}/NatEvatt/awesome-mapbox-gl-styles/master/styles/Neon/style.json`,
31
+ 'mb:camoflauge': `${gitBase}/jingsam/mapbox-gl-styles/master/Camouflage.json`,
32
+ 'mb:emerald': `${gitBase}/jingsam/mapbox-gl-styles/master/Emerald.json`,
33
+ 'mb:runner': `${gitBase}/jingsam/mapbox-gl-styles/master/Runner.json`,
34
+ 'mb:x-ray': `${gitBase}/jingsam/mapbox-gl-styles/master/X-ray.json`,
35
+ };
36
+ export const rasterStyleList = {
37
+ 'osm:org': [
38
+ 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
39
+ 'Map &copy; <a href="https://www.openstreetmap.org"><em>OpenStreetMap</em></a>',
40
+ ],
41
+ 'osm:human': [
42
+ 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
43
+ 'Map &copy; <a href="http://hot.openstreetmap.org"><em>Humanitarian OpenStreetMap Team</em></a>',
44
+ ],
45
+ 'osm:cycle': [
46
+ 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png',
47
+ 'Maps &copy; <a href="https://www.cyclosm.org" target="_blank"><em>CyclOSM</em></a>, Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank"><em>OpenStreetMap</em></a>',
48
+ ],
49
+ 'carto:voyager': [
50
+ 'https://{s}.basemaps.cartocdn.com/rastertiles/voyager_labels_under/{z}/{x}/{y}.png',
51
+ 'Maps &copy; <a href="https://carto.com/attribution"><em>Carto</em></a>',
52
+ ],
53
+ 'carto:positron': [
54
+ 'https://{s}.basemaps.cartocdn.com/rastertiles/light_all/{z}/{x}/{y}.png',
55
+ 'Maps &copy; <a href="https://carto.com/attribution"><em>Carto</em></a>',
56
+ ],
57
+ 'carto:dark': [
58
+ 'https://{s}.basemaps.cartocdn.com/rastertiles/dark_all/{z}/{x}/{y}.png',
59
+ 'Maps &copy; <a href="https://carto.com/attribution"><em>Carto</em></a>',
60
+ ],
61
+ 'open:topo': [
62
+ 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png',
63
+ 'Maps &copy; <a href="https://opentopomap.org/credits"><em>OpenTopoMap</em></a>, Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank"><em>OpenStreetMap</em></a>',
64
+ ],
65
+ 'stamen:toner': [
66
+ 'https://stamen-tiles-{s}.a.ssl.fastly.net/toner/{z}/{x}/{y}.png',
67
+ 'Maps &copy; <a href="https://stamen.com" target="_blank"><em>Stamen Design</em></a>, Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank"><em>OpenStreetMap</em></a>',
68
+ ],
69
+ 'stamen:toner-lite': [
70
+ 'https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}.png',
71
+ 'Maps &copy; <a href="https://stamen.com" target="_blank"><em>Stamen Design</em></a>, Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank"><em>OpenStreetMap</em></a>',
72
+ ],
73
+ 'stamen:watercolor': [
74
+ 'https://stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg',
75
+ 'Maps &copy; <a href="https://stamen.com" target="_blank"><em>Stamen Design</em></a>, Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank"><em>OpenStreetMap</em></a>',
76
+ ],
77
+ 'stamen:terrain': [
78
+ 'https://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.jpg',
79
+ 'Maps &copy; <a href="https://stamen.com" target="_blank"><em>Stamen Design</em></a>, Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank"><em>OpenStreetMap</em></a>',
80
+ ],
81
+ 'tf:cycle': [
82
+ 'https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}@2x.png?apikey={apikey}',
83
+ 'Maps &copy; <a href="https://thunderforest.com" target="_blank"><em>Thunderforest</em></a>, Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank"><em>OpenStreetMap</em></a>',
84
+ ],
85
+ 'tf:trans': [
86
+ 'https://{s}.tile.thunderforest.com/transport/{z}/{x}/{y}.png?apikey={apikey}',
87
+ 'Maps &copy; <a href="https://thunderforest.com" target="_blank"><em>Thunderforest</em></a>, Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank"><em>OpenStreetMap</em></a>',
88
+ ],
89
+ 'tf:trans-dark': [
90
+ 'https://{s}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}.png?apikey={apikey}',
91
+ 'Maps &copy; <a href="https://thunderforest.com" target="_blank"><em>Thunderforest</em></a>, Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank"><em>OpenStreetMap</em></a>',
92
+ ],
93
+ 'tf:landscape': [
94
+ 'https://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey={apikey}',
95
+ 'Maps &copy; <a href="https://thunderforest.com" target="_blank"><em>Thunderforest</em></a>, Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank"><em>OpenStreetMap</em></a>',
96
+ ],
97
+ 'tf:outdoors': [
98
+ 'https://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey={apikey}',
99
+ 'Maps &copy; <a href="https://thunderforest.com" target="_blank"><em>Thunderforest</em></a>, Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank"><em>OpenStreetMap</em></a>',
100
+ ],
101
+ 'tf:neighbourhood': [
102
+ 'https://{s}.tile.thunderforest.com/neighbourhood/{z}/{x}/{y}.png?apikey={apikey}',
103
+ 'Maps &copy; <a href="https://thunderforest.com" target="_blank"><em>Thunderforest</em></a>, Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank"><em>OpenStreetMap</em></a>',
104
+ ],
105
+ 'tf:spinal': [
106
+ 'https://{s}.tile.thunderforest.com/spinal-map/{z}/{x}/{y}.png?apikey={apikey}',
107
+ 'Maps &copy; <a href="https://thunderforest.com" target="_blank"><em>Thunderforest</em></a>, Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank"><em>OpenStreetMap</em></a>',
108
+ ],
109
+ 'tf:pioneer': [
110
+ 'https://{s}.tile.thunderforest.com/pioneer/{z}/{x}/{y}.png?apikey={apikey}',
111
+ 'Maps &copy; <a href="https://thunderforest.com" target="_blank"><em>Thunderforest</em></a>, Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank"><em>OpenStreetMap</em></a>',
112
+ ],
113
+ 'tf:atlas': [
114
+ 'https://{s}.tile.thunderforest.com/atlas/{z}/{x}/{y}.png?apikey={apikey}',
115
+ 'Maps &copy; <a href="https://thunderforest.com" target="_blank"><em>Thunderforest</em></a>, Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank"><em>OpenStreetMap</em></a>',
116
+ ],
117
+ 'tf:mobile': [
118
+ 'https://{s}.tile.thunderforest.com/mobile-atlas/{z}/{x}/{y}.png?apikey={apikey}',
119
+ 'Maps &copy; <a href="https://thunderforest.com" target="_blank"><em>Thunderforest</em></a>, Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank"><em>OpenStreetMap</em></a>',
120
+ ],
121
+ };