TrailView is a simple PHP application that fetches and displays data from a Garmin MapShare KML file. The app extracts GPS coordinates, velocity, and other data from the KML feed and provides a link to open the location in Google Maps. It's designed for users who want to visualize their trail or outdoor activity data in an easy-to-read format.
- Fetch KML Data: Provides Garmin MapShare details like coordinates, speed (in mph), and the last updated timestamp.
- Google Maps Integration: Generates a link to open the last recorded GPS location in Google Maps.
- Garmin MapShare Link: Provides a direct link to the MapShare page.
- Clipboard Functionality: Users can copy the GPS coordinates to their clipboard.
- Automatic Page Refresh: A button to refresh the displayed data.
- Input: The app accepts either a Garmin MapShare URL or a user-specific identifier (
q
parameter) via the query string.- Example:
https://your-domain.com?q=DJFOX
orhttps://your-domain.com?q=https://inreach.garmin.com/feed/share/DJFOX
.
- Example:
- Processing: It fetches and parses the KML feed data associated with the provided Garmin MapShare link.
- Output: Displays the extracted information including the placemark's name, last update timestamp, and speed. You can also view the location on Google Maps or the Garmin MapShare page.
If no input (q
parameter) is provided, the app defaults to an example Garmin MapShare ID:
- KML Feed:
https://inreach.garmin.com/feed/share/DJFOX
- MapShare Link:
https://share.garmin.com/DJFOX
You can also pass your own Garmin MapShare ID or feed URL:
https://your-domain.com/?q=<Garmin-MapShare-ID-or-URL>
https://your-domain.com/?q=DJFOX
or
https://your-domain.com/?q=https://inreach.garmin.com/feed/share/DJFOX
You can quickly run the app using PHP's built-in web server, which is ideal for local development.
- Open a terminal or command prompt.
- Navigate to the directory where your PHP file is located.
- Run the following command to start the PHP web server on port 8000:
php -S localhost:8000
- Open a web browser and visit:
http://localhost:8000
You can now access your TrailView app locally.
- PHP Environment: Ensure your web server is running PHP.
- File Setup: Place the PHP file on your web server.
- Access: Use a web browser to navigate to the PHP file and pass the Garmin MapShare URL or ID via the query string.
To deploy your PHP app using Tiiny Host, follow these steps:
-
Prepare Your Project:
- Zip your PHP file and any other required assets (if any) into a
.zip
file.
- Zip your PHP file and any other required assets (if any) into a
-
Upload to Tiiny Host:
- Visit the Tiiny Host website.
- Click "Upload" and select the
.zip
file you created. - Enter your subdomain name and deploy the app.
-
Access the App:
- Once the deployment is complete, you'll be provided with a link where your app is hosted. You can now access and share your PHP app directly from the Tiiny Host URL.
- isValidUrl: Validates if the provided input is a valid URL.
- kmhToMph: Converts speed from kilometers per hour to miles per hour.
- getMapId: Extracts the MapShare ID from a Garmin URL.
- PHP 5.3 or higher
- SimpleXML Extension (used for parsing KML)
This project is open source and available under the MIT License.
- Garmin MapShare: Data provided by Garmin MapShare's KML feed.