Commit c0ce47df870e0e6db4f5f348294d27bf3c151347

Authored by Igor Kulikov
Committed by GitHub
2 parents 075138cc f305cbbe

Merge pull request #3472 from vvlladd28/bugs/map/disable-scroll

Improvement map widgets
... ... @@ -54,7 +54,7 @@
54 54 "jstree": "^3.3.10",
55 55 "jstree-bootstrap-theme": "^1.0.1",
56 56 "jszip": "^3.5.0",
57   - "leaflet": "^1.6.0",
  57 + "leaflet": "^1.7.1",
58 58 "leaflet-editable": "^1.2.0",
59 59 "leaflet-polylinedecorator": "^1.6.0",
60 60 "leaflet-providers": "^1.10.2",
... ...
... ... @@ -86,8 +86,7 @@ export default abstract class LeafletMap {
86 86
87 87 public initSettings(options: MapSettings) {
88 88 this.options.tinyColor = tinycolor(this.options.color || defaultSettings.color);
89   - const { disableScrollZooming,
90   - useClusterMarkers,
  89 + const { useClusterMarkers,
91 90 zoomOnClick,
92 91 showCoverageOnHover,
93 92 removeOutsideVisibleBounds,
... ... @@ -95,9 +94,6 @@ export default abstract class LeafletMap {
95 94 chunkedLoading,
96 95 maxClusterRadius,
97 96 maxZoom }: MapSettings = options;
98   - if (disableScrollZooming) {
99   - this.map.scrollWheelZoom.disable();
100   - }
101 97 if (useClusterMarkers) {
102 98 const clusteringSettings: MarkerClusterGroupOptions = {
103 99 zoomToBoundsOnClick: zoomOnClick,
... ... @@ -307,8 +303,11 @@ export default abstract class LeafletMap {
307 303 } else {
308 304 this.bounds = new L.LatLngBounds(null, null);
309 305 }
  306 + if (this.options.disableScrollZooming) {
  307 + this.map.scrollWheelZoom.disable();
  308 + }
310 309 if (this.options.draggableMarker) {
311   - this.addMarkerControl();
  310 + this.addMarkerControl();
312 311 }
313 312 if (this.options.editablePolygon) {
314 313 this.addPolygonControl();
... ... @@ -623,10 +622,10 @@ export default abstract class LeafletMap {
623 622
624 623 // Polyline
625 624
626   - updatePolylines(polyData: FormattedData[][], updateBounds = true, data?: FormattedData) {
  625 + updatePolylines(polyData: FormattedData[][], updateBounds = true, activePolyline?: FormattedData) {
627 626 const keys: string[] = [];
628 627 polyData.forEach((dataSource: FormattedData[]) => {
629   - data = data || dataSource[0];
  628 + const data = activePolyline || dataSource[0];
630 629 if (dataSource.length && data.entityName === dataSource[0].entityName) {
631 630 if (this.polylines.get(data.entityName)) {
632 631 this.updatePolyline(data, dataSource, this.options, updateBounds);
... ...
... ... @@ -5770,10 +5770,10 @@ leaflet.markercluster@^1.4.1:
5770 5770 resolved "https://registry.yarnpkg.com/leaflet.markercluster/-/leaflet.markercluster-1.4.1.tgz#b53f2c4f2ca7306ddab1dbb6f1861d5e8aa6c5e5"
5771 5771 integrity sha512-ZSEpE/EFApR0bJ1w/dUGwTSUvWlpalKqIzkaYdYB7jaftQA/Y2Jav+eT4CMtEYFj+ZK4mswP13Q2acnPBnhGOw==
5772 5772
5773   -leaflet@^1.6.0:
5774   - version "1.6.0"
5775   - resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.6.0.tgz#aecbb044b949ec29469eeb31c77a88e2f448f308"
5776   - integrity sha512-CPkhyqWUKZKFJ6K8umN5/D2wrJ2+/8UIpXppY7QDnUZW5bZL5+SEI2J7GBpwh4LIupOKqbNSQXgqmrEJopHVNQ==
  5773 +leaflet@^1.7.1:
  5774 + version "1.7.1"
  5775 + resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.7.1.tgz#10d684916edfe1bf41d688a3b97127c0322a2a19"
  5776 + integrity sha512-/xwPEBidtg69Q3HlqPdU3DnrXQOvQU/CCHA1tcDQVzOwm91YMYaILjNp7L4Eaw5Z4sOYdbBz6koWyibppd8Zqw==
5777 5777
5778 5778 less-loader@6.1.0:
5779 5779 version "6.1.0"
... ...