maplibre / maputnik

An open source visual editor for the 'MapLibre Style Specification'
https://www.maplibre.org/maputnik
MIT License
2.06k stars 394 forks source link

Notify user if map breaks on font 404 #651

Open pathmapper opened 4 years ago

pathmapper commented 4 years ago

Follow-up on https://github.com/maputnik/editor/issues/395#issuecomment-428962491:

Currently, if map breaks on font 404, there is no notification for the user, neither in the browser console nor in the UI.

Steps to reproduce:

  1. Use https://maputnik.github.io/releases/v1.7.0-beta2/#14.15/51.55152/0.00584
  2. Unzip and open the following style: test_failing.zip

Working version of the style: test.zip

orangemug commented 4 years ago

@pathmapper this looks to be an issue with mapbox-gl, although would need to confirm that outside of Maputnik. As soon as http requests for fonts 404 the map breaks. So in the test style you provided at zoom level 13 it renders the buildings and as soon as you enter zoom level 14 it'll stop rendering the buildings.

It's not a regression and exists in https://maputnik.github.io/editor so I suggest we fix in a patch release post v1.7.0

pathmapper commented 4 years ago

@orangemug did some testing outside of Maputnik and it appears that only affected tiles are not rendered when a request for glyph fails with a 404 (for the test case above all visible tiles were affected, so it looked like the whole map broke).

Opened an upstream issue: https://github.com/mapbox/mapbox-gl-js/issues/9546

There is also a feature request regarding an event when a request for a glyph range PBF returns a bad response, which would be useful to notify the user: https://github.com/mapbox/mapbox-gl-js/issues/9528

I suggest we fix in a patch release post v1.7.0

:+1:

jimmyrocks commented 3 years ago

I ran into a related issue when I was loading glyphs coming from ArcGIS Online. The issue was only in the react layer, and I was able to patch this with some quick and dirty JS changes to the JSX files (here). Has anyone else run into a similar issue?

1ec5 commented 4 weeks ago

With maplibre/maplibre-gl-js#4564, GL JS will attempt to fall back to a locally rendered glyph and warn about the missing PBF instead of crashing. I don’t think there will be an event for Maputnik to hook into, though.