[WordPress] 外掛分享: OS DataHub Maps

首頁外掛目錄 › OS DataHub Maps
WordPress 外掛 OS DataHub Maps 的封面圖片
200+
安裝啟用
★★★★★
5/5 分(16 則評價)
45 天前
最後更新
100%
問題解決
WordPress 4.5+ PHP 5.6.0+ v1.8.4 上架:2020-09-06

內容簡介

這個外掛可以使用在 2020 年推出的新 Ordnance Survey Data Hub 平台中插入地圖到網頁或文章中。它能以傳說中的精細地形細節,顯示英國的 Ordnance Survey 地圖,非常適合用來做步行、騎腳踏車、騎馬或其他戶外活動。此外,你可以加入 GPX 檔案的路線、高度配置和標示有趣地點的標記。

使用這個外掛是接續之前的 OS OpenSpace Maps。透過新的 OS Data Hub 和其套件的 APIs,你現在可以使用 1:25,000 Explorer 地圖和 1:50,000 Landranger 系列。另外免費允許的使用次數更加優渥,通常每月可使用 2,000,000 次。

此外,本外掛使用 Leaflet.js 顯示地圖,提供乾淨的介面和共鳴滑動感受,且具備簡單的縮放控制、全屏顯示和列印功能。在文章、頁面或自訂文章類型中的任意位置加入 [osmap] 的詞句即可顯示地圖。

地圖是透過 shortcode attributes 來設定的,而這些屬性已經多到無法在此 Readme 檔案中描述所有。如需完整的說明,請查看外掛主頁面。

其他 Shortcodes

使用 [osmap_marker color=red] 直接內嵌標記圖示來說明地圖內容並與您的文字內容連結。

使用 [osmap_link marker=1 zoom=8] 連結中加入 marker_link=link 屬性與文字搭配使用,當點選連結時,頁面會滾動到相同位置、縮放到標記位置並且開啟標記。

範例

[osmap] 在預設高度和縮放率下顯示一張地圖,中心點設在南安普敦的 OS 總部。這是最簡單的方法來測試此外掛是否運行正確。

[osmap height="300" width="300" color="blue" gpx="http://www.example.co.uk/myfile.gpx"] 開啟一個 300 像素乘 300 像素大小的視窗,其中包含一條藍色的跟踪路徑。

[osmap markers="NY2000008000;Wasdale"] 顯示預設大小和縮放率的視窗並在其上標示"Wasdale"的地點。

從 OS OpenSpace Maps 遷移

Ordnance Survey 已將 OpenSpace Maps 服務遷移,現在改以 Data Hub Maps 服務為主。本外掛的作用是提供一個無縫的升級體驗,並且可以使用相同的 shortcode,支持所有相同的屬性

Data Hub 服務是 OpenSpace 的大幅升級版,允許使用優秀的 1:25,000 Explorer 地圖。而且免費使用次數更加寬廣,通常每月可使用 2 百萬次。

此外,本外掛本身也是一個重大的更新,比最初的 OpenSpace 外掛提供了更多功能。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.8.4) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「OS DataHub Maps」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

This plugin allows maps to be inserted into a page or post using the new Ordnance Survey Data Hub platform which launched in 2020. It displays UK Ordnance Survey maps with their legendary level of topographical detail, making them ideal for walking, cycling, riding, and just about anything outdoors-related. You can add routes from GPX files, elevation profiles, and markers for points of interest.
The plugin takes over where the previous plugin, OS OpenSpace Maps, left off. Using the new OS Data Hub and its suite of APIs, you now have access to the full 1:25,000 Explorer mapping as well as the 1:50,000 Landranger series. And the free allowances are a lot more generous, offering typically 2,000,000 map views per month.
This plugin uses Leaflet.js to display the maps, giving a clean interface and a responsive feel with easy zoom control, full screen view and even printing. Insert the [osmap] shortcode anywhere in your post, page or custom post type content to display a map.
The map is set up using shortcode attributes, and there are now more of these than can be described in this Readme file. For full details, please check the plugin homepage.
Additional Shortcodes
Display one of the marker icons inline with your text using [osmap_marker color=red]. This may be used to add annotation to your maps.
Use [osmap_link marker=1 zoom=8] in conjunction with marker_link=link attribute to embedded a link within text on the page. When clicked, the map will be scrolled into view, zoomed onto the marker position and the marker opened.
Examples

[osmap] displays a map at the default height and zoom level, centred on OS headquarters in Southampton. This is the simplest way to test that the plugin is working.

[osmap height="300" width="300" color="blue" gpx="http://www.example.co.uk/myfile.gpx"] displays a 300px by 300px window containing a blue track from the file specified.

[osmap markers="NY2000008000;Wasdale"]shows a default size and zoom window with a marker placed and the popup text “Wasdale”

Migration from OS OpenSpace Maps
Ordnance Survey has now shut down the OpenSpace Maps service. This plugin aims to give a seamless upgrade to use the new Data Hub Maps service instead. It uses the same shortcode and all the same attributes are supported.
The Data Hub service is a significant upgrade from OpenSpace, allowing use of the excellent 1:25,000 Explorer mapping. It also has a much more generous free data allowance, typically 2 million map views per month.
The plugin itself is also a major upgrade, with many more features than the original OpenSpace plugin.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon