Page MenuHomePhabricator

Inline Kartographer mapframes: Take precision into account
Open, Needs TriagePublic


After T184933: Display map for geocoordinate statements we now have small inline maps which are obtained using Kartographer mapframes, but as @TheDJ pointed out in T184933#4812900:

Currently these are being generated by just creating a GeoJSON point from the value (in CachingKartographerEmbeddingHandler::getWikiText): "geometry": { "type": "Point", "coordinates": [' . $value->getLongitude() . ', ' . $value->getLatitude() . '] }, (where $value is a [[|GlobeCoordinateValue]]). This currently doesn't take the precision into account at all (also not for setting the map's zoom, which is hard coded at 13).

We should probably base both the zoom and the geometry on the precision of the GlobeCoordinateValue. For this we should probably stop using GeoJSON Point, but rather use Polygon with the min/max Lat/Long values within the precision (if Kartographer supports this)?

Is there some other/ nicer/more correct way to do this? How do we compute the zoom from the precision?