@dartcom/ui-kit 10.2.17 → 10.2.18
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/components/layers/leaflet/leaflet.d.ts.map +1 -1
- package/dist/components/layers/leaflet/lib/hooks/useGetLeafletLayer.d.ts +5 -2
- package/dist/components/layers/leaflet/lib/hooks/useGetLeafletLayer.d.ts.map +1 -1
- package/dist/index.cjs +9 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leaflet.d.ts","sourceRoot":"","sources":["../../../../src/components/layers/leaflet/leaflet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,kBAAkB,EAAsB,MAAM,OAAO,CAAC;AAE/D,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,kBAAkB,EAAE,CAAC;CAC9B,CAAC;AAEF,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"leaflet.d.ts","sourceRoot":"","sources":["../../../../src/components/layers/leaflet/leaflet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,kBAAkB,EAAsB,MAAM,OAAO,CAAC;AAE/D,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,kBAAkB,EAAE,CAAC;CAC9B,CAAC;AAEF,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAc7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Nullable } from '../../../../../lib/types';
|
|
2
2
|
import { SourceLayerEventHandlers, TangramCustomLayer, TangramEventConfig, TangramLeafletLayer, TangramScene, TangramSourceConfig, TangramSourceNames } from '../types';
|
|
3
|
-
|
|
3
|
+
type UseGetLeafletLayerProps = {
|
|
4
4
|
eventHandlers?: SourceLayerEventHandlers;
|
|
5
|
-
|
|
5
|
+
defaultLayers?: TangramCustomLayer[];
|
|
6
|
+
};
|
|
7
|
+
export declare const useGetLeafletLayer: ({ eventHandlers, defaultLayers, }: UseGetLeafletLayerProps) => {
|
|
6
8
|
layer: Nullable<TangramLeafletLayer>;
|
|
7
9
|
scene: TangramScene | null;
|
|
8
10
|
config: Nullable<TangramEventConfig>;
|
|
@@ -25,4 +27,5 @@ export declare const useGetLeafletLayer: ({ eventHandlers, }: {
|
|
|
25
27
|
getLayers: () => string[];
|
|
26
28
|
removeLayers: () => void;
|
|
27
29
|
};
|
|
30
|
+
export {};
|
|
28
31
|
//# sourceMappingURL=useGetLeafletLayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetLeafletLayer.d.ts","sourceRoot":"","sources":["../../../../../../src/components/layers/leaflet/lib/hooks/useGetLeafletLayer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAMvC,OAAO,EAEL,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAKlB,
|
|
1
|
+
{"version":3,"file":"useGetLeafletLayer.d.ts","sourceRoot":"","sources":["../../../../../../src/components/layers/leaflet/lib/hooks/useGetLeafletLayer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAMvC,OAAO,EAEL,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAKlB,KAAK,uBAAuB,GAAG;IAC7B,aAAa,CAAC,EAAE,wBAAwB,CAAC;IACzC,aAAa,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,mCAGhC,uBAAuB;;;;4BAyGT,kBAAkB;4BA0BlB,mBAAmB,CAAC,MAAM,CAAC;+BAa1B,mBAAmB,CAAC,MAAM,CAAC,UAC/B,mBAAmB,CAAC,KAAK,CAAC;+BAWvB,kBAAkB;sBASvB,kBAAkB;yBAyClB,kBAAkB;gCAaR;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;gCAWzC,kBAAkB;gDAgBL;QAAE,KAAK,EAAE,kBAAkB,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE;;;;CA2HvE,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -28867,7 +28867,7 @@ const getLayerModalsNames = (layer) => {
|
|
|
28867
28867
|
return layerModalsNames;
|
|
28868
28868
|
};
|
|
28869
28869
|
|
|
28870
|
-
const useGetLeafletLayer = ({ eventHandlers, }) => {
|
|
28870
|
+
const useGetLeafletLayer = ({ eventHandlers, defaultLayers, }) => {
|
|
28871
28871
|
const [layer, setLayer] = React__namespace.useState(null);
|
|
28872
28872
|
const [config, setConfig] = React__namespace.useState(null);
|
|
28873
28873
|
const scene = React__namespace.useMemo(() => {
|
|
@@ -29105,6 +29105,11 @@ const useGetLeafletLayer = ({ eventHandlers, }) => {
|
|
|
29105
29105
|
});
|
|
29106
29106
|
Object.values(exports.TangramSourceNames).forEach(addSource);
|
|
29107
29107
|
}, [addStyle, addSource]);
|
|
29108
|
+
React__namespace.useEffect(() => {
|
|
29109
|
+
if (defaultLayers) {
|
|
29110
|
+
defaultLayers.map(addLayer);
|
|
29111
|
+
}
|
|
29112
|
+
}, [defaultLayers, addLayer]);
|
|
29108
29113
|
return {
|
|
29109
29114
|
layer,
|
|
29110
29115
|
scene,
|
|
@@ -29138,16 +29143,15 @@ function useMap() {
|
|
|
29138
29143
|
}
|
|
29139
29144
|
|
|
29140
29145
|
const LeafletLayer = ({ layers }) => {
|
|
29141
|
-
const { layer
|
|
29146
|
+
const { layer } = useGetLeafletLayer({
|
|
29147
|
+
defaultLayers: layers,
|
|
29148
|
+
});
|
|
29142
29149
|
const map = useMap();
|
|
29143
29150
|
React__namespace.useEffect(() => {
|
|
29144
29151
|
if (layer) {
|
|
29145
29152
|
map.addLayer(layer);
|
|
29146
29153
|
}
|
|
29147
29154
|
}, [layer]);
|
|
29148
|
-
React__namespace.useEffect(() => {
|
|
29149
|
-
layers.map(addLayer);
|
|
29150
|
-
}, [addLayer, layers]);
|
|
29151
29155
|
return null;
|
|
29152
29156
|
};
|
|
29153
29157
|
|