Template:Mapgroup

From Wikivoyage
Jump to navigation Jump to search
[view] [edit] [history] [purge] Template-info.svg Template documentation

Documentation[edit]

This template works with {{mapgroup-item}} to build a map that shows a group of mapshapes on a single map. It is particularly useful for things like maps of neighboring cities or regions. This template works best when the areas being displayed have Wikidata IDs that have been associated to OpenStreetMap records - see the documentation for Template:Mapshape for more details on using Wikidata IDs with dynamic maps.

To automatically generate a mapgroup for destinations within 20 km of location http://mountaininterval.org/wikivoyage/nearby-destinations.html can be used.

Parameters[edit]

  • target: (Optional) The Wikidata ID indicating the target object for the map. The item in question will appear as a {{mapshape}} on the map.
  • name: (Optional) The name to display in the map caption.
  • width: (Optional) The width in pixels for the map. Defaults to 400.
  • height: (Optional) The height in pixels for the map. Defaults to 400.
  • fill: (Optional) If a target Wikidata ID is used then this value specifies the fill color to use for the mapshape. Color must a valid web color, for example #ff0000 for red. If no value is specified then a default is used.
  • lat: (Optional) The latitude for the center point of the map. Example: 37.18. If no value is specified then the mapping tools will attempt to automatically center the map so that all points of interest are spaced out evenly.
  • long: (Optional) The longitude for the center point of the map. Example: -120.67. If no value is specified then the mapping tools will attempt to automatically center the map so that all points of interest are spaced out evenly.
  • zoom: (Optional) The zoom level for the map. Must be a value from 0 to 18, or "auto" (0=Earth, 18=city block, auto=show all markers). If no value is specified then the mapping tools will automatically select a zoom that fits all items included on the map within the visible display.
  • group: (Optional) The internal group name for the map. This parameter is generally only needed if more than one {{mapgroup}} is being used in an article. See the example below and the documentation for Module:Map for more details on how the group parameter can be used.

Example[edit]

Example demonstrating a basic {{mapgroup}}, including two items:

{{mapgroup
| name=[[Merced County]]'s neighboring counties
| height=300
| target=Q109690
}}
* {{mapgroup-item|name=[[Stanislaus County]]|wikidata=Q108503}}
* {{mapgroup-item|name=[[Fresno County]]|wikidata=Q271915}}

...which produces:

Merced County's neighboring counties

Example demonstrating how to include a second {{mapgroup}} template in an article. For this use case, the second invocation must specify a unique "group" value so that the map extension can properly determine what map each shape and marker belongs to:

{{mapgroup
| name=[[Kern County]]'s neighboring counties
| height=300
| group=kern
| target=Q108047
}}
* {{mapgroup-item|group=kern|name=[[Inyo County]]|wikidata=Q109670}}
* {{mapgroup-item|group=kern|name=[[San Bernardino County]]|wikidata=Q108053}}

...which produces:

Kern County's neighboring counties

See also[edit]

  • {{mapgroup-item}} - Template used to specify items that will be displayed on the map group.
  • {{mapframe}} - Template used to add a dynamic map to an article.
  • {{mapmask}} - Used to create a mask using manually entered latitude/longitude pairs; useful for drawing city or region borders that aren't available from OpenStreetMap.
  • {{mapshape}} - Used to create a mask, shape or line using data from the OpenStreetMap database; useful for city or region borders, or for showing routes.