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