Skip to content

Commit 3a11156

Browse files
committed
fix: geospatial map showing incorrect controls
1 parent 78b4fe2 commit 3a11156

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

libs/safe/src/lib/components/geospatial-map/geospatial-map.component.ts

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,27 @@ export class GeospatialMapComponent
6868
public geoForm!: ReturnType<typeof this.buildGeoForm>;
6969

7070
// === MAP ===
71-
public mapSettings!: MapConstructorSettings;
71+
public mapSettings: MapConstructorSettings = {
72+
initialState: {
73+
viewpoint: {
74+
center: {
75+
latitude: 0,
76+
longitude: 0,
77+
},
78+
zoom: 2,
79+
},
80+
},
81+
pmIgnore: false,
82+
worldCopyJump: true,
83+
controls: {
84+
timedimension: false,
85+
download: false,
86+
legend: false,
87+
measure: true,
88+
layer: false,
89+
search: true,
90+
},
91+
};
7292

7393
// Layer to edit
7494
public selectedLayer: any;
@@ -109,27 +129,6 @@ export class GeospatialMapComponent
109129
}
110130

111131
ngAfterViewInit(): void {
112-
this.mapSettings = {
113-
initialState: {
114-
viewpoint: {
115-
center: {
116-
latitude: 0,
117-
longitude: 0,
118-
},
119-
zoom: 2,
120-
},
121-
},
122-
pmIgnore: false,
123-
worldCopyJump: true,
124-
controls: {
125-
timedimension: false,
126-
download: false,
127-
legend: false,
128-
measure: true,
129-
layer: false,
130-
search: true,
131-
},
132-
};
133132
this.mapComponent?.map.pm.addControls(this.controls);
134133
this.setUpPmListeners();
135134
this.setDataLayers();

0 commit comments

Comments
 (0)