<p></p>
<p><b>@tomhughes</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5597#discussion_r1939883273">app/assets/javascripts/edit/id.js.erb</a>:</p>
<pre style='color:#555'>> -
-    if (mapParams.object) {
-      params.set("id", mapParams.object.type + "/" + mapParams.object.id);
-      mapParams = OSM.parseHash(location.hash);
-      if (mapParams.center) {
-        params.set("map", mapParams.zoom + "/" + mapParams.center.lat + "/" + mapParams.center.lng);
-      }
-    } else if (id.data("lat") && id.data("lon")) {
-      params.set("map", "16/" + id.data("lat") + "/" + id.data("lon"));
-    } else {
-      params.set("map", (mapParams.zoom || 17) + "/" + mapParams.lat + "/" + mapParams.lon);
-    }
+  if (id.data("configured") === false) {
+    alert(I18n.t("site.edit.id_not_configured"));
+    return;
+  }
</pre>
<p dir="auto">I'm not sure I really understand why making this an early return is an improvement? In general I'm not keen on early/multiple returns though I've mostly been holding back on that. If we're going to have it then I'd suggest a blank line afterwards at least.</p>

<hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5597#discussion_r1939888960">app/assets/javascripts/edit/id.js.erb</a>:</p>
<pre style='color:#555'>>  
-    if (id.data("gpx")) {
-      params.set("gpx", id.data("gpx"));
-    } else if (hashParams.gpx) {
-      params.set("gpx", hashParams.gpx);
-    }
+  params.set("map", [
+    (mapParams.object && hashArgs.center && hashArgs.zoom) || (id.data("lat") && id.data("lon") && 16) || mapParams.zoom || 17,
+    (mapParams.object && hashArgs.center?.lat) || (id.data("lon") && id.data("lat")) || mapParams.lat,
+    (mapParams.object && hashArgs.center?.lng) || (id.data("lat") && id.data("lon")) || mapParams.lon
+  ].join("/"));
</pre>
<p dir="auto">I'm sure this is all very clever, but it is better than what we had before? Just trying to work out if it's actually doing the same thing is making my head hurt and it seems to me at least to be much harder to reason about and figure out what the supported parameter combinations are and how they map to a location to be passed to iD.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5597#pullrequestreview-2590765335">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLPYHLDSMYHRFIKMXWL2N645TAVCNFSM6AAAAABWMGSMVOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKOJQG43DKMZTGU">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLIHHMMUTEC5CF7FFZT2N645TA5CNFSM6AAAAABWMGSMVOWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTU2NPYRO.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5597/review/2590765335</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5597#pullrequestreview-2590765335",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5597#pullrequestreview-2590765335",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>