
內容簡介
Tiles Proxy for OpenStreetMap 提供一個基本的代理,允許其他 OpenStreetMap 外掛從你的伺服器載入地圖圖磚,而不是從 OpenStreetMap 伺服器載入。
貢獻: https://github.com/moewe-io/osm-tiles-proxy
已知可與以下外掛配合使用
Leaflet Map
Custom Post Type to Map Store
Geolocation
有其他外掛? 讓我們 知道。
注意事項
注意: 根據你的地圖和需要的圖磚,需要大量的儲存空間。
可能比官方伺服器慢 (取決於你的伺服器)
首次請求可能會比較慢,因為地圖圖磚在請求時進行快取
過濾器
你可以使用過濾器從外掛程式中獲取 URL :
$proxy_cached_url = apply_filters( 'osm_tiles_proxy_get_proxy_url', $proxy_cached_url );
$proxy_rest_api_url = apply_filters( 'osm_tiles_proxy_get_proxy_rest_url', $proxy_rest_api_url );
$leadlet_js_url = apply_filters( 'osm_tiles_proxy_get_leaflet_js_url', $leadlet_js_url );
$leadlet_css_url = apply_filters( 'osm_tiles_proxy_get_leaflet_css_url', $leadlet_css_url );
常數
要在 WP Rocket 或 WP Fastest Cache 使其緩存失效時禁用,可以在wp-config.php中設定以下常數
define( 'OSM_PROXY_DISABLE_CLEAR_CACHE', true );
外掛標籤
開發者團隊
② 後台搜尋「Tiles Proxy for OpenStreetMap」→ 直接安裝(推薦)
原文外掛簡介
Tiles Proxy for OpenStreetMap provides a basic proxy, which allows other OpenStreetMap plugins to load map tiles from your server instead from OpenStreetMap servers.
Sponsor: sachsen.tours
Contribute: https://github.com/moewe-io/osm-tiles-proxy
Known to work with these plugins
Leaflet Map
Custom Post Type to Map Store
Geolocation
Another plugin? Let us know.
Notes
Beware: Depending on your map and the tiles you need, a lot of storage is needed.
Might be slower than official servers (depends on your server)
First requests might be slow as map tiles are cached on request
Filters
You can use filters to get the URLs from the plugin:
$proxy_cached_url = apply_filters( 'osm_tiles_proxy_get_proxy_url', $proxy_cached_url );
$proxy_rest_api_url = apply_filters( 'osm_tiles_proxy_get_proxy_rest_url', $proxy_rest_api_url );
$leadlet_js_url = apply_filters( 'osm_tiles_proxy_get_leaflet_js_url', $leadlet_js_url );
$leadlet_css_url = apply_filters( 'osm_tiles_proxy_get_leaflet_css_url', $leadlet_css_url );
Constants
To disable cache invalidation when WP Rocket or WP Fastest Cache invalidate their cache, you can set the following constant in your wp-config.php
define( 'OSM_PROXY_DISABLE_CLEAR_CACHE', true );
