@regionerne/gis-komponent 0.0.67 → 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 });
|
|
@@ -5039,8 +5027,8 @@ class FeatureLoaderService {
|
|
|
5039
5027
|
next: styles => {
|
|
5040
5028
|
styles.forEach((s, i) => {
|
|
5041
5029
|
const feature = allTheFeatures[i];
|
|
5042
|
-
if (feature.get('showlabelfrom')) {
|
|
5043
|
-
const styles =
|
|
5030
|
+
if (feature.get('showlabelfrom') && s) {
|
|
5031
|
+
const styles = [s];
|
|
5044
5032
|
const textStyle = new Text({
|
|
5045
5033
|
font: '14px Calibri,sans-serif',
|
|
5046
5034
|
fill: new Fill({ color: '#000' }),
|