]> git.openstreetmap.org Git - nominatim-ui.git/commitdiff
DetailsLink: use place_id if place does not have osmtype,id
authormarc tobias <mtmail@gmx.net>
Fri, 19 Feb 2021 22:42:47 +0000 (23:42 +0100)
committermarc tobias <mtmail@gmx.net>
Fri, 19 Feb 2021 22:42:47 +0000 (23:42 +0100)
src/components/DetailsLink.svelte

index fbeb4f1a03ddcb577cbfabeff8f801885ae44122..d91407945207b2399f25132b7bfb0bd003663b5c 100644 (file)
   $: {
     let new_params = new URLSearchParams();
 
-    if (feature !== null && feature.osm_type) {
-      if (feature.osm_type.length === 1) {
-        new_params.set('osmtype', feature.osm_type);
-      } else {
-        new_params.set('osmtype', formatShortOSMType(feature.osm_type));
-      }
-
-      new_params.set('osmid', feature.osm_id);
-
-      if (feature.class) {
-        new_params.set('class', feature.class);
-      } else if (feature.category) {
-        new_params.set('class', feature.category);
+    if (feature !== null) {
+      if (feature.osm_type) {
+        if (feature.osm_type.length === 1) {
+          new_params.set('osmtype', feature.osm_type);
+        } else {
+          new_params.set('osmtype', formatShortOSMType(feature.osm_type));
+        }
+
+        new_params.set('osmid', feature.osm_id);
+
+        if (feature.class) {
+          new_params.set('class', feature.class);
+        } else if (feature.category) {
+          new_params.set('class', feature.category);
+        }
+      } else if (feature.place_id) {
+        new_params.set('place_id', feature.place_id);
       }
     }
-
     url_params = new_params;
   }