แม่แบบ:OSM Location map/doc
นี่คือหน้าคู่มือการใช้งานของ แม่แบบ:OSM Location map ใช้ในการเขียนคำอธิบายแม่แบบหรือมอดูลและใส่หมวดหมู่ ส่วนลิงก์ข้ามภาษาโปรดใช้วิกิสนเทศ |
แม่แบบนี้จัดเตรียมแผนที่ในกรอบภาพ สำหรับตำแหน่งและมาตราส่วนใด ๆ โดยพื้นฐานสามารถแสดงภาพจาก OpenStreetMap และตัวบ่งชี้มาตราส่วนสำหรับพื้นที่ที่กำหนด สามารถเลือกใช้เครื่องมือระบุเครื่องหมาย, ป้ายกำกับ และคำอธิบายประกอบได้ เพื่อแสดงเครื่องหมายตำแหน่ง, ป้ายกำกับ, จุดหมายเลข, หัวเรื่อง, คำอธิบายภาพ, แผนที่ขนาดเล็ก และภาพซ้อนทับ แผนที่ยังมีลิงก์ไปยังเวอร์ชัน 'maplink' แบบโต้ตอบซึ่งเป็นแบบเต็มหน้าจอ
วัตถุประสงค์ แก้
OSM Location map ให้เครื่องมือแก้ไขซึ่งสามารถรวมแผนที่ไว้ในเฟรมสำหรับทุกที่ในโลก ในทุกระดับจากระดับทั้งโลกไปจนถึงถนนหนึ่งหรือสองสาย โดยใช้ประโยชน์จากข้อมูลของการทำแผนที่ OpenStreetMap และเปิดใช้งานหน้าหรือหัวข้อตามสถานที่ เพื่อแสดงพื้นที่ที่อธิบายโดยไม่ต้องใช้แม่แบบแผนที่ที่กำหนดไว้ล่วงหน้า แผนที่ต้นแบบจะได้รับการอัปเดตและปรับปรุงโดยอัตโนมัติเมื่อข้อมูล OSM ได้รับการพัฒนา
แม่แบบยังสามารถแสดงเครื่องหมาย, รูปภาพ และป้ายกำกับ ได้หลายรายการ (ปัจจุบันจำกัดไว้ที่สิบรายการ) แม่แบบนี้เรียกใช้แม่แบบ {{Graph:Street map with marks}} ซึ่งอนุญาตให้ใช้เครื่องหมายและป้ายกำกับได้ไม่จำกัดจำนวน สามารถใช้มาร์กอัปการเข้ารหัสที่แตกต่างกัน และเหมาะอย่างยิ่งกับการใช้ข้อมูลโดยตรงจากแหล่งที่มาจากวิกิสนเทศ
ผลลัพธ์แผนที่ในกรอบยังมีลิงก์ไปยังเวอร์ชันเต็มหน้าจอซึ่งเปิดขึ้นที่ตำแหน่งเดียวกันเหนือหน้าปัจจุบัน มีอินเทอร์เฟซแผนที่ที่สมบูรณ์ยิ่งขึ้นผู้ใช้สามารถปรับขนาดและแพนใหม่ได้ มีภาพขนาดย่อและคำบรรยายสำหรับจุดเครื่องหมาย และยังสามารถเข้าถึงแผนที่ภาพดาวเทียมและอื่น ๆ ได้หลากหลาย (ตัวเลือกเต็มหน้าจอใช้ การจัดเตรียมภาพแผนที่ของ <maplink>)
คำแนะนำคร่าว ๆ เกี่ยวกับมาตราส่วนของแผนที่มีให้ที่มุมล่างซ้าย ซึ่งเป็นเพียงแนวทางเท่านั้น เนื่องจากการถ่ายแผนที่นั้นการเปลี่ยนแปลงมาตราส่วนจะขึ้นอยู่กับละติจูด มีการเผื่อไว้สำหรับสิ่งนี้ แต่เฉพาะในส่วนขนาดใหญ่ตั้งแต่ 20 องศาเท่านั้น
เปรียบเทียบกับแม่แบบ {{Maplink}} แก้
ตั้งแต่เดือนพฤษภาคม พ.ศ. 2561 เป็นต้นมา ผู้ใช้สามารถสร้างแผนที่ในกรอบผ่านทาง {{Maplink}} ได้ซึ่งในบางประเด็นก็ทำงานคล้ายกับ OSM Location map ในทั้งสองกรณีสามารถเพิ่มรูปภาพแผนที่แบบคงที่ในบทความได้จากทุกที่ในโลก โดยดึงข้อมูลแผนที่จาก OpenStreetMap ความแตกต่างอยู่ในสิ่งที่สามารถทำได้และทำไม่ได้ในการเพิ่มลงในแผนที่ฐาน โดย Maplink ทั้งในเวอร์ชันแบบเฟรมและแบบเต็มหน้าจอ สามารถเพิ่มได้เพียงจุดตำแหน่ง (จุดที่มีตัวเลข หรือแบบไอคอน) หรือสามารถนำเข้าเส้นและพื้นที่ต่าง ๆ จาก OpenStreetMap ผ่านค่าวิกิสนเทศ Q (เช่น ขอบเขต, ถนน, แม่น้ำ ฯลฯ) ดังนั้นแผนที่ในกรอบและเวอร์ชันเต็มหน้าจอจะแสดงข้อมูลที่เหมือนกัน ในทางกลับกันแผนที่ตำแหน่ง OSM ไม่สามารถเพิ่มเส้นและพื้นที่โดยค่า Q ได้ยกเว้นการคลิกผ่านแบบเต็มหน้าจอ แต่สามารถใช้แผนที่ที่มีกรอบเพื่อแสดงการเลือกจุด, รูปร่าง, ภาพซ้อนทับ, รูปภาพ และข้อความโดยเฉพาะอย่างยิ่ง รายละเอียดเฉพาะที่เกี่ยวข้องกับบทความหนึ่ง ๆ
การใช้งาน แก้
- Minimal version
- an unadorned map centred on a latitude and longitiude coordinates, via a {{coord}} value. Set the zoom to give a scale that fits the subject (0=whole world, 18=a street). With just these options set, all other parameters use the defaults, or are left unused. It gives a link to the full screen version.
{{OSM Location map <!--These parameters are the only essential items-->
| coord = {{coord|53.41459|-4.3341279}} <!--latitude and longitude - eg as a +/- decimal. -->
| zoom = 15 <!--(1=whole world, 18=a street)-->
}}
|
- Single marker
- Using mostly default settings, with a Red pog marker and label, and some additional info for use on the full screen version.
{{OSM Location map
| coord = {{coord|53.394|-4.450}}
| zoom = 13
| width = 300
| height = 150
| caption = The 'Llanfechell Triangle' standing stones are north-west of [[Llanfechell]].
| mark-coord = {{coord|53.3966|-4.46204}}
| label = Llanfechell Triangle
| label-pos = right
| mark-title = Llanfechell Triangle
| mark-image = The Llanfechell Triangle - geograph.org.uk - 1260817.jpg
| mark-description=Group of three prehistoric standing stones thought to date to the Bronze Age, at [[Llanfechell]], [[Anglesey]]
}}
|
- Code blank
{{OSM Location map
| coord = {{coord| | }} <!-- {{coord}} has various formats for latitude and longitude -->
| zoom = <!-- (1=whole world, 18=a street)-->
| width = <!-- width and height of the frame. numeric input - do not add px -->
| height =
| caption = <!-- Text below the map. Can include [[wikilinks]] -->
| mark-coord = <!-- use {{coord| | }} to set lat and lon location for the marker -->
| label = <!-- text alongside the mark -->
| label-pos = <!--default position is to the left. (or right, top, bottom)-->
| mark-title = <!-- | -->
| mark-image = <!-- | these are only used within the full screen linked page -->
| mark-description = <!-- | -->
}}
|
Two markers แก้
{{OSM Location map
| coord = {{coord|53.395|-4.452}}
| zoom = 14
| float = right
| width = 300
| height = 250
| caption = Scheduled monuments around [[Llanfechell]], [[Anglesey]]
| title =
| minimap = file
| mini-file = Wales relief location map.jpg
| mini-width = 70
|mini-height = 90
| minipog-x = 25
| minipog-y = 4
| scalemark = 66 <!-- shifts the scalemark further to the left -->
| shape1 = image
| mark1 = Red pog.svg
| label1 = Baron Hill Maen Hir
| mark-coord1 = {{coord|53.3964|-4.4531}}
| label-pos1 = right
| label-size1 = 11
|label-color1 =
| label-offset-x1=
| label-offset-y1=
|mark-title=Baron Hill Maen Hir
|mark-image=Standing stone east of Llanfechell - geograph.org.uk - 1254434.jpg
|mark-description=Baron Hill Maen Hir, is a prehistoric standing stone north of [[Llanfechell]].
| mark-coord2={{coord|53.3966|-4.46204}}
| label2 = Llanfechell Triangle
| label-pos2=top
| label-offset-x2=35
| label-offset-y2=
|mark-title2=Llanfechell Triangle
|mark-image2=The Llanfechell Triangle - geograph.org.uk - 1260817.jpg
|mark-description2=Group of three prehistoric standing stones thought to date to the Bronze Age, at [[Llanfechell]], [[Anglesey]]
}}
|
Multi marker example แก้
{{OSM Location map
| coord ={{coord|52.0|-4.810}}
| zoom =11
| width = 300 <!-- width and height of the frame. numeric input - do not add px -->
| height = 300
| caption = Pentre Ifan and other nearby Neolithic sites
| scalemark = 47
| mark-coord = {{coord|51.9990|-4.7700}} <!-- lat and lon location for the marker -->
| mark = Archaeological site icon (red).svg
| mark-size = 14
| label = Pentre Ifan <!--this is the label text. Its default position is to the left of the marker-->
| label-size = 15
|label-color = black
| label-pos = left
| mark-title = Pentre Ifan, [[List of Scheduled prehistoric Monuments in north Pembrokeshire|Pembrokeshire]]
| mark-image = DMPentreIfanFront.JPG <!-- | used within the full screen linked page -->
| mark-description = The largest and best preserved [[Neolithic British Isles|neolithic]] [[dolmen]] in [[Wales]]
| mark-coord1 = {{coord|52.0545|-4.7717}}
| mark1 = Archaeological site icon (red).svg
| mark-size1 = 9
| label1 = Llech-y-Tribedd dolmen
| label-size1 = 10
|label-color1 = #776666
| mark-title1 = Llech-y-Tribedd, [[List of Scheduled prehistoric Monuments in north Pembrokeshire|Pembrokeshire]]
| mark-image1 = Llech-y-tribedd and Carn Ingli - geograph.org.uk - 1426923.jpg
| mark-description1 = Llech-y-Tribedd is a well preserved dolmen with three tapering uprights and a massive capstone.
| mark-coord2={{coord|52.0186|-4.8282}}
| label2 = Carreg Coetan
| labela2 = Arthur dolmen
| label-pos2 = top
| label-offset-x2 = -6
| mark-title2 = Carreg Coetan Arthur, [[List of Scheduled prehistoric Monuments in north Pembrokeshire|Pembrokeshire]]
| mark-image2 = Carreg Coetan burial chamber. - geograph.org.uk - 1044642.jpg
| mark-description2 = [[Carreg Coetan Arthur]] is a dolmen in a small hedged enclosure on the outskirts of Newport
| mark-coord3={{coord|51.9409|-4.823}}
| label3 = Banc Du
| labela3 = Neolithic enclosure
| label-pos3 = top
| mark-title3 = Banc Du Neolithic enclosure, [[List of Scheduled prehistoric Monuments in north Pembrokeshire|Pembrokeshire]]
| mark-image3 = Sheep on Banc Du - geograph.org.uk - 1754023.jpg
| mark-description3 = [[Banc Du]] is a promentary hill with the first confirmed neolithic enclosure in Wales
| mark-coord4={{coord|51.9775|-4.7563}}
| label4 = Bedd yr Afanc
| labela4 = Burial Chamber
| label-pos4 = top
| mark-title4 = Bedd yr Afanc Burial Chamber, [[List of Scheduled prehistoric Monuments in north Pembrokeshire|Pembrokeshire]]
| mark-image4 = Bedd yr afanc, looking east-southeast - geograph.org.uk - 404497.jpg
| mark-description4 = Bedd yr Afanc is a stone burial chamber below the summit of Mynydd Preseli
| mark-coord5={{coord|51.9685|-4.7945}}
| label5 = Standing Stones
| label-pos5=right
| mark-title5 = Standing Stones, [[List of Scheduled prehistoric Monuments in north Pembrokeshire|Pembrokeshire]]
| mark-image5 =
| mark-description5 = Tafarn-y-Bwlch and Waun Mawn Standing Stones
| mark-coord6={{coord|52.0478|-4.7982}}
| label6 = Trellyffaint dolmen
| label-pos6=right
| mark-title6 = Trellyffaint burial chamber, [[List of Scheduled prehistoric Monuments in north Pembrokeshire|Pembrokeshire]]
| mark-image6 = Trellyffant burial chamber, looking northeast - geograph.org.uk - 1410564.jpg
| mark-description6 = Trellyffaint dolmen, looking northeast. The capstone has collapsed at some point.
| mark-coord7={{coord|52.0137|-4.8627}}
| label7 = Cerig-y-Gof
| labela7 = chambered tomb
| label-pos7=bottom
| label-offset-x7=10
| mark-title7 = Cerig-y-Gof chambered tomb, [[List of Scheduled prehistoric Monuments in north Pembrokeshire|Pembrokeshire]]
| mark-image7 = Cerrig y Gof chambered tomb - geograph.org.uk - 202375.jpg
| mark-description7 = A group of five stone-lined chambers, thought to have been originally covered by a single mound.
| mark-coord8={{coord|51.9597|-4.7223}}
| label8 = Bedd Arthur stone circle
| mark-title8 = Bedd Arthur, [[List of Scheduled prehistoric Monuments in north Pembrokeshire|Pembrokeshire]]
| mark-image8 = Beddarthur standing stone circle, Preseli Mountains - geograph.org.uk - 258436.jpg
| mark-description8 = [[Bedd Arthur]] is an oval banked enclosure set with stones.
| mark-coord9={{coord|51.973|-4.77}}
| label9 = P R E S E L I H I L L S
| mark-size9 = 0
|label-angle9 = 25
|label-color9 = #81AF81
| mark-title9 = [[Preseli Hills]] <!-- use mark-title9 = none if you wanted to suppress the full-screen marker -->
}}
|
Multiple markers, labels and/or images แก้
In addition to the un-numbered mark parameters, there are 30 numbered ones. These are otherwise identical to the one above, but the name terminates in a number (1-30). Each mark and label has its own set of parameters (|mark1=
, |mark-coord1=
, |label1=
, |label-pos1=
etc...|mark2=
, |mark-coord2=
, |label2=
, |label-pos2=
etc.) Mark1
acts as a 'master marker' for subsequent parameters. Values given to the 'mark1 set' are inherited by the other numbered sets, which avoids repetition.
Minimap แก้
There is a built-in map of the world option, which will act as a mini locator map and automatically adds a red locator dot. Unfortunately it is too general for most purposes, so making use of an existing 'Location map' file is possible. This is can be seen in the Llanfechell map example, it is not very automated. The width and height of the map both have to be specified (and it is up to you to not distort the map dimensions). An optional locator dot can be placed by specifying the minipog-x and -y values, using the same scale values as mini-width and -height. With an origin in the top left of the minimap, the minipog can be placed over the relevant point on the minimap.
| minimap = file <!--this minimap is used in the Llanfechell example above-->
| mini-file = Wales relief location map.jpg
| mini-width = 70
| mini-height = 90
| minipog-x = 25
| minipog-y = 4
| scalemark = 66 <!-- shifts the scalemark further to the left -->
If the area of the actual map is a large portion of the mini-map, an open red box can be included instead of a dot, to show the bounds of the main map. To use this feature, simply specify the width of the required box: minimap-boxwidth=xx
where xx = the pixel width of the box. In general anything much below xx=15 will be better served by a dot. The required width will require some trial and error to pin down. The box height is then matched in proportion to the actual map.
Alternative marks แก้
Instead of using the standard 'Red pog' for mark points on the map, other images can be used. Any image from Wikimedia Commons can be specified. The Pentre Ifan example above uses 'Archaeological site icon (red).svg'. If a particular image file is specified in mark1=
, all subsequent marks will use it as well unless they name their own image file. If the image is not square, a dimension value also needs to be set (width ratio for a height of 1)
Transparent overlay แก้
A marker image does not have to be small and opaque. A larger overlay image (with a transparent background) can be used to show particular features not included in the base map, such as a town's former walls (see the adjacent map). Such images can be created in several ways (such as tracing over a copy of the base map); they are invoked like any other marker image file.
Text effects แก้
Where label text is too long to fit on a single line, two further label line can be used: labela =
and labelb =
.
It is possible to specify a label-angle =
, which will pivot the label text around the centre of the marker point by the specified angle. If mark-size is set to zero, this has the effect of a free-floating label with no marker, useful for various geographic and linear features. (This is illustrated by the 'Preseli Hills' text on the Pentre Ifan map). For stylistic consistency all settlement and building names should not be given an angle.
Numbered dots แก้
If numbered dots are needed, instead of (or as well as) text labels, this can be achieved using the built in shapes. For example, shape1=n-circle
will place a numbered dot at that coord position (or l-circle
for letters). Generally it is much better to use the dots in sequence, so each numbered mark gives a numbered dot, and they will match the full screen ones. If auto-caption=1
then the caption will generate a numbered list using the mark-title
entries. For example:-
{{OSM Location map
| coord={{coord|52.620|-1.112}}
| float=left| zoom =15
| width = 200 | height = 300
| mark-coord1 = {{coord|52.6180|-1.11189}}
| mark-title1 = St John The Baptist Church
| shape1=n-circle
| shape-color1=blue
| shape-outline1=white
| mark-size1=16
| mark-coord2 = {{coord|52.61819|-1.11035}}
| mark-title2 = Congregational Church
| mark-coord3 = {{coord|52.62324|-1.11179}}
| mark-title3 = Eastfield, Stanley Road
| mark-coord4 = {{coord|52.62123|-1.111297}}
| mark-title4 = Stoneygate School
| mark-coord5 = {{coord|52.62009|-1.11241}}
| mark-title5 = The Firs
| mark-coord6 = {{coord|52.61936|-1.11510}}
| mark-title6 = White House
| caption = Listed buildings in Stoneygate
| auto-caption=1
}}
The other built-in shapes can be used in the same way (n-square
, n-diamond
etc.). The shape-outline1=
value sets the colour for the number (unlike normal, when it sets the shape-outline), and as with the others, only the mark1
parameter values need to be set, to establish the default for this map, which can be overridden as required. The numbered1..2..3 etc
parameters can override the automatic numbers or letters to use your own values for each mark. {{Flushing Meadows-Corona Park map}} is a useful real life example in template form.
Full list of parameters แก้
{{OSM Location map
| coord={{coord|51.46534|-0.44542}}
| zoom=12
| float = right
| width = 300
| height = 400
| fullscreen-option=
| caption = [[File:Heathrow Airport 014.jpg|360px]]<br>With five terminals, [[Heathrow Airport]], is the busiest airport in Europe.
| title=London's Heathrow Airport
<!-------->
| minimap = file
| mini-file = Greater London UK location map 2.svg
| mini-width = 150
| mini-height = 120
| minipog-x = 19
| minipog-y = 63
| minimap-boxwidth = 20
| scalemark = 160
<!-------->
| shape = image <!-- start of first label. This does not inherit parameter values from the 'master marker', mark1 and its parameter values have to be entered in full. Other labels have a number attached to each parameter name.-->
| shape-color=
| shape-outline=
| mark = Airplane silhouette.svg
| mark-size = 20
| mark-coord = {{coord|51.471948|-0.487883}}
| label = Heathrow Terminal 5
| labela =
| labelb =
| label-size = 13
| label-color = #191970
| label-angle =
| label-pos = top
|label-offset-x = 19
|label-offset-y =
| mark-title = Heathrow Airport Terminal 1
| mark-image = Heathrow Terminal 1 - geograph.org.uk - 581459.jpg
| mark-description=Terminal 1 at [[Heathrow Airport]], the busiest airport in Europe.
<!-- Subsequent markers add a number 1 to 30 to the marker parameter names, mark-coords are required for each marker. Most parameter values are inherited from the 'mark1' marker which acts as the 'master marker'-->
| mark-coord1={{coord|51.470156|-0.448497}}
| shape1 = image
| shape-color1=red
| shape-outline1=
| mark1 = Airplane silhouette.svg
| mark-size1 = 20
| label-color1 = #191970
| label1=Terminal 2
| label-size1=13
| label-pos1=bottom
| mark-title1 = Heathrow Airport Terminals 1 & 3
}}
|
- Code blank- all parameters
{{OSM Location map
| coord = {{coord| | }}
| zoom=
| float =
| width =
| height =
| fullscreen-option =
| caption =
| title =
| minimap =
| mini-file =
| mini-width =
| mini-height =
| minipog-x =
| minipog-y =
| minipog-boxwidth =
| scalemark =
| shape =
| shape-color =
| shape-outline =
| mark =
| mark-size =
| mark-dim =
| mark-coord = {{coord| | }}
| label =
| labela =
| labelb =
| label-size =
| label-color =
| label-angle =
| label-pos =
| label-offset-x =
| label-offset-y =
| mark-title =
| mark-image =
| mark-description=
<!-- second and subsequent markers- values set in mark1 will be inherited by all other numbered markers-->
| mark1 =
| mark-coord1 ={{coord| | }}
| label1 =
| label-pos1 =
}}
Parameters แก้
Underlying technology แก้OSM Location map itself has no map or display ability of its own. Everything within the frame is produced through the template {{Graph:Street map with marks}}, created by User:Yurik. This in turn calls internal processes that turn all the data supplied at edit time into a rendered bitmap image, so that there is no calculation overhead by the time the page is read by a user, any more than any other commons image. Whilst the map is being edited and previewed, the page is supplied with a rasterised image, collating the base-map, marks, labels, etc. on the fly. It will be particularly noticeable on small fonts that when the 'Publish Changes' button is pressed, the resulting bitmap has much worse fonts than the preview. (Maybe this will be improved at some point). The process of updating the map image and providing the right bitmap is all handled internally and invisibly. One of the consequences of the 'bitmap' solution, which is different from the standard {{Location map}} method, is that there is no text or objects on the final image, so there is no possibility of adding wikilinks within the template. The full screen option, which can be clicked through from below the map, provides an entirely different mapping approach, using the same base-map data. This provides an interactive map that can be panned and zoomed. It also replicates (although at present only as numbered markers) the various marks from the page map. These can then be given more content, by way of a title, caption and image. The caption and title can then be given all the wikilinks and other markup features that may be desired, providing a map-based page that will offer another way of engaging with the article content. Future development of the various mapping technologies is likely to result in further options for showing maps on Wikipedia. In particular, something more like the fullscreen interactive map, but within a frame, is likely to emerge. It has a much higher processor overhead than the bitmap based solution, which seems to be one reason for a slow and cautious development. The most likely main use of that might be within info-boxes, where the whole map is automatically generated from already available data. This, on the other hand, is better suited to a hand-edited map, in which the area displayed and the selection of items and labels included are selected, edited, and added to, to suit the specifics of the subject in hand. A further approach, which is not currently supported within this template, but is available via the inderlying 'Graph' template, is to draw the data from Wikidata, using a query that provides the selection of marks requested. The 'Graph' technology used here is described as under development, so while it is highly likely that this or a similar solution will still be available, it may evolve over time.
|