Page MenuHomePhabricator

Kartotherian autoposition produces usless output on empty geodata
Closed, ResolvedPublic

Description

Auto position relies on valid geodata to set values that make sense. If the retrieval of the geodata fails autoposition returns useless values and the map might seem completely broken. We should set a default to at least show the map.

When you set the lat and lan values to autoposition in a mapframe by adding an a for both, the frame tries to set a center that makes sense to the features that might be added in the geojson. So Kartotherian tries to do that, by passing the geojson data retrieved via the mapdata loader into the autoPosition.js module, that then will set that a center point by looking at the features in the geojson.

If the geojson is empty, these lat and lon results are not valid and further working with them leads to an error and a broken map.

Solution:

  • If the autopostion fails due to missing data, the default will be 0.0 0.0
  • If autozoom is also missing show the whole world
  • If zoom is set, work the the zoom level set

Event Timeline

I'm afraid I need more details to be able to work on this.

Change 833796 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/services/kartotherian@master] [POC] Don't fall back to the entire world in case of an error

https://gerrit.wikimedia.org/r/833796

Change 888723 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/services/kartotherian@master] Autoposition: Fallback to zero lat lon defaults and minzoom

https://gerrit.wikimedia.org/r/888723

Change 833796 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/services/kartotherian@master] [POC] Don't fall back to the entire world in case of an error

Reason:

Solved in I46f9721.

https://gerrit.wikimedia.org/r/833796

Change 888723 merged by jenkins-bot:

[mediawiki/services/kartotherian@master] Autoposition: Fallback to zero lat lon defaults and minzoom

https://gerrit.wikimedia.org/r/888723

thiemowmde claimed this task.