Maps are called usually by the <maplink> and <mapframe> extension tags. In practice these tags are not used directly but are called in Lua scripts as it is done for instance by the module https://en.wikivoyage.org/wiki/Module:Map. Unfortunately the expensive frame:extensionTag(tag, geojson, tagArgs) has to be used to convert the data into an extension tag.
As noted in T189409 calling <maplink> via Lua script can take several hundreds of ms. For example, in https://de.wikivoyage.org/wiki/Halle_%28Saale%29 frame:extensionTag is called about 240 times which takes about 1500 ms.
Therefore, I propose a Scribunto extension library at least with the following functions:
- mw.kartographer.maplink( args, geoJson )
- mw.kartographer.mapframe( args, geoJson )
args is an array containing the tag parameters -- same as for the extension tags --, and geoJson is either a JSON array or a JSON-encoded string noted between start and end tag.