Template:OSM Location map from table/doc

From HandWiki
< Template:OSM Location map from table
Revision as of 10:07, 30 January 2021 by imported>Jworkorg (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Purpose

OSM Location map from table provides a replacement for {{OSM Location map}} in which all the data is moved to a commons Data: file, thus avoiding the large lump of code that results from a map with multiple marker points. It also allows the same map to be re-used in multiple articles.

This template performs two roles. It can generate the data that is to be placed in the external .tab and .map files in Wikimedia Commons, and can also use those data files to display the map in an article.

Usage

Generating the data
The starting point for this process is to have your {{OSM Location map}} in a finished, saved form, showing all the item markers you need. You then edit the page again and change the first line of the template to read:-
{{OSM Location map from table
| setup-data-table=1
| title= <suitable title - if not already set within your map data>
| lat=
| lon=
<and so forth. All the remaining parameters should remain untouched at this stage.>

When the page is previewed, you will find new data generated on the page, containing a coded version of the map, ready to be pasted into special table and map files in Wikimedia Commons. Alongside the data sections are full instructions on how to create the required files.

Displaying the map from external data
The new, short, ready to run template replaces the long sets of parameters needed by {{OSM Location map}}. The instructions provide a ready customised version of the template below. The two 'new' parameters data-table and mapfile are the names of the .tab and .map files.
{{OSM Location map from table
| lat =
| lon = 
| zoom = 
| width = 
| height = 
| data-table = 
| mapfile = 
| title =  
| caption=
}}

Limitations

As of January 2017 the full screen version is not able to display all the extra features (wikilinks, pictures, numbers on the dots) that the inline version provides.

It is not possible (at present) to use the external data and also 'localise' the framed or full-screen maps for a particular article. If the external data is used, no other items can be overlaid. Once the data has been transferred to data form, any changes to that data will change all the articles that use it, so at present each article is likely to need its own data files. Even the ability to shift the map within the frame is not possible if a mini-locator has been used, as these also have to be 'embeded' within the table data, and will get out of sinc if you change the map dimensions or focal point.

(There is of course nothing preventing the same source OSM Location map being used and adapted to multiple pages, each of which is then saved to data files.)