@mapcomponents/deck-gl 1.8.9 → 1.8.11
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/dist/catalogue/mc_meta.json +44 -1
- package/dist/components/MlHexagonLayer/MlHexagonLayer.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +171 -144
- package/dist/thumbnails/MlScenegraphLayer.png +0 -0
- package/package.json +15 -15
- package/src/components/MlHexagonLayer/MlHexagonLayer.meta.json +21 -0
- package/src/components/MlHexagonLayer/MlHexagonLayer.tsx +13 -20
- package/src/components/MlSceneGraphLayer/MlScenegraphLayer.meta.json +21 -0
- package/src/decorators/style.css +22 -8
- package/tsconfig.lib.json +5 -0
- package/tsconfig.storybook.json +8 -0
- package/vite.config.ts +58 -56
- package/dist/package.json +0 -32
- package/dist/thumbnails/MapLibreMap.png +0 -0
- package/dist/thumbnails/MlCameraFollowPath.png +0 -0
- package/dist/thumbnails/MlCreatePdfButton.png +0 -0
- package/dist/thumbnails/MlCreatePdfForm.png +0 -0
- package/dist/thumbnails/MlDeckGlLayer.png +0 -0
- package/dist/thumbnails/MlDeckGlTerrainLayer.png +0 -0
- package/dist/thumbnails/MlDemoDashboard.png +0 -0
- package/dist/thumbnails/MlFeatureEditor.png +0 -0
- package/dist/thumbnails/MlFillExtrusionLayer.png +0 -0
- package/dist/thumbnails/MlFollowGps.png +0 -0
- package/dist/thumbnails/MlGeoJsonLayer.png +0 -0
- package/dist/thumbnails/MlGpxViewer.png +0 -0
- package/dist/thumbnails/MlHillshadeLayer.png +0 -0
- package/dist/thumbnails/MlIconLayer.png +0 -0
- package/dist/thumbnails/MlLayerMagnify.png +0 -0
- package/dist/thumbnails/MlLayerSwipe.png +0 -0
- package/dist/thumbnails/MlMapDrawTools.png +0 -0
- package/dist/thumbnails/MlMeasureTool.png +0 -0
- package/dist/thumbnails/MlMobilerImker.png +0 -0
- package/dist/thumbnails/MlNavigationCompass.png +0 -0
- package/dist/thumbnails/MlNavigationTools.png +0 -0
- package/dist/thumbnails/MlOsmLayer.png +0 -0
- package/dist/thumbnails/MlScaleReference.png +0 -0
- package/dist/thumbnails/MlSketchTool.png +0 -0
- package/dist/thumbnails/MlSpatialElevationProfile.png +0 -0
- package/dist/thumbnails/MlThreeJsLayer.png +0 -0
- package/dist/thumbnails/MlTransitionGeoJsonLayer.png +0 -0
- package/dist/thumbnails/MlVectorTileLayer.png +0 -0
- package/dist/thumbnails/MlWanderApp.png +0 -0
- package/dist/thumbnails/MlWmsLayer.png +0 -0
- package/dist/thumbnails/MlWmsLoader.png +0 -0
- package/dist/thumbnails/useCameraFollowPath.png +0 -0
- package/src/components/MlHexagonLayer/MlHexagonLayer.meta_.json +0 -14
- /package/dist/thumbnails/{MlLaermkarte.png → MlHexagonLayer.png} +0 -0
|
@@ -1 +1,44 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"MlScenegraphLayer": {
|
|
3
|
+
"name": "MlScenegraphLayer",
|
|
4
|
+
"title": "Scenegraph Layer using DeckGL",
|
|
5
|
+
"description": "Adds a deck.gl ScenegraphLayer to the map that places instanced copies of a glTF 3D model at geographic data point locations. Position, orientation and scale can be configured per instance, and animated glTF models are fully supported. Demo model: https://github.com/KhronosGroup/glTF-Sample-Models/tree/main/2.0/BoxAnimated",
|
|
6
|
+
"i18n": {
|
|
7
|
+
"de": {
|
|
8
|
+
"title": "Scenegraph Layer basierend auf DeckGL",
|
|
9
|
+
"description": "Fügt der Karte einen deck.gl ScenegraphLayer hinzu, der instanzierte Kopien eines glTF-3D-Modells an geografischen Datenpunkten platziert. Position, Ausrichtung und Skalierung lassen sich pro Instanz konfigurieren; animierte glTF-Modelle werden vollständig unterstützt. Demo-Modell: https://github.com/KhronosGroup/glTF-Sample-Models/tree/main/2.0/BoxAnimated"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"tags": ["Map layer", "deckGL"],
|
|
13
|
+
"category": "Map layer",
|
|
14
|
+
"type": "component",
|
|
15
|
+
"demos": [
|
|
16
|
+
{
|
|
17
|
+
"name": "Demo",
|
|
18
|
+
"url": "https://mapcomponents.github.io/react-map-components-maplibre/deck-gl/iframe.html?args=&globals=&id=mapcomponents-mlscenegraphlayer--deckgl-example&viewMode=story"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"thumbnail": "https://mapcomponents.github.io/react-map-components-maplibre/deck-gl/thumbnails/MlScenegraphLayer.png"
|
|
22
|
+
},
|
|
23
|
+
"MlHexagonLayer": {
|
|
24
|
+
"name": "MlHexagonLayer",
|
|
25
|
+
"title": "Hexagon Layer using DeckGL",
|
|
26
|
+
"description": "Adds a deck.gl HexagonLayer to the map that spatially aggregates point-based datasets (including real-time data) and renders them as an interactive 3D hexagonal heatmap.",
|
|
27
|
+
"i18n": {
|
|
28
|
+
"de": {
|
|
29
|
+
"title": "Hexagon Layer basierend auf DeckGL",
|
|
30
|
+
"description": "Fügt der Karte einen deck.gl HexagonLayer hinzu, der punktbasierte Datensätze (einschließlich Echtzeit-Daten) räumlich aggregiert und als interaktive 3D-Hexagon-Heatmap darstellt."
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"tags": ["Map layer", "deckGL"],
|
|
34
|
+
"category": "Map layer",
|
|
35
|
+
"type": "component",
|
|
36
|
+
"demos": [
|
|
37
|
+
{
|
|
38
|
+
"name": "Demo",
|
|
39
|
+
"url": "https://mapcomponents.github.io/react-map-components-maplibre/deck-gl/iframe.html?args=&globals=&id=mapcomponents-mlhexagonlayer--custom-color-and-height-profile&viewMode=story"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"thumbnail": "https://mapcomponents.github.io/react-map-components-maplibre/deck-gl/thumbnails/MlLaermkarte.png"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MlHexagonLayer.d.ts","sourceRoot":"","sources":["../../../src/components/MlHexagonLayer/MlHexagonLayer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgB,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAI9E,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC3D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAwBD,QAAA,MAAM,cAAc,GAAI,OAAO,iBAAiB,
|
|
1
|
+
{"version":3,"file":"MlHexagonLayer.d.ts","sourceRoot":"","sources":["../../../src/components/MlHexagonLayer/MlHexagonLayer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgB,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAI9E,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC3D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAwBD,QAAA,MAAM,cAAc,GAAI,OAAO,iBAAiB,4CAyC/C,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`react`);c=s(c);let l=require(`@mapcomponents/react-maplibre`),u=require(`@deck.gl/mapbox`),d=require(`react/jsx-runtime`),f=require(`@deck.gl/aggregation-layers`),p=require(`@deck.gl/geo-layers`),m=require(`@deck.gl/mesh-layers`);var h=`deckgl-layer`,g=c.default.createContext({}),_=({mapId:e,children:t})=>{let n=(0,l.useMap)({mapId:e}),r=(0,c.useRef)(void 0),[i,a]=(0,c.useState)([]),[o,s]=(0,c.useState)([]);(0,c.useEffect)(()=>{if(n.map)return r.current=new u.MapboxOverlay({id:h,interleaved:!0}),n.map.addControl(r.current),()=>{r.current&&n.map?.removeControl(r.current),r.current=void 0}},[n.map]),(0,c.useEffect)(()=>{r.current&&r.current.setProps({layers:[...i],effects:[...o]})},[i,o]);let f={deckGlLayerArray:i,setDeckGlLayerArray:a,deckGlEffectArray:o,setDeckGlEffectArray:s};return(0,d.jsx)(g.Provider,{value:f,children:t})};function v(){let e=(0,c.useContext)(g);function t(t){e.setDeckGlEffectArray(e=>[...e,t])}function n(t){e.setDeckGlEffectArray(e=>e.filter(e=>e!==t))}function r(t){e.setDeckGlLayerArray(e=>[...e,t])}function i(t){e.setDeckGlLayerArray(e=>e.filter(e=>e!==t))}return{addEffect:t,removeEffect:n,addLayer:r,removeLayer:i}}var y={type:f.HexagonLayer,layerOpacity:.8,elevationRange:[30,75],elevationScale:1,extruded:!0,coverage:.9,autoHighlight:!1,material:{ambient:.6,diffuse:.5,shininess:10},radius:16,transitions:{elevationScale:1500},_filterData:null,colorRange:[[1,152,189,125],[73,227,206,150],[216,254,181,175],[254,237,177,200],[254,173,84,225],[209,55,78,255]]},b=e=>{let t=v(),n=(0,l.useMap)({mapId:e.mapId,waitForLayer:e.beforeId}),r=(0,c.useMemo)(()=>{let{mapId:t,...n}=e;return n.data?new f.HexagonLayer({...y,...n}):null},[e.beforeId,e.data,e.elevationScale,e.extruded,e.coverage,e.autoHighlight,e.material,e.radius,e.transitions]);return(0,c.useEffect)(()=>{if(!(!n.map||!r))return t.addLayer(r),()=>{t.removeLayer(r)}},[n.map,r]),(0,d.jsx)(d.Fragment,{})},x=e=>{let{mapId:t,...n}=e,r=(0,l.useMap)({mapId:t}),i=v(),a=(0,c.useMemo)(()=>n.data?new p.Tile3DLayer({...n}):null,[n.data,n.id,n.pickable,n.onTileLoad,n.onTileUnload,n.loadOptions,n.loaders,n.visible,n.opacity,n.pointSize,n.beforeId]);return(0,c.useEffect)(()=>{if(!(!r.map||!a))return i.addLayer(a),()=>{a&&i.removeLayer(a)}},[r.map,a]),(0,d.jsx)(d.Fragment,{})},S=e=>{let t=(0,l.useMap)({mapId:e.mapId,waitForLayer:e.beforeId}),n=v(),r=(0,c.useMemo)(()=>{let{mapId:t,...n}=e;return new m.ScenegraphLayer({...n})},[e]);return(0,c.useEffect)(()=>{if(!(!t.map||!r))return n.addLayer(r),()=>{r&&n.removeLayer(r)}},[t.map,r]),(0,d.jsx)(d.Fragment,{})};exports.DeckGlContext=g,exports.DeckGlContextProvider=_,exports.Ml3DTileLayer=x,exports.MlHexagonLayer=b,exports.MlSceneGraphLayer=S,exports.useDeckGl=v;
|
package/dist/index.mjs
CHANGED
|
@@ -1,147 +1,174 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { HexagonLayer as
|
|
6
|
-
import { Tile3DLayer as
|
|
7
|
-
import { ScenegraphLayer as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
import e, { useContext as t, useEffect as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
2
|
+
import { useMap as o } from "@mapcomponents/react-maplibre";
|
|
3
|
+
import { MapboxOverlay as s } from "@deck.gl/mapbox";
|
|
4
|
+
import { Fragment as c, jsx as l } from "react/jsx-runtime";
|
|
5
|
+
import { HexagonLayer as u } from "@deck.gl/aggregation-layers";
|
|
6
|
+
import { Tile3DLayer as d } from "@deck.gl/geo-layers";
|
|
7
|
+
import { ScenegraphLayer as f } from "@deck.gl/mesh-layers";
|
|
8
|
+
//#region src/contexts/DeckGlContext.tsx
|
|
9
|
+
var p = "deckgl-layer", m = e.createContext({}), h = ({ mapId: e, children: t }) => {
|
|
10
|
+
let r = o({ mapId: e }), c = i(void 0), [u, d] = a([]), [f, h] = a([]);
|
|
11
|
+
n(() => {
|
|
12
|
+
if (r.map) return c.current = new s({
|
|
13
|
+
id: p,
|
|
14
|
+
interleaved: !0
|
|
15
|
+
}), r.map.addControl(c.current), () => {
|
|
16
|
+
c.current && r.map?.removeControl(c.current), c.current = void 0;
|
|
17
|
+
};
|
|
18
|
+
}, [r.map]), n(() => {
|
|
19
|
+
c.current && c.current.setProps({
|
|
20
|
+
layers: [...u],
|
|
21
|
+
effects: [...f]
|
|
22
|
+
});
|
|
23
|
+
}, [u, f]);
|
|
24
|
+
let g = {
|
|
25
|
+
deckGlLayerArray: u,
|
|
26
|
+
setDeckGlLayerArray: d,
|
|
27
|
+
deckGlEffectArray: f,
|
|
28
|
+
setDeckGlEffectArray: h
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ l(m.Provider, {
|
|
31
|
+
value: g,
|
|
32
|
+
children: t
|
|
33
|
+
});
|
|
31
34
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/hooks/useDeckGl.tsx
|
|
37
|
+
function g() {
|
|
38
|
+
let e = t(m);
|
|
39
|
+
function n(t) {
|
|
40
|
+
e.setDeckGlEffectArray((e) => [...e, t]);
|
|
41
|
+
}
|
|
42
|
+
function r(t) {
|
|
43
|
+
e.setDeckGlEffectArray((e) => e.filter((e) => e !== t));
|
|
44
|
+
}
|
|
45
|
+
function i(t) {
|
|
46
|
+
e.setDeckGlLayerArray((e) => [...e, t]);
|
|
47
|
+
}
|
|
48
|
+
function a(t) {
|
|
49
|
+
e.setDeckGlLayerArray((e) => e.filter((e) => e !== t));
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
addEffect: n,
|
|
53
|
+
removeEffect: r,
|
|
54
|
+
addLayer: i,
|
|
55
|
+
removeLayer: a
|
|
56
|
+
};
|
|
52
57
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/components/MlHexagonLayer/MlHexagonLayer.tsx
|
|
60
|
+
var _ = {
|
|
61
|
+
type: u,
|
|
62
|
+
layerOpacity: .8,
|
|
63
|
+
elevationRange: [30, 75],
|
|
64
|
+
elevationScale: 1,
|
|
65
|
+
extruded: !0,
|
|
66
|
+
coverage: .9,
|
|
67
|
+
autoHighlight: !1,
|
|
68
|
+
material: {
|
|
69
|
+
ambient: .6,
|
|
70
|
+
diffuse: .5,
|
|
71
|
+
shininess: 10
|
|
72
|
+
},
|
|
73
|
+
radius: 16,
|
|
74
|
+
transitions: { elevationScale: 1500 },
|
|
75
|
+
_filterData: null,
|
|
76
|
+
colorRange: [
|
|
77
|
+
[
|
|
78
|
+
1,
|
|
79
|
+
152,
|
|
80
|
+
189,
|
|
81
|
+
125
|
|
82
|
+
],
|
|
83
|
+
[
|
|
84
|
+
73,
|
|
85
|
+
227,
|
|
86
|
+
206,
|
|
87
|
+
150
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
216,
|
|
91
|
+
254,
|
|
92
|
+
181,
|
|
93
|
+
175
|
|
94
|
+
],
|
|
95
|
+
[
|
|
96
|
+
254,
|
|
97
|
+
237,
|
|
98
|
+
177,
|
|
99
|
+
200
|
|
100
|
+
],
|
|
101
|
+
[
|
|
102
|
+
254,
|
|
103
|
+
173,
|
|
104
|
+
84,
|
|
105
|
+
225
|
|
106
|
+
],
|
|
107
|
+
[
|
|
108
|
+
209,
|
|
109
|
+
55,
|
|
110
|
+
78,
|
|
111
|
+
255
|
|
112
|
+
]
|
|
113
|
+
]
|
|
114
|
+
}, v = (e) => {
|
|
115
|
+
let t = g(), i = o({
|
|
116
|
+
mapId: e.mapId,
|
|
117
|
+
waitForLayer: e.beforeId
|
|
118
|
+
}), a = r(() => {
|
|
119
|
+
let { mapId: t, ...n } = e;
|
|
120
|
+
return n.data ? new u({
|
|
121
|
+
..._,
|
|
122
|
+
...n
|
|
123
|
+
}) : null;
|
|
124
|
+
}, [
|
|
125
|
+
e.beforeId,
|
|
126
|
+
e.data,
|
|
127
|
+
e.elevationScale,
|
|
128
|
+
e.extruded,
|
|
129
|
+
e.coverage,
|
|
130
|
+
e.autoHighlight,
|
|
131
|
+
e.material,
|
|
132
|
+
e.radius,
|
|
133
|
+
e.transitions
|
|
134
|
+
]);
|
|
135
|
+
return n(() => {
|
|
136
|
+
if (!(!i.map || !a)) return t.addLayer(a), () => {
|
|
137
|
+
t.removeLayer(a);
|
|
138
|
+
};
|
|
139
|
+
}, [i.map, a]), /* @__PURE__ */ l(c, {});
|
|
140
|
+
}, y = (e) => {
|
|
141
|
+
let { mapId: t, ...i } = e, a = o({ mapId: t }), s = g(), u = r(() => i.data ? new d({ ...i }) : null, [
|
|
142
|
+
i.data,
|
|
143
|
+
i.id,
|
|
144
|
+
i.pickable,
|
|
145
|
+
i.onTileLoad,
|
|
146
|
+
i.onTileUnload,
|
|
147
|
+
i.loadOptions,
|
|
148
|
+
i.loaders,
|
|
149
|
+
i.visible,
|
|
150
|
+
i.opacity,
|
|
151
|
+
i.pointSize,
|
|
152
|
+
i.beforeId
|
|
153
|
+
]);
|
|
154
|
+
return n(() => {
|
|
155
|
+
if (!(!a.map || !u)) return s.addLayer(u), () => {
|
|
156
|
+
u && s.removeLayer(u);
|
|
157
|
+
};
|
|
158
|
+
}, [a.map, u]), /* @__PURE__ */ l(c, {});
|
|
159
|
+
}, b = (e) => {
|
|
160
|
+
let t = o({
|
|
161
|
+
mapId: e.mapId,
|
|
162
|
+
waitForLayer: e.beforeId
|
|
163
|
+
}), i = g(), a = r(() => {
|
|
164
|
+
let { mapId: t, ...n } = e;
|
|
165
|
+
return new f({ ...n });
|
|
166
|
+
}, [e]);
|
|
167
|
+
return n(() => {
|
|
168
|
+
if (!(!t.map || !a)) return i.addLayer(a), () => {
|
|
169
|
+
a && i.removeLayer(a);
|
|
170
|
+
};
|
|
171
|
+
}, [t.map, a]), /* @__PURE__ */ l(c, {});
|
|
147
172
|
};
|
|
173
|
+
//#endregion
|
|
174
|
+
export { m as DeckGlContext, h as DeckGlContextProvider, y as Ml3DTileLayer, v as MlHexagonLayer, b as MlSceneGraphLayer, g as useDeckGl };
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapcomponents/deck-gl",
|
|
3
|
-
"version": "1.8.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.8.11",
|
|
4
|
+
"description": "MapComponents components that integrate deck.gl layers into MapLibre maps.",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@emotion/react": "^11.14.0",
|
|
10
10
|
"@emotion/styled": "^11.14.1",
|
|
11
|
-
"@mui/icons-material": "^
|
|
12
|
-
"@mui/
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"uuid": "^11.1.0"
|
|
11
|
+
"@mui/icons-material": "^9.0.1",
|
|
12
|
+
"@mui/material": "^9.0.1",
|
|
13
|
+
"react": "^19.2.6",
|
|
14
|
+
"react-dom": "^19.2.6"
|
|
16
15
|
},
|
|
17
16
|
"peerDependencies": {
|
|
18
|
-
"@deck.gl/aggregation-layers": "^9.2
|
|
19
|
-
"@deck.gl/core": "^9.2
|
|
20
|
-
"@deck.gl/geo-layers": "^9.2
|
|
21
|
-
"@deck.gl/mapbox": "^9.2
|
|
22
|
-
"@deck.gl/mesh-layers": "^9.2
|
|
23
|
-
"maplibre-gl": "^5.
|
|
24
|
-
"@mapcomponents/react-maplibre": "1.8.
|
|
17
|
+
"@deck.gl/aggregation-layers": "^9.3.2",
|
|
18
|
+
"@deck.gl/core": "^9.3.2",
|
|
19
|
+
"@deck.gl/geo-layers": "^9.3.2",
|
|
20
|
+
"@deck.gl/mapbox": "^9.3.2",
|
|
21
|
+
"@deck.gl/mesh-layers": "^9.3.2",
|
|
22
|
+
"maplibre-gl": "^5.24.0",
|
|
23
|
+
"@mapcomponents/react-maplibre": "1.8.11"
|
|
25
24
|
},
|
|
26
25
|
"devDependencies": {
|
|
27
26
|
"@types/geojson": "^7946.0.16"
|
|
28
27
|
},
|
|
29
28
|
"scripts": {
|
|
30
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
29
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
30
|
+
"build-catalogue-meta": "node ../../scripts/build-catalogue-meta.js"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "MlHexagonLayer",
|
|
3
|
+
"title": "Hexagon Layer using DeckGL",
|
|
4
|
+
"description": "Adds a deck.gl HexagonLayer to the map that spatially aggregates point-based datasets — including real-time data — and renders them as an interactive 3D hexagonal heatmap.",
|
|
5
|
+
"i18n": {
|
|
6
|
+
"de": {
|
|
7
|
+
"title": "Hexagon Layer basierend auf DeckGL",
|
|
8
|
+
"description": "Fügt der Karte einen deck.gl HexagonLayer hinzu, der punktbasierte Datensätze – einschließlich Echtzeit-Daten – räumlich aggregiert und als interaktive 3D-Hexagon-Heatmap darstellt."
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"tags": ["Map layer", "deckGL"],
|
|
12
|
+
"category": "Map layer",
|
|
13
|
+
"type": "component",
|
|
14
|
+
"demos": [
|
|
15
|
+
{
|
|
16
|
+
"name": "Demo",
|
|
17
|
+
"url": "https://mapcomponents.github.io/react-map-components-maplibre/deck-gl/iframe.html?args=&globals=&id=mapcomponents-mlhexagonlayer--custom-color-and-height-profile&viewMode=story"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"thumbnail": "https://mapcomponents.github.io/react-map-components-maplibre/deck-gl/thumbnails/MlHexagonLayer.png"
|
|
21
|
+
}
|
|
@@ -40,38 +40,31 @@ const defaultProps = {
|
|
|
40
40
|
const MlHexagonLayer = (props: MlHexagonMapProps) => {
|
|
41
41
|
const deckGlHook = useDeckGl();
|
|
42
42
|
|
|
43
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
44
|
-
// @ts-expect-error
|
|
45
|
-
props = {
|
|
46
|
-
...defaultProps,
|
|
47
|
-
...props,
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const { mapId, ...HexagonLayerProps } = props;
|
|
51
|
-
|
|
52
43
|
const mapHook = useMap({
|
|
53
|
-
mapId: mapId,
|
|
54
|
-
waitForLayer:
|
|
44
|
+
mapId: props.mapId,
|
|
45
|
+
waitForLayer: props.beforeId,
|
|
55
46
|
});
|
|
56
47
|
|
|
57
48
|
// create deck.gl HexagonLayer once when its props change
|
|
58
49
|
const hexagonLayer = useMemo(() => {
|
|
50
|
+
const { mapId: _mapId, ...HexagonLayerProps } = props;
|
|
59
51
|
if (!HexagonLayerProps.data) return null;
|
|
60
52
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
61
53
|
// @ts-ignore
|
|
62
54
|
return new HexagonLayer({
|
|
55
|
+
...defaultProps,
|
|
63
56
|
...HexagonLayerProps,
|
|
64
57
|
} as unknown as HexagonLayerProps);
|
|
65
58
|
}, [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
59
|
+
props.beforeId,
|
|
60
|
+
props.data,
|
|
61
|
+
props.elevationScale,
|
|
62
|
+
props.extruded,
|
|
63
|
+
props.coverage,
|
|
64
|
+
props.autoHighlight,
|
|
65
|
+
props.material,
|
|
66
|
+
props.radius,
|
|
67
|
+
props.transitions,
|
|
75
68
|
]);
|
|
76
69
|
|
|
77
70
|
// add/remove the memoized layer
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "MlScenegraphLayer",
|
|
3
|
+
"title": "Scenegraph Layer using DeckGL",
|
|
4
|
+
"description": "Adds a deck.gl ScenegraphLayer to the map that places instanced copies of a glTF 3D model at geographic data point locations. Position, orientation and scale can be configured per instance, and animated glTF models are fully supported. Demo model: https://github.com/KhronosGroup/glTF-Sample-Models/tree/main/2.0/BoxAnimated",
|
|
5
|
+
"i18n": {
|
|
6
|
+
"de": {
|
|
7
|
+
"title": "Scenegraph Layer basierend auf DeckGL",
|
|
8
|
+
"description": "Fügt der Karte einen deck.gl ScenegraphLayer hinzu, der instanzierte Kopien eines glTF-3D-Modells an geografischen Datenpunkten platziert. Position, Ausrichtung und Skalierung lassen sich pro Instanz konfigurieren; animierte glTF-Modelle werden vollständig unterstützt. Demo-Modell: https://github.com/KhronosGroup/glTF-Sample-Models/tree/main/2.0/BoxAnimated"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"tags": ["Map layer", "deckGL"],
|
|
12
|
+
"category": "Map layer",
|
|
13
|
+
"type": "component",
|
|
14
|
+
"demos": [
|
|
15
|
+
{
|
|
16
|
+
"name": "Demo",
|
|
17
|
+
"url": "https://mapcomponents.github.io/react-map-components-maplibre/deck-gl/iframe.html?args=&globals=&id=mapcomponents-mlscenegraphlayer--deckgl-example&viewMode=story"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"thumbnail": "https://mapcomponents.github.io/react-map-components-maplibre/deck-gl/thumbnails/MlScenegraphLayer.png"
|
|
21
|
+
}
|
package/src/decorators/style.css
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
|
+
html,
|
|
2
|
+
body,
|
|
3
|
+
#storybook-root,
|
|
4
|
+
#root {
|
|
5
|
+
height: 100%;
|
|
6
|
+
margin: 0;
|
|
7
|
+
padding: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
1
10
|
#root {
|
|
2
11
|
background-color: #000;
|
|
3
12
|
position: absolute;
|
|
4
|
-
min-height: 400px;
|
|
5
13
|
top: 0;
|
|
6
14
|
bottom: 0;
|
|
7
15
|
left: 0;
|
|
8
16
|
right: 0;
|
|
9
17
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
.docs-story > div:first-child {
|
|
16
|
-
width: 100%;
|
|
18
|
+
|
|
19
|
+
#storybook-root > div,
|
|
20
|
+
#root > div {
|
|
21
|
+
height: 100%;
|
|
17
22
|
}
|
|
18
23
|
|
|
19
24
|
.App {
|
|
@@ -23,6 +28,15 @@
|
|
|
23
28
|
bottom: 0;
|
|
24
29
|
left: 0;
|
|
25
30
|
}
|
|
31
|
+
|
|
32
|
+
.fullscreen_map {
|
|
33
|
+
position: absolute;
|
|
34
|
+
top: 0;
|
|
35
|
+
bottom: 0;
|
|
36
|
+
left: 0;
|
|
37
|
+
right: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
26
40
|
.fullscreen_map .mapContainer {
|
|
27
41
|
position: absolute;
|
|
28
42
|
top: 0;
|
package/tsconfig.lib.json
CHANGED
package/vite.config.ts
CHANGED
|
@@ -1,71 +1,73 @@
|
|
|
1
1
|
/// <reference types='vitest' />
|
|
2
2
|
import { defineConfig } from 'vite';
|
|
3
|
-
import react from '@vitejs/plugin-react';
|
|
4
3
|
import dts from 'vite-plugin-dts';
|
|
5
4
|
import * as path from 'path';
|
|
6
5
|
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|
7
6
|
import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';
|
|
8
7
|
|
|
9
|
-
export default defineConfig(() =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
'@mui/material',
|
|
17
|
-
'@mui/system',
|
|
18
|
-
'@emotion/react',
|
|
19
|
-
'@emotion/styled',
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
plugins: [
|
|
23
|
-
react(),
|
|
24
|
-
nxViteTsPaths(),
|
|
25
|
-
nxCopyAssetsPlugin(['*.md']),
|
|
26
|
-
dts({ entryRoot: 'src', tsconfigPath: path.join(__dirname, 'tsconfig.lib.json') }),
|
|
27
|
-
],
|
|
28
|
-
// Uncomment this if you are using workers.
|
|
29
|
-
// worker: {
|
|
30
|
-
// plugins: [ nxViteTsPaths() ],
|
|
31
|
-
// },
|
|
32
|
-
// Configuration for building your library.
|
|
33
|
-
// See: https://vitejs.dev/guide/build.html#library-mode
|
|
34
|
-
build: {
|
|
35
|
-
outDir: 'dist',
|
|
36
|
-
emptyOutDir: true,
|
|
37
|
-
reportCompressedSize: true,
|
|
38
|
-
commonjsOptions: {
|
|
39
|
-
transformMixedEsModules: true,
|
|
40
|
-
},
|
|
41
|
-
lib: {
|
|
42
|
-
// Could also be a dictionary or array of multiple entry points.
|
|
43
|
-
entry: 'src/index.ts',
|
|
44
|
-
name: '@mapcomponents/deck-gl',
|
|
45
|
-
fileName: 'index',
|
|
46
|
-
// Change this to the formats you want to support.
|
|
47
|
-
// Don't forget to update your package.json as well.
|
|
48
|
-
formats: ['es' as const, 'cjs' as const],
|
|
49
|
-
},
|
|
50
|
-
rollupOptions: {
|
|
51
|
-
// External packages that should not be bundled into your library.
|
|
52
|
-
external: [
|
|
8
|
+
export default defineConfig(async () => {
|
|
9
|
+
const react = (await import('@vitejs/plugin-react')).default;
|
|
10
|
+
return {
|
|
11
|
+
root: __dirname,
|
|
12
|
+
cacheDir: '../../node_modules/.vite/packages/deck-gl',
|
|
13
|
+
resolve: {
|
|
14
|
+
dedupe: [
|
|
53
15
|
'react',
|
|
54
16
|
'react-dom',
|
|
55
|
-
'react/jsx-runtime',
|
|
56
|
-
'@mapcomponents/react-maplibre',
|
|
57
|
-
'maplibre-gl',
|
|
58
|
-
'@deck.gl/aggregation-layers',
|
|
59
|
-
'@deck.gl/core',
|
|
60
|
-
'@deck.gl/geo-layers',
|
|
61
|
-
'@deck.gl/mapbox',
|
|
62
|
-
'@deck.gl/mesh-layers',
|
|
63
17
|
'@mui/material',
|
|
64
18
|
'@mui/system',
|
|
65
|
-
'@mui/icons-material',
|
|
66
19
|
'@emotion/react',
|
|
67
20
|
'@emotion/styled',
|
|
68
21
|
],
|
|
69
22
|
},
|
|
70
|
-
|
|
71
|
-
|
|
23
|
+
plugins: [
|
|
24
|
+
react(),
|
|
25
|
+
nxViteTsPaths(),
|
|
26
|
+
nxCopyAssetsPlugin(['*.md']),
|
|
27
|
+
dts({ entryRoot: 'src', tsconfigPath: path.join(__dirname, 'tsconfig.lib.json') }),
|
|
28
|
+
],
|
|
29
|
+
// Uncomment this if you are using workers.
|
|
30
|
+
// worker: {
|
|
31
|
+
// plugins: [ nxViteTsPaths() ],
|
|
32
|
+
// },
|
|
33
|
+
// Configuration for building your library.
|
|
34
|
+
// See: https://vitejs.dev/guide/build.html#library-mode
|
|
35
|
+
build: {
|
|
36
|
+
outDir: 'dist',
|
|
37
|
+
emptyOutDir: true,
|
|
38
|
+
reportCompressedSize: true,
|
|
39
|
+
commonjsOptions: {
|
|
40
|
+
transformMixedEsModules: true,
|
|
41
|
+
},
|
|
42
|
+
lib: {
|
|
43
|
+
// Could also be a dictionary or array of multiple entry points.
|
|
44
|
+
entry: 'src/index.ts',
|
|
45
|
+
name: '@mapcomponents/deck-gl',
|
|
46
|
+
fileName: 'index',
|
|
47
|
+
// Change this to the formats you want to support.
|
|
48
|
+
// Don't forget to update your package.json as well.
|
|
49
|
+
formats: ['es' as const, 'cjs' as const],
|
|
50
|
+
},
|
|
51
|
+
rollupOptions: {
|
|
52
|
+
// External packages that should not be bundled into your library.
|
|
53
|
+
external: [
|
|
54
|
+
'react',
|
|
55
|
+
'react-dom',
|
|
56
|
+
'react/jsx-runtime',
|
|
57
|
+
'@mapcomponents/react-maplibre',
|
|
58
|
+
'maplibre-gl',
|
|
59
|
+
'@deck.gl/aggregation-layers',
|
|
60
|
+
'@deck.gl/core',
|
|
61
|
+
'@deck.gl/geo-layers',
|
|
62
|
+
'@deck.gl/mapbox',
|
|
63
|
+
'@deck.gl/mesh-layers',
|
|
64
|
+
'@mui/material',
|
|
65
|
+
'@mui/system',
|
|
66
|
+
'@mui/icons-material',
|
|
67
|
+
'@emotion/react',
|
|
68
|
+
'@emotion/styled',
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
});
|
package/dist/package.json
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@mapcomponents/deck-gl",
|
|
3
|
-
"version": "1.8.9",
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "src/index.ts",
|
|
6
|
-
"module": "dist/index.mjs",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@emotion/react": "^11.14.0",
|
|
13
|
-
"@emotion/styled": "^11.14.1",
|
|
14
|
-
"@mui/icons-material": "^7.3.2",
|
|
15
|
-
"@mui/system": "^7.3.2",
|
|
16
|
-
"@mui/material": "^7.3.2",
|
|
17
|
-
"@storybook/react": "^9.1.4",
|
|
18
|
-
"uuid": "^11.1.0"
|
|
19
|
-
},
|
|
20
|
-
"peerDependencies": {
|
|
21
|
-
"@deck.gl/aggregation-layers": "^9.2.6",
|
|
22
|
-
"@deck.gl/core": "^9.2.6",
|
|
23
|
-
"@deck.gl/geo-layers": "^9.2.6",
|
|
24
|
-
"@deck.gl/mapbox": "^9.2.6",
|
|
25
|
-
"@deck.gl/mesh-layers": "^9.2.6",
|
|
26
|
-
"@mapcomponents/react-maplibre": "workspace:*",
|
|
27
|
-
"maplibre-gl": "^5.16.0"
|
|
28
|
-
},
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"@types/geojson": "^7946.0.16"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "MlHexagonMap",
|
|
3
|
-
"title": "Hexagon Map using DeckGl Layer",
|
|
4
|
-
"description": "A component demonstrating the use of the useDeckGL Hook to add a DeckGl Hexagon Layer to the MapLibre Map instance",
|
|
5
|
-
"i18n": {
|
|
6
|
-
"de": {
|
|
7
|
-
"title": "Hexagon Map basierend auf DeckGl Layer",
|
|
8
|
-
"description": "Eine Komponenten, die das Hinzufügen von DeckGL Hexagon Layern zur MapLibre Instanz mittels des useDeckGl Hooks demonstriert"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
"tags": ["Map layer", "deckGL"],
|
|
12
|
-
"category": "Map layer",
|
|
13
|
-
"type": "component"
|
|
14
|
-
}
|
|
File without changes
|