Page MenuHomePhabricator

Present error to end user when map is incomplete
Open, Needs TriagePublic

Description

Sometimes, external resources might fail to load when opening a map (See T257872). We might want to indicate to the user that the map is incomplete / has encountered a problem. Currently we do not rly have a UI convention for this. (use mw.notify ?)

Event Timeline

One (maybe pretty wild) idea for the start could be rendering error text as svg from kartotherian and showing that svg where the map would be rendered.

awight subscribed.

This use case is coming up more often as we tighten up error handling. In T305433: Overview of the various ways that maps can be broken and if/how error messages could be shown we left a note on "Geoshapes and markers missing" suggesting that we would like to annotate the map with a localized error message. At other times, we seem to be leaning towards "failing open" or rendering the map despite some of the intended annotations not loading.

I'd like to resolve this question and either write a task to implement the nicer error handling, or document that we want to leave the map incomplete.

Here is a little example for a map that can't display any meaningful data. Auto centering and zooming fail as well and the whole world is shown. Unfortunately GeoJSON doesn't allow us to render text. The best we can do (with GeoJSON alone) is e.g. a red triangle that displays the error in a popup with a click.

<mapframe width="300" height="300">
{
  "type": "Feature",
  "properties": {
    "description": "Error message goes here",
    "fill": "#f00",
    "fill-opacity": 0.5,
    "stroke-width": 0
  },
  "geometry": {
    "type": "Polygon",
    "coordinates": [[[0,83],[180,-83],[-180,-83],[0,83]]]
  }
}
</mapframe>

Screenshot from 2022-09-21 15-00-01.png (321×349 px, 36 KB)