الگو:جعبه اطلاعات نقشه

از ویکی‌پدیا، دانشنامهٔ آزاد
(تغییرمسیر از الگو:Infobox map)
پرش به: ناوبری، جستجو
نشان توضیحات توضیحات الگو [ویرایش] [تاریخچه] [پاکسازی میانگیر]

This helper template provides a way to display a map in an Infobox. Optionally a location marker can be included.

Usage[ویرایش]

Parameter descriptions[ویرایش]

Field name Description
map The name of the map to be displayed. This is the only required parameter.
map_width The width of the map image to be displayed. For example map_width=220 and not map_width=220px.
default_width When this template is used in another template, e.g. an infobox, the default width of the map image preferred by the infobox should be specified here. For example map_width=220. When used with location maps, this value may be modified by a certain value if specified in the location map template. The default value is 220px.
relief Selects a relief map when assigned any value. This only works when the geographical coordinates method is used and then only for a few maps. See Map display methods.
map_alt Alt text for the map. A visually impaired reader who uses a screen reader will have access to this text. See WP:ALT.
map_caption The caption that appears below the map if one is required.
mark The image file that will be used to mark the location on the map. The default is Red pog.svg. See below.
mark_width The width of the marker image to be displayed. For example mark_width=8 and not mark_width=8px. The default width is 8px.
label A text message that will be displayed next to the marker.
label_position The position of a label with respect to the marker. Valid values are left, right, top, bottom and none.
lat
long
Specifies the latitude and longitude of the location when the geographical coordinates method is used. This value must be specified as a signed decimal degree. See below.
x
y
Specifies the position of the location marker. The coordinates of the marker in pixels based on a map width of 1000 pixels. The template will scale these values for proper display. See below.
x%
y%
Specifies the position of the location marker. x% specifies the percentage of the distance across the image from the left edge and y% specifies the percentage of the distance down from the top edge. See below.

Map display methods[ویرایش]

There are three methods which can display a mark to on a map. These examples use {{Infobox park}} which uses this template as a back end.

Display a marker on a map using a template and geographic coordinates[ویرایش]

A marker can be superimposed on a map using one of a set of special map templates. To display a marker the geographic coordinates must be specified using the parameters lat_d, long_d, etc. See the documentation for {{Location map}}. The parameters for this template map to a subset of the parameters used by {{Location map}}. A map template can be found using these sources:

List of templates - Many of the listed items are redirects and a few templates may not function as expected.
- templates sorted by category.
Special:WhatLinksHere/Template:Location map/Info - a search that might help.
Special:Prefixindex/Template:Location map - another search that might help.

All of the names begin with the words "Location map" followed by the area covered. The value you need to specify is the area name. The map template for the Canada is Location map Canada. In this case specify map=Canada.

جعبه اطلاعات نقشه در کانادا واقع شده‌است
Example using geographic coordinates
{{جعبه اطلاعات نقشه
| name = Four Corners, Canada
| map = Canada
| map_caption = Example using geographic coordinates
| lat_d = 60 | lat_m = 00 | lat_s = 00 | lat_NS = N
| long_d = 102 | long_m = 00 | long_s = 00 | long_EW = W
}}

Display a marker on any map image using the x and y parameters[ویرایش]

The values for the x and y parameters are the pixel coordinates of the location mark when the image is scaled to a width of 1000 pixels.

x is the pixel offset for the mark from the left edge of an image 1000px wide.
y is the pixel offset for the mark from the top edge of an image 1000px wide.

There are at least two ways of obtaining these values:

  1. Download the image from the image's file page to your computer. Open the image in a graphics editor, such as گیمپ or اکس‌ان‌ویو. Scale (resize) the image to a width of 1000px and then note the x, y coordinates when the اشاره‌گر (واسط نگاره‌ای کاربر) points to to the desired location. Use these values directly.
  2. Download the image from the image's file page to your computer. Open the image in any image viewer that displays the coordinates of the cursor position, such as پینت from Microsoft. Note the x, y coordinates when the اشاره‌گر (واسط نگاره‌ای کاربر) points to the location. Then:
1000 · x'/w = x  and  1000 · y'/w = y
where x' and y' are the cursor coordinates, w is the width of the image displayed on your computer and x and y are the values to assign to the x and y parameters.
<div style="position: absolute; left: خطای عبارت: کلمه ناشناخته «r»px; top: خطای عبارت: کلمه ناشناخته «r»px; padding: 0;">{{{float_caption}}}
{{{base_caption}}}

Example using the x and y parameters

{{جعبه اطلاعات نقشه
| name = Four Corners, Canada
| map = Canada location map.svg
| map_caption = Example using the x and y parameters
| x = 369
| y = 487
}}

Display a marker on any map image using the x% and y% parameters[ویرایش]

x% specifies the percent of the distance across the image from the left edge.
y% specifies the percent of the distance down from the top edge.

In the following example the marker is 36.9% of the way across and 57.4% of the way down.

{{{base_caption}}}

Example using the x% and y% parameters

{{جعبه اطلاعات نقشه
| name = Four Corners, Canada
| map = Relief map of Canada.png
| map_caption = Example using the x% and y% parameters
| x% = 36.9
| y% = 57.4
}}

Display any image[ویرایش]

Another option allows the display of any image without a location mark.

Average regional brazil nut output (kg/ha)
{{{base_caption}}}
{{Infobox
| above =
| image2 = {{Infobox map
           | map         = Braziloutput.png
           | map_alt     = A world map showing regions that produce Brazil nuts.
           | map_caption =
           | map_width   = 200
           }}
}}

Marks[ویرایش]

A mark can be any image file. The default mark is Red pog.svg and it works well because it is easy to pick up visually on most maps. Some examples are below. Click on an image to see the file description page.

Red pog.svg Blue pog.svg Cyan pog.svg DeepPink pog.svg Gold pog.svg Green pog.svg Lightgreen pog.svg Orange pog.svg Pink pog.svg Purple pog.svg SpringGreen pog.svg Steel pog.svg Turquoise pog.svg White pog.svg

See Location markers for other examples. Currently, using mark_width=n for n > 8 is not advised when a label is specified.

Geographical coordinates[ویرایش]

The template {{decdeg}} can be used to allow additional parameters for the entry of geographical coordinates. The template can be used with or without named parameters. If the unnamed option is used all parameters must be supplied but they can be void. The following markup can be used to allow the template user to enter coordinates. These parameters names are recommended by WikiProject Geographical coordinates.

| lat  = {{decdeg|{{{lat_d|}}}|{{{lat_m|}}}|{{{lat_s|}}}|{{{lat_NS|}}} }}
| long = {{decdeg|{{{long_d|}}}|{{{long_m|}}}|{{{long_s|}}}|{{{long_EW|}}} }}

To display coordinates in the Infobox two methods can be used. The template {{Infobox coord}} can be used to display coordinates entered using the method discussed above. If the X,Y method is used to display a marker then the template {{coord}} can be used. For examples of coordinate entry see coordinate examples.

TemplateData[ویرایش]

بدون توصیف.

پارامترهای الگو
پارامتر توضیحات نوع پیش‌فرض وضعیت
Map map The name of the map to be displayed string خالی ضروری
Map Width map_width The width of the map image to be displayed. number خالی اختیاری
Default Width default_width When this template is used in another template, the default width is given using this parameter number خالی اختیاری
Relief relief Selects a relief map when assigned any value string خالی اختیاری
Map Alternative Text map_alt Alternative text to be displayed if the map isnt displayed for whatever reasons string خالی اختیاری
Map Caption map_caption Caption for the map string خالی اختیاری
Mark mark The image file that will be used to mark the location on the map wiki-page-name خالی اختیاری
Mark Width mark_width The width of the marker image to be displayed number خالی اختیاری
Label label A text message that will be displayed next to the marker. string خالی اختیاری
Label Position label_position The position of a label with respect to the marker string خالی اختیاری
Latitude lat Latitude of the map number خالی اختیاری
Longitude long Longitude of the map number خالی اختیاری
X x Specifies the position of x location marker number خالی اختیاری
Y y Specifies the position of y location marker number خالی اختیاری
X% x% x% specifies the percentage of the distance across the image from the left edge number خالی اختیاری
Y% y% y% specifies the percentage of the distance down from the top edge number خالی اختیاری

جستارهای وابسته[ویرایش]