diff --git a/src/config/ch.sbb.netzentwicklung/index.js b/src/config/ch.sbb.netzentwicklung/index.js index cfbb07382..d35d06982 100644 --- a/src/config/ch.sbb.netzentwicklung/index.js +++ b/src/config/ch.sbb.netzentwicklung/index.js @@ -1,4 +1,3 @@ -import { Layer } from 'mobility-toolbox-js/ol'; import TrafimageMapboxLayer from '../../layers/TrafimageMapboxLayer'; import MapboxStyleLayer from '../../layers/MapboxStyleLayer'; import { kilometrageLayer } from '../ch.sbb.infrastruktur'; @@ -47,12 +46,12 @@ export const netzentwicklungStrategischLayer = new MapboxStyleLayer({ }, }); +// Not used for now but may be reinserted export const netzentwicklungSkPlanerByRegionLayer = new MapboxStyleLayer({ name: 'ch.sbb.netzentwicklung.sk_planer.by_region', mapboxLayer: netzentwicklungDataLayer, visible: true, styleLayersFilter: ({ id }) => /sk_planer$/.test(id), - group: 'netzentwicklung.sk_planer', properties: { isQueryable: true, popupComponent: 'NetzentwicklungPopup', @@ -63,11 +62,11 @@ export const netzentwicklungSkPlanerByRegionLayer = new MapboxStyleLayer({ }, }); -export const netzentwicklungSkPlanerBySkplanerLayer = new MapboxStyleLayer({ - name: 'ch.sbb.netzentwicklung.sk_planer.by_person', +export const netzentwicklungSkPlanerLayer = new MapboxStyleLayer({ + name: 'ch.sbb.netzentwicklung.sk_planer', mapboxLayer: netzentwicklungDataLayer, styleLayersFilter: ({ id }) => /sk_planer.by_person/.test(id), - group: 'netzentwicklung.sk_planer', + group: 'netzentwicklung', properties: { isQueryable: true, popupComponent: 'NetzentwicklungPopup', @@ -77,22 +76,6 @@ export const netzentwicklungSkPlanerBySkplanerLayer = new MapboxStyleLayer({ }, }); -export const netzentwicklungSkPlanerLayer = new Layer({ - name: 'ch.sbb.netzentwicklung.sk_planer', - mapboxLayer: netzentwicklungDataLayer, - visible: true, - styleLayersFilter: ({ id }) => /sk_planer$/.test(id), - group: 'netzentwicklung', - children: [ - netzentwicklungSkPlanerBySkplanerLayer, - netzentwicklungSkPlanerByRegionLayer, - ], - properties: { - hasInfos: true, - layerInfoComponent: 'NetzentwicklungLayerInfo', - }, -}); - export default [ kilometrageLayer, netzentwicklungDataLayer, diff --git a/src/popups/NetzentwicklungPopup/NetzentwicklungPopup.js b/src/popups/NetzentwicklungPopup/NetzentwicklungPopup.js index 89901b437..bfeeca6d1 100644 --- a/src/popups/NetzentwicklungPopup/NetzentwicklungPopup.js +++ b/src/popups/NetzentwicklungPopup/NetzentwicklungPopup.js @@ -68,7 +68,7 @@ const renderRoleCard = (rolle, classes, t) => { const NetzentwicklungPopup = ({ feature, layer, t }) => { const classes = useStyles(); - const isSkPlanerByName = /sk_planer.by_person/.test(layer.key); + const isSkPlanerByName = /sk_planer/.test(layer.key); const rollen = JSON.parse(feature.get('rollen') || '[]').filter((r) => ['Alle', layer.properties.netzentwicklungRoleType].includes(r.typ), ); @@ -76,7 +76,7 @@ const NetzentwicklungPopup = ({ feature, layer, t }) => { (r) => ['Alle', layer.properties.netzentwicklungRoleType].includes(r.typ), ); const mbFeature = feature.get('mapboxFeature'); - let regionColor = 'transparent'; + let color = 'transparent'; if (mbFeature) { const { r, g, b, a } = mbFeature.layer.paint['line-color'] || { r: 1, @@ -84,7 +84,7 @@ const NetzentwicklungPopup = ({ feature, layer, t }) => { b: 1, a: 1, }; - regionColor = `rgba(${r * 255},${g * 255},${b * 255},${a})`; + color = `rgba(${r * 255},${g * 255},${b * 255},${a})`; } useEffect(() => { @@ -98,7 +98,7 @@ const NetzentwicklungPopup = ({ feature, layer, t }) => {