@mapcomponents/deck-gl 1.8.10 → 1.8.19-3

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 (46) hide show
  1. package/dist/catalogue/mc_meta.json +44 -1
  2. package/dist/index.js +1 -1
  3. package/dist/index.mjs +171 -143
  4. package/dist/thumbnails/MlScenegraphLayer.png +0 -0
  5. package/package.json +18 -15
  6. package/src/components/MlHexagonLayer/MlHexagonLayer.meta.json +21 -0
  7. package/src/components/MlSceneGraphLayer/MlScenegraphLayer.meta.json +21 -0
  8. package/src/decorators/style.css +22 -8
  9. package/tsconfig.lib.json +5 -0
  10. package/tsconfig.storybook.json +8 -0
  11. package/vite.config.ts +58 -56
  12. package/dist/package.json +0 -32
  13. package/dist/thumbnails/MapLibreMap.png +0 -0
  14. package/dist/thumbnails/MlCameraFollowPath.png +0 -0
  15. package/dist/thumbnails/MlCreatePdfButton.png +0 -0
  16. package/dist/thumbnails/MlCreatePdfForm.png +0 -0
  17. package/dist/thumbnails/MlDeckGlLayer.png +0 -0
  18. package/dist/thumbnails/MlDeckGlTerrainLayer.png +0 -0
  19. package/dist/thumbnails/MlDemoDashboard.png +0 -0
  20. package/dist/thumbnails/MlFeatureEditor.png +0 -0
  21. package/dist/thumbnails/MlFillExtrusionLayer.png +0 -0
  22. package/dist/thumbnails/MlFollowGps.png +0 -0
  23. package/dist/thumbnails/MlGeoJsonLayer.png +0 -0
  24. package/dist/thumbnails/MlGpxViewer.png +0 -0
  25. package/dist/thumbnails/MlHillshadeLayer.png +0 -0
  26. package/dist/thumbnails/MlIconLayer.png +0 -0
  27. package/dist/thumbnails/MlLayerMagnify.png +0 -0
  28. package/dist/thumbnails/MlLayerSwipe.png +0 -0
  29. package/dist/thumbnails/MlMapDrawTools.png +0 -0
  30. package/dist/thumbnails/MlMeasureTool.png +0 -0
  31. package/dist/thumbnails/MlMobilerImker.png +0 -0
  32. package/dist/thumbnails/MlNavigationCompass.png +0 -0
  33. package/dist/thumbnails/MlNavigationTools.png +0 -0
  34. package/dist/thumbnails/MlOsmLayer.png +0 -0
  35. package/dist/thumbnails/MlScaleReference.png +0 -0
  36. package/dist/thumbnails/MlSketchTool.png +0 -0
  37. package/dist/thumbnails/MlSpatialElevationProfile.png +0 -0
  38. package/dist/thumbnails/MlThreeJsLayer.png +0 -0
  39. package/dist/thumbnails/MlTransitionGeoJsonLayer.png +0 -0
  40. package/dist/thumbnails/MlVectorTileLayer.png +0 -0
  41. package/dist/thumbnails/MlWanderApp.png +0 -0
  42. package/dist/thumbnails/MlWmsLayer.png +0 -0
  43. package/dist/thumbnails/MlWmsLoader.png +0 -0
  44. package/dist/thumbnails/useCameraFollowPath.png +0 -0
  45. package/src/components/MlHexagonLayer/MlHexagonLayer.meta_.json +0 -14
  46. /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
+ }
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("react"),i=require("@mapcomponents/react-maplibre"),L=require("@deck.gl/mapbox"),f=require("@deck.gl/aggregation-layers"),g=require("@deck.gl/geo-layers"),k=require("@deck.gl/mesh-layers"),v="deckgl-layer",y=n.createContext({}),x=({mapId:e,children:o})=>{const r=i.useMap({mapId:e}),t=n.useRef(void 0),[s,a]=n.useState([]),[c,u]=n.useState([]);n.useEffect(()=>{if(r.map)return t.current=new L.MapboxOverlay({id:v,interleaved:!0}),r.map.addControl(t.current),()=>{t.current&&r.map?.removeControl(t.current),t.current=void 0}},[r.map]),n.useEffect(()=>{t.current&&t.current.setProps({layers:[...s],effects:[...c]})},[s,c]);const m={deckGlLayerArray:s,setDeckGlLayerArray:a,deckGlEffectArray:c,setDeckGlEffectArray:u};return l.jsx(y.Provider,{value:m,children:o})};function d(){const e=n.useContext(y);function o(a){e.setDeckGlEffectArray(c=>[...c,a])}function r(a){e.setDeckGlEffectArray(c=>c.filter(u=>u!==a))}function t(a){e.setDeckGlLayerArray(c=>[...c,a])}function s(a){e.setDeckGlLayerArray(c=>c.filter(u=>u!==a))}return{addEffect:o,removeEffect:r,addLayer:t,removeLayer:s}}const p={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]]},G=e=>{const o=d(),r=i.useMap({mapId:e.mapId,waitForLayer:e.beforeId}),t=n.useMemo(()=>{const{mapId:s,...a}=e;return a.data?new f.HexagonLayer({...p,...a}):null},[e.beforeId,e.data,e.elevationScale,e.extruded,e.coverage,e.autoHighlight,e.material,e.radius,e.transitions]);return n.useEffect(()=>{if(!(!r.map||!t))return o.addLayer(t),()=>{o.removeLayer(t)}},[r.map,t]),l.jsx(l.Fragment,{})},D=e=>{const{mapId:o,...r}=e,t=i.useMap({mapId:o}),s=d(),a=n.useMemo(()=>r.data?new g.Tile3DLayer({...r}):null,[r.data,r.id,r.pickable,r.onTileLoad,r.onTileUnload,r.loadOptions,r.loaders,r.visible,r.opacity,r.pointSize,r.beforeId]);return n.useEffect(()=>{if(!(!t.map||!a))return s.addLayer(a),()=>{a&&s.removeLayer(a)}},[t.map,a]),l.jsx(l.Fragment,{})},M=e=>{const o=i.useMap({mapId:e.mapId,waitForLayer:e.beforeId}),r=d(),t=n.useMemo(()=>{const{mapId:s,...a}=e;return new k.ScenegraphLayer({...a})},[e]);return n.useEffect(()=>{if(!(!o.map||!t))return r.addLayer(t),()=>{t&&r.removeLayer(t)}},[o.map,t]),l.jsx(l.Fragment,{})};exports.DeckGlContext=y;exports.DeckGlContextProvider=x;exports.Ml3DTileLayer=D;exports.MlHexagonLayer=G;exports.MlSceneGraphLayer=M;exports.useDeckGl=d;
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,146 +1,174 @@
1
- import { jsx as d, Fragment as s } from "react/jsx-runtime";
2
- import p, { useRef as g, useState as y, useEffect as i, useContext as G, useMemo as f } from "react";
3
- import { useMap as u } from "@mapcomponents/react-maplibre";
4
- import { MapboxOverlay as x } from "@deck.gl/mapbox";
5
- import { HexagonLayer as L } from "@deck.gl/aggregation-layers";
6
- import { Tile3DLayer as I } from "@deck.gl/geo-layers";
7
- import { ScenegraphLayer as D } from "@deck.gl/mesh-layers";
8
- const H = "deckgl-layer", k = p.createContext({}), w = ({ mapId: e, children: n }) => {
9
- const r = u({ mapId: e }), t = g(void 0), [c, a] = y([]), [o, l] = y([]);
10
- i(() => {
11
- if (r.map)
12
- return t.current = new x({
13
- id: H,
14
- interleaved: !0
15
- }), r.map.addControl(t.current), () => {
16
- t.current && r.map?.removeControl(t.current), t.current = void 0;
17
- };
18
- }, [r.map]), i(() => {
19
- t.current && t.current.setProps({
20
- layers: [...c],
21
- effects: [...o]
22
- });
23
- }, [c, o]);
24
- const v = {
25
- deckGlLayerArray: c,
26
- setDeckGlLayerArray: a,
27
- deckGlEffectArray: o,
28
- setDeckGlEffectArray: l
29
- };
30
- return /* @__PURE__ */ d(k.Provider, { value: v, children: n });
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
- function m() {
33
- const e = G(k);
34
- function n(a) {
35
- e.setDeckGlEffectArray((o) => [...o, a]);
36
- }
37
- function r(a) {
38
- e.setDeckGlEffectArray((o) => o.filter((l) => l !== a));
39
- }
40
- function t(a) {
41
- e.setDeckGlLayerArray((o) => [...o, a]);
42
- }
43
- function c(a) {
44
- e.setDeckGlLayerArray((o) => o.filter((l) => l !== a));
45
- }
46
- return {
47
- addEffect: n,
48
- removeEffect: r,
49
- addLayer: t,
50
- removeLayer: c
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
- const h = {
54
- type: L,
55
- layerOpacity: 0.8,
56
- elevationRange: [30, 75],
57
- elevationScale: 1,
58
- extruded: !0,
59
- coverage: 0.9,
60
- autoHighlight: !1,
61
- material: { ambient: 0.6, diffuse: 0.5, shininess: 10 },
62
- radius: 16,
63
- transitions: { elevationScale: 1500 },
64
- _filterData: null,
65
- colorRange: [
66
- [1, 152, 189, 125],
67
- [73, 227, 206, 150],
68
- [216, 254, 181, 175],
69
- [254, 237, 177, 200],
70
- [254, 173, 84, 225],
71
- [209, 55, 78, 255]
72
- ]
73
- }, R = (e) => {
74
- const n = m(), r = u({
75
- mapId: e.mapId,
76
- waitForLayer: e.beforeId
77
- }), t = f(() => {
78
- const { mapId: c, ...a } = e;
79
- return a.data ? new L({
80
- ...h,
81
- ...a
82
- }) : null;
83
- }, [
84
- e.beforeId,
85
- e.data,
86
- e.elevationScale,
87
- e.extruded,
88
- e.coverage,
89
- e.autoHighlight,
90
- e.material,
91
- e.radius,
92
- e.transitions
93
- ]);
94
- return i(() => {
95
- if (!(!r.map || !t))
96
- return n.addLayer(t), () => {
97
- n.removeLayer(t);
98
- };
99
- }, [r.map, t]), /* @__PURE__ */ d(s, {});
100
- }, T = (e) => {
101
- const { mapId: n, ...r } = e, t = u({ mapId: n }), c = m(), a = f(() => r.data ? new I({
102
- ...r
103
- }) : null, [
104
- r.data,
105
- r.id,
106
- r.pickable,
107
- r.onTileLoad,
108
- r.onTileUnload,
109
- r.loadOptions,
110
- r.loaders,
111
- r.visible,
112
- r.opacity,
113
- r.pointSize,
114
- r.beforeId
115
- ]);
116
- return i(() => {
117
- if (!(!t.map || !a))
118
- return c.addLayer(a), () => {
119
- a && c.removeLayer(a);
120
- };
121
- }, [t.map, a]), /* @__PURE__ */ d(s, {});
122
- }, F = (e) => {
123
- const n = u({
124
- mapId: e.mapId,
125
- waitForLayer: e.beforeId
126
- }), r = m(), t = f(() => {
127
- const { mapId: c, ...a } = e;
128
- return new D({
129
- ...a
130
- });
131
- }, [e]);
132
- return i(() => {
133
- if (!(!n.map || !t))
134
- return r.addLayer(t), () => {
135
- t && r.removeLayer(t);
136
- };
137
- }, [n.map, t]), /* @__PURE__ */ d(s, {});
138
- };
139
- export {
140
- k as DeckGlContext,
141
- w as DeckGlContextProvider,
142
- T as Ml3DTileLayer,
143
- R as MlHexagonLayer,
144
- F as MlSceneGraphLayer,
145
- m as useDeckGl
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, {});
146
172
  };
173
+ //#endregion
174
+ export { m as DeckGlContext, h as DeckGlContextProvider, y as Ml3DTileLayer, v as MlHexagonLayer, b as MlSceneGraphLayer, g as useDeckGl };
package/package.json CHANGED
@@ -1,32 +1,35 @@
1
1
  {
2
2
  "name": "@mapcomponents/deck-gl",
3
- "version": "1.8.10",
4
- "description": "",
3
+ "version": "1.8.19-3",
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
+ "repository": {
9
+ "url": "https://github.com/mapcomponents/react-map-components-maplibre"
10
+ },
8
11
  "dependencies": {
9
12
  "@emotion/react": "^11.14.0",
10
13
  "@emotion/styled": "^11.14.1",
11
- "@mui/icons-material": "^7.3.2",
12
- "@mui/system": "^7.3.2",
13
- "@mui/material": "^7.3.2",
14
- "@storybook/react": "^9.1.20",
15
- "uuid": "^11.1.0"
14
+ "@mui/icons-material": "^9.0.1",
15
+ "@mui/material": "^9.0.1",
16
+ "react": "^19.2.6",
17
+ "react-dom": "^19.2.6"
16
18
  },
17
19
  "peerDependencies": {
18
- "@deck.gl/aggregation-layers": "^9.2.6",
19
- "@deck.gl/core": "^9.2.6",
20
- "@deck.gl/geo-layers": "^9.2.6",
21
- "@deck.gl/mapbox": "^9.2.6",
22
- "@deck.gl/mesh-layers": "^9.2.6",
23
- "maplibre-gl": "^5.16.0",
24
- "@mapcomponents/react-maplibre": "1.8.10"
20
+ "@deck.gl/aggregation-layers": "^9.3.2",
21
+ "@deck.gl/core": "^9.3.2",
22
+ "@deck.gl/geo-layers": "^9.3.2",
23
+ "@deck.gl/mapbox": "^9.3.2",
24
+ "@deck.gl/mesh-layers": "^9.3.2",
25
+ "maplibre-gl": "^5.24.0",
26
+ "@mapcomponents/react-maplibre": "1.8.19-3"
25
27
  },
26
28
  "devDependencies": {
27
29
  "@types/geojson": "^7946.0.16"
28
30
  },
29
31
  "scripts": {
30
- "test": "echo \"Error: no test specified\" && exit 1"
32
+ "test": "echo \"Error: no test specified\" && exit 1",
33
+ "build-catalogue-meta": "node ../../scripts/build-catalogue-meta.js"
31
34
  }
32
35
  }
@@ -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
+ }
@@ -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
+ }
@@ -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
- .docs-story {
11
- min-height: 400px;
12
- display: flex;
13
- align-items: stretch;
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
@@ -31,5 +31,10 @@
31
31
  "**/*.cy.js",
32
32
  "**/*.cy.tsx",
33
33
  "**/*.cy.jsx"
34
+ ],
35
+ "references": [
36
+ {
37
+ "path": "../react-maplibre/tsconfig.lib.json"
38
+ }
34
39
  ]
35
40
  }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "composite": false,
5
+ "noEmit": true
6
+ },
7
+ "include": [".storybook/**/*"]
8
+ }
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
- root: __dirname,
11
- cacheDir: '../../node_modules/.vite/packages/deck-gl',
12
- resolve: {
13
- dedupe: [
14
- 'react',
15
- 'react-dom',
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
+ rolldownOptions: {
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.10",
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.20",
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
@@ -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
- }