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