[openstreetmap/openstreetmap-website] Add Human facing error messages when users without WebGL use (PR #6782)

Marwin Hochfelsner notifications at github.com
Thu Feb 26 10:24:55 UTC 2026


@hlfan commented on this pull request.



> @@ -6,6 +6,18 @@ maplibregl.Map.prototype._getUIString = function (key) {
   return OSM.i18n.t(`javascripts.map.${snakeCaseKey}`);
 };
 
+OSM.MapLibre.showWebGLError = function (container) {
+  const containerElement =
+    typeof container === "string" ? document.getElementById(container) : container;
+
+  if (containerElement) {
+    fetch("/panes/maplibre/webgl_error")
+      .then(response => response.text())
+      .then(html => containerElement.innerHTML = html)
+      .catch(() => containerElement.innerHTML = OSM.i18n.t("javascripts.map.webgl_error.webgl_is_required_for_this_map"));

I just mean the moved map looks like this when offline:

<img src="https://github.com/user-attachments/assets/dfc9bfab-a6a8-4895-8e26-2bd66ea23e2f" />

So the fallback here seems overkill compared to that.
I think for most browser map apps, the offline capability can be disregarded.

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

Message ID: <openstreetmap/openstreetmap-website/pull/6782/review/3859960763 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260226/ebef2cb1/attachment.htm>


More information about the rails-dev mailing list