@regionerne/gis-komponent 0.0.66 → 0.0.68
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.
|
@@ -1291,28 +1291,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
1291
1291
|
type: Input
|
|
1292
1292
|
}] } });
|
|
1293
1293
|
|
|
1294
|
-
// interface namedStyle {
|
|
1295
|
-
// styleName: string;
|
|
1296
|
-
// sldFeatureStyle: any;
|
|
1297
|
-
// }
|
|
1298
1294
|
class KomponentSettingsHelperService {
|
|
1299
1295
|
_httpClient = inject(HttpClient);
|
|
1300
1296
|
styles = {};
|
|
1301
|
-
// loadNamedStyleObjects(styleNames: string[], workspace: string, geoserver: GeoServer): Observable<namedStyle[]> {
|
|
1302
|
-
// const headerstring = `${geoserver.userName}:${geoserver.password}`;
|
|
1303
|
-
// const encoded = btoa(headerstring);
|
|
1304
|
-
// const headers = new HttpHeaders().set('Authorization', `Basic ${encoded}`);
|
|
1305
|
-
// const result$ = styleNames.map(styleName =>
|
|
1306
|
-
// this._httpClient.get(`${geoserver.url}/rest/workspaces/${workspace}/styles/${styleName}.sld`, { headers, responseType: 'text' })
|
|
1307
|
-
// .pipe(map(loadedStyle => {
|
|
1308
|
-
// const sldObject = SLDReader.Reader(loadedStyle);
|
|
1309
|
-
// const sldLayer = SLDReader.getLayer(sldObject);
|
|
1310
|
-
// const sldStyles = SLDReader.getStyle(sldLayer);
|
|
1311
|
-
// const sldFeatureStyle = sldStyles.featuretypestyles[0];
|
|
1312
|
-
// return { styleName, sldFeatureStyle } as namedStyle
|
|
1313
|
-
// })));
|
|
1314
|
-
// return combineLatest(result$);
|
|
1315
|
-
// }
|
|
1316
1297
|
_getSldStyleObject$(styleName, workspace, geoserver) {
|
|
1317
1298
|
return this.styles[styleName] ? of(this.styles[styleName]) :
|
|
1318
1299
|
this._loadStyleFromGeoServer$(styleName, workspace, geoserver)
|
|
@@ -1336,7 +1317,14 @@ class KomponentSettingsHelperService {
|
|
|
1336
1317
|
getStyle(styleName, workspace, geoserver, styleType) {
|
|
1337
1318
|
return this._getSldStyleObject$(styleName, workspace, geoserver)
|
|
1338
1319
|
.pipe(map(loadedStyle => {
|
|
1339
|
-
|
|
1320
|
+
// I always create the style function but only use it if I cant create a style object.
|
|
1321
|
+
const func = SLDReader.createOlStyleFunction(loadedStyle);
|
|
1322
|
+
try {
|
|
1323
|
+
return SLDReader.createOlStyle(loadedStyle.rules[0], styleType);
|
|
1324
|
+
}
|
|
1325
|
+
catch {
|
|
1326
|
+
return func;
|
|
1327
|
+
}
|
|
1340
1328
|
}));
|
|
1341
1329
|
}
|
|
1342
1330
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KomponentSettingsHelperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -4120,11 +4108,11 @@ class ToolboxComponent {
|
|
|
4120
4108
|
}
|
|
4121
4109
|
}
|
|
4122
4110
|
setNewMapDimensions() {
|
|
4123
|
-
this._layoutService.mapResizedSubject.next(true);
|
|
4124
4111
|
this.map.getTargetElement().style.width = this.mapWidth + 'px';
|
|
4125
4112
|
this.map.getTargetElement().style.height = this.mapHeight + 'px';
|
|
4126
4113
|
this.map.updateSize();
|
|
4127
4114
|
this._layoutService.map = this.map;
|
|
4115
|
+
this._layoutService.mapResizedSubject.next(true);
|
|
4128
4116
|
}
|
|
4129
4117
|
doPrint() {
|
|
4130
4118
|
let htmlElement = this.map.getViewport();
|
|
@@ -4863,6 +4851,9 @@ class LegendsListComponent {
|
|
|
4863
4851
|
this._layerHelperService.activeLayersChanged.subscribe(() => this._setFilteredLegends().subscribe(result => this.filteredLayersDetailed = result));
|
|
4864
4852
|
}
|
|
4865
4853
|
ngOnChanges(changes) {
|
|
4854
|
+
this._layoutService.mapResizedSubject.subscribe(() => {
|
|
4855
|
+
this.dragPosition = this._layoutService.keepWidgetInViewPort(this.dragPosition, this.POSITION_STORAGE_KEY, this.collapsed ? WidgetConstants.collapsedHeight : WidgetConstants.legendsHeight, this.collapsed ? WidgetConstants.collapsedWidth : WidgetConstants.legendsWidth);
|
|
4856
|
+
});
|
|
4866
4857
|
if (changes['profile'] && this.profile) {
|
|
4867
4858
|
this.collapsed = this.profile.legendsListFolded;
|
|
4868
4859
|
this._loadPosition(this.collapsed);
|
|
@@ -5036,8 +5027,8 @@ class FeatureLoaderService {
|
|
|
5036
5027
|
next: styles => {
|
|
5037
5028
|
styles.forEach((s, i) => {
|
|
5038
5029
|
const feature = allTheFeatures[i];
|
|
5039
|
-
if (feature.get('showlabelfrom')) {
|
|
5040
|
-
const styles =
|
|
5030
|
+
if (feature.get('showlabelfrom') && s) {
|
|
5031
|
+
const styles = [s];
|
|
5041
5032
|
const textStyle = new Text({
|
|
5042
5033
|
font: '14px Calibri,sans-serif',
|
|
5043
5034
|
fill: new Fill({ color: '#000' }),
|