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

Minh Nguyễn notifications at github.com
Sun Feb 8 22:28:52 UTC 2026


@1ec5 commented on this pull request.



> @@ -7,6 +7,31 @@ 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) {
+    const errorDiv = document.createElement("div");
+    errorDiv.className = "maplibre-error";
+    errorDiv.setAttribute("data-compact-message", OSM.i18n.t("javascripts.map.webgl_error.compact_message"));
+    errorDiv.innerHTML = `
+      <p class="d-none d-md-block">
+        ${OSM.i18n.t("javascripts.map.webgl_error.description", { browser_does_not_support_webgl: `<b>${OSM.i18n.t("javascripts.map.webgl_error.browser_does_not_support_webgl")}</b>` })}
+      </p>
+      <p>
+        <a class="btn btn-link" href="https://wiki.openstreetmap.org/wiki/Using_OpenStreetMap/Why_is_WebGL_Required" target="_blank">

Thank you for putting together this article! This is quite fine for OHM. But the URL still needs to be localizable, because the article will get translated into other languages, each at a slightly different URL.

Incidentally, I renamed the article to  https://wiki.openstreetmap.org/wiki/This_map_requires_WebGL So that the URL will be more understandable to end users.

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

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


More information about the rails-dev mailing list