Topic on Help talk:Extension:Kartographer

simpler mapframe syntax (as a special namespace/interwiki prefix)

2
Summary by Trizek (WMF)
Verdy p (talkcontribs)

Is it possible to support mapframes using a syntax similar to images. Compare:

[[File:Example en.svg|frame|right|200x200px]]

and

<mapframe width="200" height="200" zoom="13" longitude="-122.3995399" latitude="37.8103264" align="right">{optional SPARQL query}</mapframe>

Why not just:

[[Mapframe:-122.3995399/37.8103264/13|{optional SPARQL query}|frame|right|200x200px]]

This allows reusing the syntax of images, and easy replacement, without the overlong XML-like syntax, just need to replace "File:name" by "Mapframe:x/y/z". This uses the common notation "x/y/z" used with OSM rendering tools or in URLs, without needing to name paramters, as these 3 values are always required (or possibly the missing "/z" can also take a default value such as "/13", suitable for frequent use to locate cities in their district and basic roads).

(we could still add other options with "*=*" parameters, like in images, such as a capotion, or alt-text, or parameters for adding/removing optional navigation buttons, or specifying a lang=* parameter if we want a precise language or its fallbacks). That wiki extension would also support fallback rendering as a single image thumbnail (e.g. using preferences, or browser capabilities if they can't use javascript), by adding a new media type plugin to the thumbail generator.

Like images, there should be coherent default sizes also matching user preferences. This would make replacing static images by mapframes more easily (warning! we should have the same kind of decorations with identical same metrics for the framing). Text-only rendering would render the caption, the map could then be made partly accessible with the description.

As well:

[[:Mapframe:-122.3995399/37.8103264/13|{optional SPARQL query}|inline text]]

Would only render a link, going to a new page with a full screen map browser, optionally with additional sidebar or metadata and info (this uses the common notation "x/y/z" used with OSM rendering tools or in URLs, without needing to name parameters, as these 3 values are always required, so it's easy to copy-paste the URL part from any OSM renderer webpage).

With a prefered language on the map, we can also use the common language code prefix just after "mapframe:" and before coordinates.

[[Mapframe:fr:-122.3995399/37.8103264/13|{optional SPARQL query}|frame|right|200x200px|alt=alt text|caption]]
[[:Mapframe:fr:-122.3995399/37.8103264/13|{optional SPARQL query}|inline text]]

With several alternate renderings (e.g. with a "gray" style, each tile having its own TMS/WMS server identified by a symbolic short name name, can be acting like an interwiki selects a foreign wiki server, and may support alternate languages; the default style would be configured on the wiki according to its own needs, this configuration including internally a possible "referer access key" when needed, when it generates the URL and GET POST parameters for HTTP(S) requests, or other user session cookies):

[[Mapframe:gray:-122.3995399/37.8103264/13|{optional SPARQL query}|frame|right|200x200px|alt=alt text|caption]]
[[Mapframe:gray:fr:-122.3995399/37.8103264/13|{optional SPARQL query}|frame|right|200x200px|alt=alt text|caption]]

We could also add some markers using some "parameter=value" after "Mapframe:x/y/z".

It should be also compatible with the "FULLURL:" syntax to create links with custom inline content (not just the basic plain-text description): we could use the generated link (that goes to the same separate page) as the target of the rendering of a static [[Image:]] (in its "|link=*" parameter)

Trizek (WMF) (talkcontribs)
Reply to "simpler mapframe syntax (as a special namespace/interwiki prefix)"