adt-js-components 1.10.2 → 1.10.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.
- package/package.json +1 -1
- package/src/Map/index.js +7 -1
package/package.json
CHANGED
package/src/Map/index.js
CHANGED
|
@@ -21,6 +21,7 @@ const markerClusters = new WeakMap();
|
|
|
21
21
|
const onSelectionChangeMap = new WeakMap();
|
|
22
22
|
const onBeforeRouteCalculationMap = new WeakMap();
|
|
23
23
|
const onAfterRouteCalculationMap = new WeakMap();
|
|
24
|
+
const disableClickZoomMap = new WeakMap();
|
|
24
25
|
|
|
25
26
|
const DEPOT_TYPE = {
|
|
26
27
|
START: 'depot-start',
|
|
@@ -53,6 +54,7 @@ async function run(options) {
|
|
|
53
54
|
markerInfoCallback = null,
|
|
54
55
|
onBeforeRouteCalculation = null,
|
|
55
56
|
onAfterRouteCalculation = null,
|
|
57
|
+
disableClickZoom = false
|
|
56
58
|
} = JSON.parse(el.dataset.adtMap);
|
|
57
59
|
|
|
58
60
|
const routeSettings = {
|
|
@@ -78,6 +80,7 @@ async function run(options) {
|
|
|
78
80
|
onSelectionChangeMap.set(map, onSelectionChange);
|
|
79
81
|
onBeforeRouteCalculationMap.set(map, onBeforeRouteCalculation);
|
|
80
82
|
onAfterRouteCalculationMap.set(map, onAfterRouteCalculation);
|
|
83
|
+
disableClickZoomMap.set(map, disableClickZoom);
|
|
81
84
|
|
|
82
85
|
if (mapProvider === MAP_PROVIDER.HERE) {
|
|
83
86
|
L.tileLayer(
|
|
@@ -625,7 +628,10 @@ async function calculateRoute(map) {
|
|
|
625
628
|
opacity: routeSettings.opacity
|
|
626
629
|
}).addTo(map);
|
|
627
630
|
routePolylines.set(map, polyline);
|
|
628
|
-
|
|
631
|
+
|
|
632
|
+
if (!disableClickZoomMap.get(map)) {
|
|
633
|
+
map.fitBounds(polyline.getBounds(), {padding: [32, 32]});
|
|
634
|
+
}
|
|
629
635
|
}
|
|
630
636
|
|
|
631
637
|
const totalDuration = allParts.reduce((s, p) => s + (p.duration || 0), 0);
|