內容簡介
Geolocation 外掛允許 WordPress 使用者在「編輯文章」頁面或任何支援地理位置功能的 WordPress 行動應用程式 (例如:WordPress for iPhone/iPad、WordPress for Android),或手動輸入地理位置資訊,將文章的地理標籤加到其文章上。只需啟用公開訪問,即可顯示該位置的描述和漂亮的地圖小工具。
(不幸的是,WordPress 行動應用程式的開發人員決定停用將 GPS 數據存儲在應用程式中的功能,但我希望它能夠回歸。)
方便的方法是避免將照片作為文章的特色圖片。如果您將特色圖片從文章中分離出來,則該圖片的 GPS 坐標會被考慮在內,如果早先沒有提供地理位置信息的話。如果您使用 iPhone 拍攝照片,請確保以 jpg 格式拍攝。否則,將照片以 HEIC 格式輸出為 JPG 並上傳時,GPS 信息將從照片中剥離。此外,在使用 WP 應用程式時,請確保已啟用將上傳的所有元數據存儲在檔案中的功能。否則,應用程式將刪除 GPS 資訊。
訪客可以在文章前、文章後或文章中的自訂地點看到地址的簡短描述。在滑鼠游標懸停在地址上時,會顯示地圖,顯示文章的確切位置。
如果只想顯示純文字版本而不訪問任何外部服務或不要在訪客看到文章時顯示地圖,您可以啟用 "純文本" 模式,以防止外部人員存取(除了作者以外)。這樣,外部 API 僅在登錄的使用者訪問站點時或進行文章存儲時使用。如果使用 Open Streetmaps 作為地圖提供者並結合 OSM 的代理插件,則瓦片會從本地代理傳遞,以便訪客無法從第三方追蹤。如果未安裝代理或使用 Google Maps 作為提供者,則無法實現這一點,即瓦片直接從訪客的瀏覽器中獲取。
此外,還有使用標籤 [geolocation] 在頁面上提供包含多個項目(例如:旅程中的多個位置)地圖的選項。顯示的位置集可以根據頁面進行過濾,方法是放置名為“category”的自定義欄位並將其命名(不是短名!)為要顯示的類別。這樣,您還可以通過選擇“代碼選項”而不使用它來隱藏文章中的位置信息,並在需要時僅顯示概覽地圖。如果該頁面未受任何類別限制,則會顯示所有已標記為“public”並開啟開關的位置。
此外,默认情况下,此外掛使用 Open-Streetmap,但可以使用谷歌地图作為替代方案(也具有向後兼容性)。但是,使用 Google 地圖來使用此外掛需要一個 Google 地图 API 金鑰。您可以通過 Google Cloud 平臺獲取金鑰。請確保您已啟用"Maps JavaScript API"和"Geocoding API"。
如果在安裝中遇到任何問題或有功能要求,隨時請咨詢support request。如果您對此外掛感到滿意,請給予評論(review),我將非常感激您的反饋。
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
The Geolocation plugin allows WordPress users to geotag their posts using the Edit Post page.
Previously, in all WordPress mobile applications such as WordPress for iPhone/iPad, WordPress for Android this was directly available by activating the gps functionality. Unfortunately, the WP-application developers decided to deactivate the feature of storing GPS data in the app but I am hoping for its return.
The automated way to obtain geoinformation is possible by adding a photo as featured image to your post. If you have a featured image attached to you post, its gps coordinates are taken into concideration if there is no geo-information provided already. If you use an iPhone, make sure that you take your photos in jpg. Otherwise the GPS information is stripped from the HEIC when exporting to JPG and uploading. Furthermore, when using the WP app, make sure you have enabled to keep all metadata in the files that are uploade. Otherwise, the app will remove also the GPS information.
Once there is geoinformation added to any of your posts, visitors see a short description of the address either before, after, or at a custom location within the post. Here, you have three options as shown below: plain, link or static information.
When “link” is chosen, hovering over the address reveals a map that displays the post’s exact location.
If one would only like to show a textual version without accessing any external services or without showing a map when visitors see a post, one can enable a “plain” mode to prevent external access except for authors to set a particular location.
Furthermore, there is an option to statically show the map whenever there is geoinformation available. (see below for examples)
You can chose between two map providers: Google Maps and Open Streetmaps. If you use Open Streetmaps as mapprovider in combination with the proxy plugin for OSM, the tiles are delivered from the local proxy so that the visitors cannot be tracked from a third party. If no proxy is installed or Google Maps is used as the provider, this is not feasable, i.e., the tiles are pulled directly from the map service to your visitor’s browser.
Furthermore, there is the option to use the tag [geolocation] also on a page in order to provide a map with multiple entries (e.g. from a journey) on one map altogether. The set of shown locations can be filtered per page, by placing a user defined field called “category” and give it the name (not the slag!) of the category to be shown. This way, you can also hide the location information per post (by chosing the “code option” without using it) and only show an overview map if needed. If the page is not restricted by any of the categories, all locations are shown that were tagged “public” and have the switch set to “enabled”. (see example below)
By default, this plugin uses Open-Streetmap but as an alternative (and backwards-compatibility) google maps can also be used. However, one needs to have a Goole Maps API key to use this plugin with google maps. You may obtain a key via google cloud plattform. Make sure, you have activated “Maps JavaScript API” as well as “Geocoding API”.
If you struggle while installing it or have feature requests, please feel free to drop a support request anytime. I am more than happy to help you. Also if you would want to give a review if you are happy with the plugin, I would appreciate the feedback.
