Skip to content

Commit

Permalink
Ensure WMS layer name is string
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Feb 11, 2025
1 parent 4df2cc1 commit 80ffb81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/ServiceLayerUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,15 @@ const ServiceLayerUtils = {
} catch (e) {
/* pass */
}
const styles = MiscUtils.ensureArray(layer.Style).reduce((res, entry) => ({...res, [entry.Name]: entry.Title}), {});
const styles = MiscUtils.ensureArray(layer.Style).reduce((res, entry) => ({...res, [String(entry.Name)]: entry.Title}), {});
const style = styles.default ? 'default' : (Object.keys(styles)[0] ?? '');
const attribution = {
Title: layer.Attribution?.Title,
OnlineResource: layer.Attribution?.OnlineResource?.href
};
return {
type: "wms",
name: layer.Name,
name: String(layer.Name),
title: layer.Title,
abstract: layer.Abstract,
attribution: attribution,
Expand Down

0 comments on commit 80ffb81

Please sign in to comment.