社区中心
Advertisement

Emblem-notice.svg

正在翻譯的頁面
本頁面尚未翻譯完成,歡迎使用者協助翻譯。更多正在翻譯的頁面
此擴充功能已在Fandom上預設啟用

互動式地圖是Fandom上提供的一個使社群可以設計自己的客製化地圖的功能,任何希望使用該功能的社區皆可使用。

入門指南

目前,僅限擁有editinteractivemap權限的使用者建立和編輯地圖,該權限會自動給予管理員和Fandom職員。管理員及其更高權限者可將使用者加入至使用者群組互動式地圖測試者,使其可以建立和編輯地圖。

一旦您擁有了編輯地圖的權限,您就可以在頂部導覽列的「導覽」下拉式選單中點擊「互動式地圖」選項或者透過造訪wiki上的Special:AllMaps(特殊:所有地圖)按照指引使用建立工具來建立自己的地圖。您還可以在Special:AllMaps(特殊:所有地圖)上看到社區中所有的已有地圖。

All Interactive Maps live in the Map: content namespace, e.g. /wiki/Map:My_New_Map. Maps created in any other namespace, including as a userspace subpage, will not be correctly generated. When creating a Map via the button on Special:AllMaps, this namespace is automatically added, omitting the need to make this part of the page title.

Unless you have set your 偏好設定 to use the source editor, the "Edit" button at the top right of any page in the Map namespace will open the visual Interactive Maps Editor, which is a user-friendly option to edit Maps quickly and easily. Clicking "Edit source" from the dropdown menu will instead take you to the source editor and load the base JSON (JavaScript Object Notation) structure for the Map. If you have the source editor selected as your preference, these options are reversed and the button in the dropdown reads "Edit map". Clicking the pencil icon present on the map itself will always open the visual Interactive Maps Editor, regardless of your preferred editor. While inside the visual Interactive Maps Editor, hovering over the button with the three vertical dots will open a dropdown with the option to "edit source".

使用視覺化編輯器構建地圖

地圖顯示

This section allows you to view your Map name, upload a Map image as your background, and group markers that are in close proximity.

  • 地圖名稱:即地圖的標題。您可以使用網址「/wiki/Map:[地圖名稱]」查看地圖。如果您要在地圖建立後變更名稱,請將指標懸停在地圖本體右上角的「…」按鈕上並點擊「移動」選項,然後互動式地圖編輯器將會關閉,您將跳轉至Special:MovePage(特殊:移动$1)。
  • 地圖圖片:點擊指定區域上傳您要用於地圖的圖片。您可以上傳.jpg.jpeg.png.svg格式的檔案。最大檔案大小為10MB。
  • Group Markers: Toggle this option "on" to simplify the number of markers on a Map by grouping ones that are in close proximity. If you click on a grouped location, it will zoom in and show a sub-group or individual markers in a selected location. We recommend grouping large numbers of markers for a better viewing experience.

Categories

Organize markers of a similar kind by grouping them into categories. This list will appear next to the Map and allows you to filter markers by categories. Click the "Add Category" button to create a new one, click on the color to the left of the category to change the color of the category, and grab hold of the horizontal bars on the right of the category to re-order the categories in the list. Clicking anywhere on the category will transform the horizontal bar to a trashcan icon to give you the option to delete the category.

標記

To add a marker to your Map, click the pin icon in the top right-hand corner. Move your cursor to the desired placement on the Map and click to drop it. After you place the marker, a menu will come up with several options that control how your marker will appear on the Map:

  • 標題:標記(或地點)的名稱,不得超過50個位元組。
  • 描述(選填):點擊標記後,描述將顯示在彈出式窗口中的標題的下方,不得超過150個位元組。
  • 連結(選填):您可以選擇將標記連結至wiki上的任何頁面(提供有關所選標記或地點的更多詳情的條目)。
    • 頁面標題:在輸入框內填寫您要連結頁面的名稱。頁面名稱中既可使用空格也可使用底線。
    • 連結顯示文字:選擇您所希望的連結文字的顯示方式,可以同頁面名稱一致,也可以為「查看更多」之類的內容。如果頁面標題已經填寫,則連結顯示文字必須填寫。
  • 分類:Select which category you would like your marker to be grouped in. Each marker must be associated with a category to better group similar markers.

Once a marker is created, you can drag it to a different location on the Map if you so choose. You can also click on the marker and hover over the three vertical dots to bring up options to edit or delete the marker.

附加功能

  • 縮放:Use the + and - buttons in the bottom right corner to zoom in and out of your Map. You can also use the scroll/mouse wheel.

Hovering over the button with the three vertical dots will open a dropdown. Depending on your user rights, you will always get the option to "edit source", "history", and "move" the Map.

  • 編輯原始碼:Clicking this will take you out the visual Interactive Maps Editor and to the JSON code of the Map. If you wish to return to the visual Interactive Maps Editor, you need to exit the source mode and click the edit pencil on the Map again.
  • 歷史:This will take you out of the editor and to the page history of the Map, showing you all edits and changes made by anyone and giving you the option to undo them if necessary.
  • 移動:This will close the Interactive Maps Editor and take you to Special:MovePage.

The following options are only available to those with the content moderator right or higher.

  • 保護:It opens the options for protecting your Map.
  • 刪除刪除地圖。就算誤刪,您也可以隨時恢復。

As you are making edits, the preview window will display your changes in real time, so you can see how your Map will look before you save it. When you are finished, click the "Save" button and your new Map will now appear on the wiki!

在原始碼編輯器中使用JSON

Every Interactive Map is defined in JSON (JavaScript Object Notation). The following fields should be defined in order to generate the Map:

  • mapImage(必填) – name of the file that will be used as the map background image. The image must be uploaded to the wiki (e.g. using Special:Upload). The following file extensions are supported: jpg / jpeg / png / svg
  • mapBounds(必填) – bounds defining the edges of the map, given as a 2x2 matrix of integers
  • categories(必填) – list of categories that will be displayed in the filters list (the dropdown menu found top-left of the map)
  • markers(必填) – list of markers that will be displayed on the map. Each marker must be associated with a defined category
  • origin – location of the origin point [0,0] in the coordinate system
    • Possible values: bottom-left (default) or top-left
  • coordinateOrder – order of coordinates used in defining map bounds and marker positions
    • Possible values: xy(預設)或yx

Categories

Categories are a group of markers of the same kind. Each marker category is defined through the following fields:

  • id(必填) – uniquely defined ID for each category, matched with the categoryId property of each marker. Any string is valid as an "id".
  • name(必填) – name of the category, which will be displayed in the filters list
  • color(必填) – color each marker category will appear with, which can be given in hex colors or named colors. Categories with an invalid color field will display as black.

標記

Each individual marker is defined through the following fields:

  • categoryId(必填) – category associated to the marker
  • position(必填) – coordinate position of the marker, within the given mapBounds and in the order defined by coordinateOrder
  • popup(必填) – properties of the pop-up box that appears when a marker is clicked on:
    • title(必填) – title of the marker. Each marker title has a strict 50 character limit
    • description(必填) – description to be displayed in the pop-up. Each marker description has a strict 150 character limit
    • link – article link to be added to the pop-up. Marker links are optional, but if included must be defined with both a url (the article title to be linked to) and a label (the link text to be displayed). The URL can link to both full articles and article sections.

範例

{
  "origin": "bottom-left",
  "coordinateOrder": "xy",
  "mapImage": "File:MapBackground.jpg",
  "mapBounds": [[0, 0], [1000, 1000]],
  "categories": [
    { "id": "1", "name": "Artifacts", "color": "#ff00ff" },
    { "id": "2", "name": "Dungeons", "color": "#00ff00" }
  ],
  "markers": [
    {
      "categoryId": "1",
      "position": [500, 300],
      "popup": {
        "title": "A Sword",
        "description": "Very important artifact",
        "link": {
          "url": "Article about a sword",
          "label": "See more"
        }
      } 
    },
    {
      "categoryId": "2",
      "position": [300, 500],
      "popup": {
        "title": "A Cave",
        "description": "Very scary dungeon",
        "link": {
          "url": "Article about a cave",
          "label": "See more"
        }
      } 
    }
  ] 
}

Viewing a Map

Marker clusters

For ease of display, markers are grouped locally into clusters. Hovering over a cluster will show an outline of the area of the markers contained within that cluster, with the number indicating the quantity. Clicking on a cluster will zoom into that area.

There is currently no way to adjust the sensitivity of the clustering.

嵌入地圖

To get more eyes on your Map, you can embed it into a mainspace article if you wish. Once the Map has been created, it can be transcluded into an article using {{Map:My New Map}} wikitext syntax. More than one Map can be embedded in an article. Maps embedded in articles will have an edit button at the top right of the Map. Clicking this will open the Interactive Maps Editor in a new tab, allowing it to be edited directly.

參見

地圖範例

進一步的帮助與反馈

Advertisement