Jump to content

Template:Map with marks/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Yurik (talk | contribs) at 23:40, 8 October 2016. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Markup Result
Simple map with a single marker
{{Map with marks | lat=37.8 | lon=-122.4 | zoom=5 |

  { "lat": 37.8, "lon": -122.4 }

}}
Two markers with labels - one as diamond shape, one uses an image from Commons
Text label can be customized with all of Vega text mark parameters by prepending "text" to their name
{{Map with marks | lat=40.816667 | lon=14.433333 | zoom=6 |

{"lat": 40.816667, "lon": 14.433333, "img": "wikirawupload:{{filepath:Volcano red 32x32.svg|32}}", "width": 16, "height": 16, "offsetY": -10, "text": "Mount Vesuvius", "textFontWeight": "bold", "textFontSize": 16, "textColor": "#2A4B8D"},

{"lat": 40.948333, "lon": 15.635556, "img": "wikirawupload:{{filepath:Volcano red 32x32.svg|32}}", "width": 16, "height": 16,  "offsetY": -20, "text": "Mount Vulture", "textFontWeight": "bold", "textFontSize": 16, "textColor": "#2A4B8D"}

}}
Show all Armenian heritage sites, by querying it from Wikidata
{{Map with marks | lat=40.347 | lon=47.260 | zoom=6 | colorScaleField=type | wdqs=
# Each location should show only once. This query may output all the same values as in the other examples, such as "text", "img", and others.
SELECT (SAMPLE(?coord) as ?coord) (SAMPLE(?type) as ?type)
WHERE {
  ?item wdt:P3170 ?heritageId .
  ?item wdt:P625 ?coord .
  ?item wdt:P31 ?type .
}
GROUP BY ?item
}}
{{Map with marks | lat=-33.8688 | lon=151.2093 | zoom=10 |
{
  "lat": -33.8688,
  "lon": 151.2093,
  "img": "wikirawupload:{{filepath:Opera_House_and_ferry._Sydney.jpg|48}}",
  "width": 48,
  "height": 36,
  "text": "Sydney",
  "textFontWeight": "bold",
  "textFontSize": 20,
  "textColor": "#00f",
  "textAlign": "right",
  "textDx": -30
}
}}

Shows an image of a map, and draws user-specified images/icons on top of it using latitude/longitude coordinates.

Template parameters

ParameterDescriptionTypeStatus
data1

Comma separated list of JSON objects that describing what data to draw on the map

Stringsuggested
backgroundbackground

Background map image filename

Fileoptional
widthwidth

Total width of the graph

Numberoptional
heightheight

Total height of the graph (Mercator projection is 2:1)

Default
Half of the width
Numberoptional
paddingpadding

no description

Numberoptional
projectionprojection

Name of the D3 geo projection to use

Stringoptional