User talk:Matroc/Mapdraw2

General Info

 * This is based on experiments and a revamp of an earlier Module that I had created in order to add a little flexibility to maps.
 * Further work will stop at this time and will be making notes an hopefully clarifying any information provided.
 * Anyone can comment if so desired and I think this may be worthwhile.

Mapdraw2

 * Specialized use only - not to replace any existing templates/modules but to add shapes to a map.
 * Used to build a mapframe or different style maplinks and display any shapes contained in the list below and produce Kartographer &lt;mapframe&gt; and &lt;maplink&gt; code directly. (GeoJSON)
 * Available shapes:
 * x, arrow, box (square), equitri (equilateral triangle), star, star2, multiside, ellipse, boxframe, crescent, cross, rhombus, diamond, sun, pointer,
 * stadium, star6, bar, kite, annulus, wedge, keystone, cog, pentagram, rectangle (simple stylized rectangle), point and line.
 * A special shape empty was introduced in case no shape is desired and a blank mapframe or maplink is to be created.
 * A New shape external is for OpenStreetMap - geomask, geoshape, geoline and page. Used to retrieve a mapshape or file from Commons.


 * A Lua module (User:Module:Sandbox/Matroc/Mapdraw2) was created to provide calculation and other work associated with the template User:Matroc/Mapdraw2. The module itself should probably be rewritten in a much saner manner and approach. Different methods were used to calculate and build shapes making the argument for revamping.
 * A special template is called to produce the mapframe or maplink (Note: Template used to make a single standalone mapframe or maplink)
 * Template makes use of  or   to quickly build and make these elements live. User:Matroc/Mapdraw2 is current experimental template.
 * Template provides some default parameters when calling the module Mapdraw2 and the module provides several internal defaults as well. Reminder that not all parameters are required - test it out.
 * This makes use of the group and show parameters. (not all sites do this)
 * Rather than make a large number of templates and modules - all of this is contained within 1 template and 1 module.


 * JSON errors mostly occur when an id or lat,long parameters are missing. (in rare instances, an id may not point to a Wikidata record that has a latitude or longitude associated with it. This may produce an error that may be cleared up by adding lat and long parameters as well). Bad format of fill, color parameters or other simple editorial mistakes - so there is an incentive to check your parameter data. An error may occur if a mapshape in OSM or file in Commons does not exist.

Mapdraw2 Template

 * Template parameters: Not all parameters are required as template and Module have built in defaults. Will try and clarify a bit as there are different choices or options available for certain shapes.
 * Will attempt to clarify parameters somewhat.
 * Considering multiple point, multi-line and other types but not at this time as well as creating and/or eliminating some defaults.

Mapdraw2 examples

 * Example Code to create mapframe shown here:

Maplink samples

 * Note: a fix is needed for Module:Mapdraw2 -- check and insure lat and long coordinates are being created correctly... Have entered ids for examples to insure they appear for the moment.

link

 * This maplink has an icon and a word to click on that will display a six sided shape.
 * This maplink has just an icon and sill display a boxframe somewhere in Norway.
 * This maplink has words to click on and displays a Point with a Maki symbol for city.
 * This maplink has words to click on and justs goes to place on map just as in a marker.

linkc

 * This maplink has icon and coordinates to click on showing a cog shape.
 * This maplink has just coordinates to click on showing a box shape.

hidden

 * In addition, the main mapframe on this test page has a number of links (shapes) not referenced in page text. Open up full map found on page, zoom out and you should see small yellow crosses (World War I sites from listings found on wikivoyage page World War I)


 * Build a frame using OpenStreetMap (geoshape) - Mapframe for Uttarakhand. Image added as well as text. link for image goes to Wikivoyage article. Descriptive text added as well.


 * OSM link for original Llanfairpwllgwyngyll external shape no longer available changing frame example to Uttarakhand.


 * Build a frame using external file from Commons - ie. a highway in Israel


 * See also: Sandbox2 for other examples.