diff --git a/assets/layers/note/note.json b/assets/layers/note/note.json index 4cb47e53e9..fba8654ced 100644 --- a/assets/layers/note/note.json +++ b/assets/layers/note/note.json @@ -28,7 +28,7 @@ "_first_user_id:=get(feat)('comments')[0].uid", "_is_import_note:=(() => {const lines = feat.properties['_first_comment'].split('\\n'); const matchesMapCompleteURL = lines.map(l => l.match(\".*https://mapcomplete.\\(osm.be|org\\)/\\([a-zA-Z_-]+\\)\\(.html\\).*#import\")); const matchedIndexes = matchesMapCompleteURL.map((doesMatch, i) => [doesMatch !== null, i]).filter(v => v[0]).map(v => v[1]); return matchedIndexes[0] })()" ], - "isShown": "_total_comments>0", + "isShown": "comments!=[]", "minzoom": 7, "title": { "render": { diff --git a/src/Models/ThemeViewState/WithSelectedElementState.ts b/src/Models/ThemeViewState/WithSelectedElementState.ts index f755c05906..2e1e6d45d2 100644 --- a/src/Models/ThemeViewState/WithSelectedElementState.ts +++ b/src/Models/ThemeViewState/WithSelectedElementState.ts @@ -41,7 +41,10 @@ export class WithSelectedElementState extends UserMapFeatureswitchState { const [osm_type, osm_id] = selected.properties.id.split("/") const [lon, lat] = GeoOperations.centerpointCoordinates(selected) const layer = this.theme.getMatchingLayer(selected.properties) - if (!layer.isNormal()) { + if (!layer) { + return + } + if (!layer?.isNormal()) { return }