Template:Map with marks/doc
![]() | This is a documentation subpage for Template:Map with marks. It may contain usage information, categories and other content that is not part of the original template page. |
To use this mapping template with standard wikipedia syntax, see {{OSM Location map}}
Markup | Result | ||
---|---|---|---|
Simple map with a single marker, custom size, and no minimap{{Map with marks | width=400 | height=150 | lat=37.8 | lon=-122.4 | zoom=5 | minimap=false |
{ "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 | |
| ||
Show all Armenian heritage sites, by querying it from Wikidata The query result should have the same columns (fields) as in the other examples ( text, img, ... ), except coordinates should be returned as coord column
{{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. |
(See Wikidata query)
| ||
{{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
}
}}
|
|
The data template parameter must be a comma separated list of "JSON" objects. Each object starts with a "{", has a list of comma separated key-value pairs, and ends with a "}". The key may be one of the following values (used no more than once per each object):
Built-in marker shapes | |
---|---|
shape | "circle" (default), "square", "cross", "diamond", "triangle-up", "triangle-down" (docs) |
color | shape fill color, e.g. "#ff0000" (red - default) |
strokeColor | shape outline color |
size | shape size (number) |
Text labels (see more info) | |
text | Label text |
textAlign | Label's horizontal alignment relative to the marker - "left", "right", "center". By default, left for LTR, right for RTL languages. |
textBaseline | Vertical alignment: "middle" (default), "top", "bottom" |
textColor | Label text color, e.g. "#ff0000" (red) |
textDx, textDy | Horizontal and vertical distance from the marker |
angle | Draw text at an angle |
radius/theta | Radial positioning of the label relative to the marker |
font, fontSize, fontWeight, fontStyle | Font name, size, boldness, and style |
Image markers | |
img | URL of an image, e.g. wikirawupload:{{filepath:Volcano red 32x32.svg|32}} |
height, width | Size of the image |
offsetX, offsetY | Shift the center of the image on the map |
Shows an image of a map, and draws user-specified images/icons on top of it using latitude/longitude coordinates.
Parameter | Description | Type | Status | |
---|---|---|---|---|
data | 1 | Comma separated list of JSON objects that describing what data to draw on the map | String | suggested |
width | width | Total width of the graph | Number | optional |
height | height | Total height of the graph
| Number | optional |
padding | padding | no description | Number | optional |
lat | lat | Latitude of the map's center | Number | optional |
lon | lon | Longitude of the map's center | Number | optional |
zoom | zoom | Map zoom level (0..18) | Number | optional |
wdqs | wdqs | An optional Wikidata query to use instead of the data - the query would generate a list of items just like data, but it must contain a "coord" field with the location | String | optional |
colorScaleField | colorScaleField | If given, this data field will be used to make dots of different color, one color per unique value of this field | String | optional |
minimap | minimap | If set, 0 or false will always hide the map, and 1 or true will always show it. Make sure the map is big enough include the minimap. By default, the map will be shown for zoom levels 5+ if the map is sufficiently large | Boolean | optional |