After fetching a vector tile from Cassandra and before rendering it, Kartotherian needs to process the tile to show labels in the correct language. This means modifying each feature that has a name_ field (containing a JSON blob of labels in all languages), and overwriting its name field with the right language. How it knows what the right language to select is is a combination of a URL parameter that needs to be propagated and a fallback chain, but those are separate tasks.
Description
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | None | T43307 Alow comparison with old revisions while editing an old version of a page | |||
Resolved | TheDJ | T70008 PDF-related improvements needed at Wikivoyage, especially for dynamic maps | |||
Declined | Feature | None | T64572 Media Viewer and location map overlays | ||
Resolved | Etonkovidova | T52714 VisualEditor: Location map template does not display correctly | |||
Declined | None | T32702 PDF export extension problem with <div style="position:> and any location templates | |||
Declined | None | T92535 Exclude {{location map}} images from PageImages | |||
Duplicate | None | T169507 Fix vector map visualisations once the user clicks them on an article (red dot and label missing) | |||
Resolved | TheDJ | T120809 Generate location maps dynamically, producing actual images | |||
Resolved | SBisson | T112948 All map location names should be in the user's language | |||
Invalid | None | T187595 Implement a language selection processing step for vector tiles |
Event Timeline
Kartotherian's babel does exactly this, but it needs to be configured with the right fallback rules.
@Yurik Could you advise on how exactly to configure Babel's json2tags:// and babel:// in the production sources config file? Thanks!
@SBisson I wrote some docs in https://github.com/kartotherian/babel#usage-examples -- I think prod source configs should follow that pattern. The tilerator config should use the json2tags as part of the tile generation pipeline - converting one giant json string into proper pbf tags. The babel should be used in kartotherian config, to convert the tile on the fly for the user. I would recommend using a language map option with it - to create a proper language fallback map.
@Yurik that makes sense. I guess I was hoping to take a shortcut and make it work with kartotherian only as a first step. This is how I am trying to hook things up:
# Generates vtiles from database genraw: public: true formats: [pbf] uri: bridge:// xml: npm: ["@kartotherian/osm-bright-source", "data.xml"] # expand name_ attributes into individual tags gen: uri: json2tags:// params: source: {ref: genraw} tag: name # set name tag based on name_* attributes genviewraw: uri: babel:// params: source: {ref: gen} tag: name languageMap: fr: ['es', 'en'] # View tiles as generated directly from the database. Don't view zoom0-5 genview: public: true formats: [png,json,headers,svg,jpeg] scales: [1.3, 1.5, 2, 2.6, 3] static: true maxheight: 2048 maxwidth: 2048 uri: vector:// xml: loader: "@kartotherian/osm-bright-style" xmlSetParams: source: {ref: genviewraw}
Does make sense conceptually? Do you see anything obviously wrong?
I get a tile back but it never contains any label. I'm not sure where to look to start troubleshooting...
That seems correct. Try looking at the tile at every state, see if labels are there initially, and if so, when does it disappears