Skip to content

Open Infrastructure Map, a view of infrastructure data in OpenStreetMap

Fix OSM links for most objects

Russ Garrettf91c695ac9d7
diff --git a/src/infopopup.js b/src/infopopup.js
index 63c3659..e020f53 100644
--- a/src/infopopup.js
+++ b/src/infopopup.js
@@ -136,17 +136,19 @@ class InfoPopup {
let links_container = el('div');
- mount(
- links_container,
- el('a', el('div.ext_link.osm_link'), {
- href: this.osmLink(
- feature.properties['gid'],
- feature.properties['is_node'],
- ),
- target: '_blank',
- title: 'OpenStreetMap',
- }),
- );
+ if (feature.id) {
+ mount(
+ links_container,
+ el('a', el('div.ext_link.osm_link'), {
+ href: this.osmLink(
+ feature.id,
+ feature.properties['is_node'],
+ ),
+ target: '_blank',
+ title: 'OpenStreetMap',
+ }),
+ );
+ }
let wikidata_div = null;
if (feature.properties['wikidata']) {