@dartcom/ui-kit 10.2.20 → 10.2.22
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":"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;;;;
|
|
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;;;;4BA2HT,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
|
@@ -43411,7 +43411,8 @@ const useGetLeafletLayer = ({ eventHandlers, defaultLayers, }) => {
|
|
|
43411
43411
|
if (window.Tangram) {
|
|
43412
43412
|
const leafletLayer = window.Tangram.leafletLayer({
|
|
43413
43413
|
scene: data,
|
|
43414
|
-
modifyScrollWheel:
|
|
43414
|
+
modifyScrollWheel: true,
|
|
43415
|
+
modifyZoomBehavior: false,
|
|
43415
43416
|
});
|
|
43416
43417
|
const { scene } = leafletLayer;
|
|
43417
43418
|
scene.subscribe({
|
|
@@ -43422,6 +43423,21 @@ const useGetLeafletLayer = ({ eventHandlers, defaultLayers, }) => {
|
|
|
43422
43423
|
leafletLayer.on('load', ({ sourceTarget }) => {
|
|
43423
43424
|
const map = sourceTarget._map;
|
|
43424
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
|
+
};
|
|
43425
43441
|
leafletLayer.setSelectionEvents({
|
|
43426
43442
|
click: ({ feature, leaflet_event }) => {
|
|
43427
43443
|
if (feature) {
|