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

<hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4149#discussion_r1291596628">app/assets/javascripts/user.js</a>:</p>
<pre style='color:#555'>> +    $("#home_delete").prop("hidden", !location);
+    $("#home_undelete").prop("hidden", !(!location && deleted_lat && deleted_lon));
+    if (location) {
+      marker.setLatLng([lat, lon]);
+      marker.addTo(map);
+      map.panTo([lat, lon]);
+    } else {
+      marker.removeFrom(map);
+    }
+  }
+
+  function isCloseEnoughToMapCenter(location) {
+    var inputPt = map.latLngToContainerPoint(location),
+        centerPt = map.latLngToContainerPoint(map.getCenter());
+
+    return Math.abs(inputPt.x - centerPt.x) + Math.abs(inputPt.y - centerPt.y) < 10;
</pre>
<p dir="auto">Would <code class="notranslate">distanceTo</code> work here to get the distance between two points? or just use <code class="notranslate">map.getBounds().contains(location)</code> to see if the location is already visible?</p>

<hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4149#discussion_r1291598538">app/assets/javascripts/user.js</a>:</p>
<pre style='color:#555'>> -          var zoom = map.getZoom(),
-              precision = OSM.zoomPrecision(zoom),
-              location = e.latlng.wrap();
+        if (!$("#updatehome").is(":checked")) return;
+
+        var zoom = map.getZoom(),
+            precision = OSM.zoomPrecision(zoom),
+            location = e.latlng.wrap();
+
+        $("#home_lat").val(location.lat.toFixed(precision));
+        $("#home_lon").val(location.lng.toFixed(precision));
+
+        deleted_lat = null;
+        deleted_lon = null;
+        respondToHomeUpdate();
+      }).on("moveend", function () {
</pre>
<p dir="auto">Why are we using a <code class="notranslate">moveend</code> event to detect typed changes in the input fields? At least I assume that is what this is trying to detect given we already have a click handler....</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/4149#pullrequestreview-1574084723">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMJWBXBO6WWQQKG6KLXUZRJRANCNFSM6AAAAAA3K2Z2DQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLPUYGFGTOVLO36Y6ILXUZRJRA5CNFSM6AAAAAA3K2Z2DSWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTS52KQHG.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/4149/review/1574084723</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/4149#pullrequestreview-1574084723",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4149#pullrequestreview-1574084723",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>