Commit 359723b05cec15a0daac9b2e66507eeef851dc1b
Committed by
GitHub
Merge pull request #2765 from vvlladd28/bug/3.0/map/minor-fix
[3.0] Minor improvement for the map widgets
Showing
3 changed files
with
11 additions
and
11 deletions
... | ... | @@ -20,12 +20,12 @@ import 'leaflet-providers'; |
20 | 20 | import 'leaflet.markercluster/dist/leaflet.markercluster'; |
21 | 21 | |
22 | 22 | import { |
23 | - FormattedData, | |
24 | - MapSettings, | |
25 | - MarkerSettings, | |
26 | - PolygonSettings, | |
27 | - PolylineSettings, | |
28 | - UnitedMapSettings | |
23 | + FormattedData, | |
24 | + MapSettings, | |
25 | + MarkerSettings, | |
26 | + PolygonSettings, | |
27 | + PolylineSettings, | |
28 | + UnitedMapSettings | |
29 | 29 | } from './map-models'; |
30 | 30 | import { Marker } from './markers'; |
31 | 31 | import { BehaviorSubject, Observable } from 'rxjs'; |
... | ... | @@ -405,8 +405,8 @@ export default abstract class LeafletMap { |
405 | 405 | |
406 | 406 | updatePolygon(polyData: FormattedData, dataSources: FormattedData[], settings: PolygonSettings) { |
407 | 407 | this.ready$.subscribe(() => { |
408 | - const poly = this.polygons.get(polyData.datasource.entityName); | |
409 | - poly.updatePolygon(polyData.data, dataSources, settings); | |
408 | + const poly = this.polygons.get(polyData.$datasource.entityName); | |
409 | + poly.updatePolygon(polyData, dataSources, settings); | |
410 | 410 | }); |
411 | 411 | } |
412 | 412 | } | ... | ... |
... | ... | @@ -152,7 +152,7 @@ function parseTemplate(template: string, data: { $datasource?: Datasource, [key: |
152 | 152 | } |
153 | 153 | } |
154 | 154 | |
155 | - const value = data[label]; | |
155 | + const value = data[label] || ''; | |
156 | 156 | let textValue: string; |
157 | 157 | if (isNumber(value)) { |
158 | 158 | textValue = padValue(value, valDec); | ... | ... |
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | /// limitations under the License. |
15 | 15 | /// |
16 | 16 | |
17 | -import L, { LatLngExpression, LatLngTuple, LeafletMouseEvent } from 'leaflet'; | |
17 | +import L, { LatLngExpression, LeafletMouseEvent } from 'leaflet'; | |
18 | 18 | import { createTooltip, parseWithTranslation, safeExecute } from './maps-utils'; |
19 | 19 | import { FormattedData, PolygonSettings } from './map-models'; |
20 | 20 | |
... | ... | @@ -61,7 +61,7 @@ export class Polygon { |
61 | 61 | this.tooltip.setContent(parseWithTranslation.parseTemplate(pattern, data, true)); |
62 | 62 | } |
63 | 63 | |
64 | - updatePolygon(data: LatLngTuple[], dataSources: FormattedData[], settings: PolygonSettings) { | |
64 | + updatePolygon(data: FormattedData, dataSources: FormattedData[], settings: PolygonSettings) { | |
65 | 65 | this.data = data; |
66 | 66 | this.dataSources = dataSources; |
67 | 67 | this.leafletPoly.setLatLngs(data[this.settings.polygonKeyName]); | ... | ... |