@tomhughes 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 wonder if we really need to have special handling for our own HTML page 
failing?

> @@ -212,6 +212,7 @@
   resource :layers_pane, :path => "/panes/layers", :only => :show
   resource :legend_pane, :path => "/panes/legend", :only => :show
   resource :share_pane, :path => "/panes/share", :only => :show
+  resource :maplibre_pane, :path => "/panes/maplibre/webgl_error", :only => 
:show

I don't really like having this URL not map to the resource name in the same 
way as the others, and it strikes me that "your browser doesn't support webgl" 
isn't really a maplibre thing as such should this just be something like:

```suggestion
  resource :webgl_error_pane, :path => "/panes/webgl_error", :only => :show
```

or

```suggestion
  resource :nowebgl_pane, :path => "/panes/nowebgl", :only => :show
```

> +    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"));

What sort of problems did you have with turbo?

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

Message ID: 
<openstreetmap/openstreetmap-website/pull/6782/review/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to