[openstreetmap/openstreetmap-website] Add OpenMapTiles vector map (PR #4042)

Anton Khorev notifications at github.com
Sun Feb 9 00:04:01 UTC 2025


@AntonKhorev commented on this pull request.



> +    function update3dMapUrl() {
+      var el = document.getElementById("terrain_3d_url");
+
+      if (el) {
+        var c = map.getCenter();
+        var zoom = map.getZoom() - 1;
+        var precision = Math.ceil(((zoom * Math.LN2) + Math.log(256 / 360)) / Math.LN10);
+
+        el.href = el.dataset.hrefTemplate
+          .replace("{lang}", I18n.locale.replace(/-.*/, ""))
+          .replace("{pos}", zoom + "/" + c.lat.toFixed(precision) + "/" + c.lng.toFixed(precision) + "/30.00/60.00");
+      }
+    }
+
+    map._update3dMapUrl = update3dMapUrl;
+    setTimeout(update3dMapUrl);
+    map.on("moveend", update3dMapUrl);

You don't need any of this added in this commit if you remove it in the next one.

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

Message ID: <openstreetmap/openstreetmap-website/pull/4042/review/2604076142 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250208/0ed9a54e/attachment.htm>


More information about the rails-dev mailing list