Linux 软件免费装
Banner图

GPX Route Map

开发者 sirlouen
更新时间 2026年7月28日 05:59
PHP版本: 7.4 及以上
WordPress版本: 7.0
版权: GPLv2 or later
版权网址: 版权信息

标签

map gpx route openstreetmap elevation

下载

1.0.0 1.1.0 1.2.0

详情介绍:

GPX Route Map turns a GPX file into an interactive map on the front end of your site. Drop the block into any post or page, pick a .gpx file, and visitors get: The map loads lazily (only when it scrolls into view) so it never slows down your page, and multiple maps can live on the same page. You can author tracks in any GPX tool, for example the free gpx.studio editor, then upload the resulting file to your Media Library. OpenStreetMap tile usage By default the map uses OpenStreetMap's public tile server, an external service. When a page with a map is viewed, the visitor's browser loads map tiles directly from tile.openstreetmap.org, which means that server receives the visitor's IP address, browser User-Agent and the coordinates of the map area viewed. See the OpenStreetMap Tile Usage Policy and the OSMF Privacy Policy. The same data is sent to any custom tile provider you configure instead. The public OSM tile server is rate-limited and is not intended for high-traffic sites. For busy sites, set a custom tile provider in the block's Map tiles panel (or via the gpxrm_tile_url filter). Attribution to OpenStreetMap is always shown, as the license requires. Source code The front-end JavaScript in build/ is minified (the block editor script is not, so that its strings stay translatable). The human-readable source lives in the plugin's src/ directory, which is included in this plugin, and is also available with full build instructions at the public repository: https://github.com/SirLouen/gpx-route-map. The plugin is built with Vite (pnpm install && pnpm run build).

安装:

  1. Upload the gpx-route-map folder to /wp-content/plugins/, or install through the Plugins screen.
  2. Activate the plugin.
  3. Add the GPX Route Map block to a post or page and select a GPX file, or use the shortcode.

屏幕截图:

  • Selecting a GPX file in the block editor.

升级注意事项:

1.2.0 Adds a full Spanish translation and makes every remaining string translatable. 1.1.0 Statistics are now computed in the browser and stored with each block. Existing GPX blocks keep working; re-save one to refresh the statistics shown without JavaScript. 1.0.0 Initial release.

常见问题:

Does it require Advanced Custom Fields or any other plugin?

No. It has no plugin dependencies and works with core WordPress.

Where do the maps and elevation come from?

Map rendering uses MapLibre GL JS (BSD-3-Clause) with OpenStreetMap raster tiles. The track, elevation profile and the distance/elevation stats are all computed from your GPX file in the browser. When you add the block, those stats are saved with it so the summary still shows without JavaScript.

Can I use my own map tiles?

Yes, set a custom tile URL in the block's Map tiles panel or with the gpxrm_tile_url filter.

Can I link a GPX file hosted on another site?

Only if that host allows cross-origin (CORS) requests, because the visitor's browser fetches the file directly, and most external sites don't send the required header. The front end then shows "Could not load GPX file." even though the link opens fine in a browser tab. Uploading the file to your Media Library is the reliable option.

Why don't my existing GPX files appear in the media picker?

GPX files uploaded before this plugin was activated may be stored with a generic XML type or no type at all. The picker shows GPX and XML types; files stored with an empty or unrelated type won't appear. Re-upload them to fix the stored type. On multisite, the network's "Upload file types" setting must also include gpx.

The front end says "Map failed to load." What's wrong?

The map library could not be downloaded. The plugin loads its map code as a native JavaScript module, which optimization plugins normally leave alone. But if yours is configured to combine, inline or relocate module scripts, exclude this plugin's view script from it. Visitors on a flaky connection can simply click the message to retry.

更新日志:

1.2.0 1.1.0 1.0.0