adt-js-components 1.10.7 → 1.10.8

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Map/index.js +5 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adt-js-components",
3
- "version": "1.10.7",
3
+ "version": "1.10.8",
4
4
  "description": "JavaScript components for Nette framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/Map/index.js CHANGED
@@ -375,7 +375,11 @@ function addMarkers(map, markers, options, selectedOptions, position, selectable
375
375
  }
376
376
 
377
377
  if (!position.length && positionsOfMarkers.length) {
378
- map.fitBounds(positionsOfMarkers);
378
+ const rs = routeSettingsMap.get(map);
379
+ const allBounds = [...positionsOfMarkers];
380
+ if (rs?.startPoint) allBounds.push([rs.startPoint.lat, rs.startPoint.lon]);
381
+ if (rs?.endPoint) allBounds.push([rs.endPoint.lat, rs.endPoint.lon]);
382
+ map.fitBounds(allBounds);
379
383
  }
380
384
  map.addLayer(cluster);
381
385