@dartcom/ui-kit 10.2.22 → 10.2.24
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 +2 -1
- package/dist/components/layers/leaflet/lib/hooks/useGetLeafletLayer.d.ts.map +1 -1
- package/dist/index.cjs +6 -21
- 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,CAgB7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Nullable } from '../../../../../lib/types';
|
|
2
2
|
import { SourceLayerEventHandlers, TangramCustomLayer, TangramEventConfig, TangramLeafletLayer, TangramScene, TangramSourceConfig, TangramSourceNames } from '../types';
|
|
3
3
|
type UseGetLeafletLayerProps = {
|
|
4
|
+
map: L.Map;
|
|
4
5
|
eventHandlers?: SourceLayerEventHandlers;
|
|
5
6
|
defaultLayers?: TangramCustomLayer[];
|
|
6
7
|
};
|
|
7
|
-
export declare const useGetLeafletLayer: ({ eventHandlers, defaultLayers, }: UseGetLeafletLayerProps) => {
|
|
8
|
+
export declare const useGetLeafletLayer: ({ map, eventHandlers, defaultLayers, }: UseGetLeafletLayerProps) => {
|
|
8
9
|
layer: Nullable<TangramLeafletLayer>;
|
|
9
10
|
scene: TangramScene | null;
|
|
10
11
|
config: Nullable<TangramEventConfig>;
|
|
@@ -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;
|
|
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;AAGlB,KAAK,uBAAuB,GAAG;IAC7B,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC;IAEX,aAAa,CAAC,EAAE,wBAAwB,CAAC;IACzC,aAAa,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,wCAKhC,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
|
@@ -43397,7 +43397,7 @@ const getLayerModalsNames = (layer) => {
|
|
|
43397
43397
|
return layerModalsNames;
|
|
43398
43398
|
};
|
|
43399
43399
|
|
|
43400
|
-
const useGetLeafletLayer = ({ eventHandlers, defaultLayers, }) => {
|
|
43400
|
+
const useGetLeafletLayer = ({ map, eventHandlers, defaultLayers, }) => {
|
|
43401
43401
|
const [layer, setLayer] = React__namespace.useState(null);
|
|
43402
43402
|
const [config, setConfig] = React__namespace.useState(null);
|
|
43403
43403
|
const scene = React__namespace.useMemo(() => {
|
|
@@ -43420,24 +43420,7 @@ const useGetLeafletLayer = ({ eventHandlers, defaultLayers, }) => {
|
|
|
43420
43420
|
setConfig(config);
|
|
43421
43421
|
},
|
|
43422
43422
|
});
|
|
43423
|
-
leafletLayer.on('load', (
|
|
43424
|
-
const map = sourceTarget._map;
|
|
43425
|
-
const mapContainer = map.getContainer();
|
|
43426
|
-
const origPerformZoom = map.scrollWheelZoom._performZoom;
|
|
43427
|
-
map.scrollWheelZoom._performZoom = function (event) {
|
|
43428
|
-
try {
|
|
43429
|
-
origPerformZoom.call(event);
|
|
43430
|
-
}
|
|
43431
|
-
catch (err) {
|
|
43432
|
-
if (err.message.includes('lat')) {
|
|
43433
|
-
const delta = event.originalEvent.deltaY > 0 ? -0.1 : 0.1;
|
|
43434
|
-
map.setZoom(map.getZoom() + delta, { animate: true });
|
|
43435
|
-
}
|
|
43436
|
-
else {
|
|
43437
|
-
throw err;
|
|
43438
|
-
}
|
|
43439
|
-
}
|
|
43440
|
-
};
|
|
43423
|
+
leafletLayer.on('load', () => {
|
|
43441
43424
|
leafletLayer.setSelectionEvents({
|
|
43442
43425
|
click: ({ feature, leaflet_event }) => {
|
|
43443
43426
|
if (feature) {
|
|
@@ -43449,6 +43432,7 @@ const useGetLeafletLayer = ({ eventHandlers, defaultLayers, }) => {
|
|
|
43449
43432
|
}
|
|
43450
43433
|
},
|
|
43451
43434
|
hover: ({ feature, leaflet_event }) => {
|
|
43435
|
+
const mapContainer = map.getContainer();
|
|
43452
43436
|
if (feature) {
|
|
43453
43437
|
mapContainer.style.cursor = 'pointer';
|
|
43454
43438
|
const { source_layer, properties } = feature;
|
|
@@ -43466,7 +43450,7 @@ const useGetLeafletLayer = ({ eventHandlers, defaultLayers, }) => {
|
|
|
43466
43450
|
setLayer(leafletLayer);
|
|
43467
43451
|
}
|
|
43468
43452
|
});
|
|
43469
|
-
}, [eventHandlers]);
|
|
43453
|
+
}, [eventHandlers, map]);
|
|
43470
43454
|
const checkConfig = React__namespace.useCallback((callback) => {
|
|
43471
43455
|
if (config) {
|
|
43472
43456
|
callback(config);
|
|
@@ -43690,10 +43674,11 @@ function useMap() {
|
|
|
43690
43674
|
}
|
|
43691
43675
|
|
|
43692
43676
|
const LeafletLayer = ({ layers }) => {
|
|
43677
|
+
const map = useMap();
|
|
43693
43678
|
const { layer } = useGetLeafletLayer({
|
|
43679
|
+
map,
|
|
43694
43680
|
defaultLayers: layers,
|
|
43695
43681
|
});
|
|
43696
|
-
const map = useMap();
|
|
43697
43682
|
React__namespace.useEffect(() => {
|
|
43698
43683
|
if (layer) {
|
|
43699
43684
|
map.addLayer(layer);
|