Using GPX files with Geocoder and Geofield
Last updated on
17 April 2024
Here's how to set up Geofield, Geocoder, and Leaflet (optional) to display a track uploaded in .gpx file format.
- Install Geocoder, Geocoder Field, Geocoder Geofield, Geofield, and Leaflet (optional)
- Create a "GPX File" Geocoder provider under /admin/config/system/geocoder/geocoder-provider
- Create a file field in a content type, used to upload a GPX file
- Create a Geofield field in a content type, allowing only one value
- Set up the Geofield field like this:
- Geocode → Geocode from an existing field
- Geocode from an existing field → select file field used to upload the GPX file
- Geocoder plugins → checked "GPX File"
- For the Geofield field, in "Manage display" choose "Leaflet Map" (if available) or just "Raw Output"
- Create new content with an attached GPX file
- The Leaflet map should show the route or point, or if raw value used, something like
POINT (2.862523 42.874582)orMULTILINESTRING ((-3.4584857337177 48.72786023654 [...]
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion