@dartcom/ui-kit 10.2.24 → 10.2.25

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.
@@ -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,CAgB7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
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,11 +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
- map: L.Map;
5
4
  eventHandlers?: SourceLayerEventHandlers;
6
5
  defaultLayers?: TangramCustomLayer[];
7
6
  };
8
- export declare const useGetLeafletLayer: ({ map, eventHandlers, defaultLayers, }: UseGetLeafletLayerProps) => {
7
+ export declare const useGetLeafletLayer: ({ eventHandlers, defaultLayers, }: UseGetLeafletLayerProps) => {
9
8
  layer: Nullable<TangramLeafletLayer>;
10
9
  scene: TangramScene | null;
11
10
  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;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"}
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;;;;4BA0GT,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 = ({ map, eventHandlers, defaultLayers, }) => {
43400
+ const useGetLeafletLayer = ({ 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(() => {
@@ -43411,8 +43411,7 @@ const useGetLeafletLayer = ({ map, eventHandlers, defaultLayers, }) => {
43411
43411
  if (window.Tangram) {
43412
43412
  const leafletLayer = window.Tangram.leafletLayer({
43413
43413
  scene: data,
43414
- modifyScrollWheel: true,
43415
- modifyZoomBehavior: false,
43414
+ modifyScrollWheel: false,
43416
43415
  });
43417
43416
  const { scene } = leafletLayer;
43418
43417
  scene.subscribe({
@@ -43420,7 +43419,8 @@ const useGetLeafletLayer = ({ map, eventHandlers, defaultLayers, }) => {
43420
43419
  setConfig(config);
43421
43420
  },
43422
43421
  });
43423
- leafletLayer.on('load', () => {
43422
+ leafletLayer.on('load', ({ sourceTarget }) => {
43423
+ const map = sourceTarget._map;
43424
43424
  leafletLayer.setSelectionEvents({
43425
43425
  click: ({ feature, leaflet_event }) => {
43426
43426
  if (feature) {
@@ -43434,8 +43434,8 @@ const useGetLeafletLayer = ({ map, eventHandlers, defaultLayers, }) => {
43434
43434
  hover: ({ feature, leaflet_event }) => {
43435
43435
  const mapContainer = map.getContainer();
43436
43436
  if (feature) {
43437
- mapContainer.style.cursor = 'pointer';
43438
43437
  const { source_layer, properties } = feature;
43438
+ mapContainer.style.cursor = 'pointer';
43439
43439
  eventHandlers?.[source_layer]?.hover?.({
43440
43440
  leaflet_event,
43441
43441
  properties,
@@ -43450,7 +43450,7 @@ const useGetLeafletLayer = ({ map, eventHandlers, defaultLayers, }) => {
43450
43450
  setLayer(leafletLayer);
43451
43451
  }
43452
43452
  });
43453
- }, [eventHandlers, map]);
43453
+ }, [eventHandlers]);
43454
43454
  const checkConfig = React__namespace.useCallback((callback) => {
43455
43455
  if (config) {
43456
43456
  callback(config);
@@ -43676,7 +43676,6 @@ function useMap() {
43676
43676
  const LeafletLayer = ({ layers }) => {
43677
43677
  const map = useMap();
43678
43678
  const { layer } = useGetLeafletLayer({
43679
- map,
43680
43679
  defaultLayers: layers,
43681
43680
  });
43682
43681
  React__namespace.useEffect(() => {