[openstreetmap/openstreetmap-website] Delete button in Home location section of user profiles (PR #4149)

Anton Khorev notifications at github.com
Fri Aug 11 18:48:56 UTC 2023


@AntonKhorev commented on this pull request.



> +    $("#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;

Yes, `distanceTo` would work. Updated.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4149#discussion_r1291680535
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4149/review/1574221548 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230811/b52b3aa2/attachment.htm>


More information about the rails-dev mailing list