Skip to main content

Maps & Charts

GPS Tools provides interactive map visualization and comprehensive data charts. This guide covers configuration and customization options.

Map Providers

GPS Tools supports two map providers:

ProviderCostAPI KeyBest For
OpenStreetMapFreeNot requiredMost users
Google MapsPaid tierRequiredPremium look, satellite

OpenStreetMap (Default)

OpenStreetMap is the default provider, powered by Leaflet.js:

Advantages:

  • ✅ Completely free
  • ✅ No API key required
  • ✅ Privacy-friendly
  • ✅ Extensive worldwide coverage
  • ✅ Active community updates
  • ✅ 15+ tile provider options

Available Tile Providers:

  • OpenStreetMap Standard & Humanitarian
  • OpenTopoMap (Topographic)
  • Stadia Maps (Smooth, Dark, Outdoors)
  • CartoDB (Positron, Dark Matter, Voyager)
  • Esri (Street, Topo, Imagery)
  • Thunderforest (Outdoors, Landscape, Cycle)
  • Custom tile URLs

Google Maps

For a premium map experience:

Advantages:

  • ✅ High-quality tiles
  • ✅ Satellite and hybrid views
  • ✅ 7 built-in map styles
  • ✅ Custom JSON styling support
  • ✅ Street View integration
  • ✅ Familiar interface

Map Types:

  • Roadmap (default)
  • Satellite
  • Terrain
  • Hybrid

Considerations:

  • ❗ Requires API key
  • ❗ Usage costs (free tier available)
  • ❗ API quotas apply

Setting Up Google Maps

Step 1: Create Google Cloud Account

  1. Go to Google Cloud Console
  2. Create or select a project
  3. Enable billing (required, but free tier available)

Step 2: Enable Maps APIs

Enable these APIs for your project:

  1. Maps JavaScript API - Required for map display
  2. Geocoding API - Optional, for location search

Step 3: Create API Key

  1. Go to APIs & Services → Credentials
  2. Click Create Credentials → API Key
  3. Copy the generated key

Step 4: Secure Your API Key

Restrict your API key for security:

  1. Click on your API key
  2. Under Application restrictions, select HTTP referrers
  3. Add your domains:
    https://yoursite.com/*
    https://www.yoursite.com/*
  4. Under API restrictions, select Restrict key
  5. Choose only the APIs you need

Step 5: Configure in GPS Tools

  1. Go to Components → GPS Tools → Options
  2. Paste your key in Google Maps API Key
  3. Set Default Map Provider to "Google Maps"
  4. Save

Google Maps Pricing

Google offers a generous free tier:

UsageFree TierAfter Free Tier
Map Loads28,000/month$7 per 1,000
Static Maps100,000/month$2 per 1,000

Most small to medium sites stay within the free tier.

Map Configuration

GPS Tools offers extensive map configuration options organized into several categories.

General Settings

Configure in Components → GPS Tools → Options:

SettingDefaultDescription
Default Map ProviderOpenStreetMapPrimary map provider (OSM or Google)
Default Zoom13Initial zoom level (1-20)
Track Color#3B82F6Main track line color
Track Width4Line width in pixels (1-10)

OpenStreetMap Tile Providers

GPS Tools supports 15+ tile providers for OpenStreetMap:

ProviderStyleAPI Key
OpenStreetMap StandardClassic OSMNo
Humanitarian (HOT)Humanitarian focusNo
OpenTopoMapTopographicNo
Stadia Smooth/Dark/OutdoorsModern, cleanYes
CartoDB Positron/Dark/VoyagerMinimal stylesNo
Esri World Street/Topo/ImageryProfessionalNo
Thunderforest Outdoors/Landscape/CycleActivity-focusedYes
CustomYour own tilesVaries

Google Maps Styles

When using Google Maps, choose from built-in styles:

StyleDescription
StandardDefault Google Maps
SilverSubtle gray tones
RetroVintage, muted
DarkDark theme
NightNight-optimized
AuberginePurple-tinted dark
MinimalClean, minimal
CustomYour JSON style

Track Display Options

SettingDefaultDescription
Opacity0.85Track transparency
ShadowYesDrop shadow effect
Start/End MarkersYesShow route endpoints
Marker Size8pxEndpoint marker size

Color Modes

Dynamic track coloring based on data:

ModeColors ByGradient
DefaultFixed colorN/A
SpeedVelocityGreen → Red
ElevationAltitudeBlue → Red
Heart RateBPMGreen → Red

Route Animation

Enable animated playback of your tracks:

SettingOptions
PlaybackEnable/Disable
SpeedSlow, Normal, Fast, Very Fast
Marker ColorCustomizable

Zoom Levels Explained

LevelViewBest For
1-4ContinentNot useful for tracks
5-8Country/RegionMulti-day expeditions
9-11City/AreaDay hikes, bike tours
12-14NeighborhoodDetailed routes
15-18StreetRunning paths, urban
19-20BuildingVery precise routes

Track Color Options

Consider activity-based colors:

ActivitySuggested ColorHex Code
HikingForest Green#22C55E
CyclingBlue#3B82F6
RunningOrange#F97316
SkiingIce Blue#0EA5E9
DrivingPurple#8B5CF6

Elevation-Based Coloring

When enabled, tracks are colored by elevation:

ElevationColorExample
LowestGreenValley floor
Low-MidYellowFoothills
Mid-HighOrangeMountain slopes
HighestRedPeaks, summits

Map Features

Interactive Controls

OpenStreetMap Controls:

ControlConfigurablePositions
Zoom +/-Yes4 corners
Scale BarYesBottom left
AttributionYesBottom right

Google Maps Controls:

ControlConfigurablePositions
Zoom +/-Yes8 positions
Map TypeYesTop right
Street ViewYesNear zoom
ScaleYesBottom
FullscreenYesTop right

Map Toolbar

The map toolbar provides quick access to features:

ControlFunction
Color ModeSwitch between default/speed/elevation/HR coloring
Play/PauseStart or pause route animation
ResetReset animation to beginning
FullscreenToggle fullscreen mode

Markers

MarkerMeaning
🟢 GreenTrack start point
🔴 RedTrack end point
📍 BlueWaypoints
🏔️ CustomCategory-specific icons

Popups

Click markers to see:

  • Track/waypoint name
  • Distance and elevation
  • Link to full track view

Scale Bar

Shows real-world distances on the map in the selected unit system.

Charts

GPS Tools provides interactive charts for track analysis.

Available Chart Types

ChartDataColor
ElevationAltitude over distanceGreen (#22C55E)
SpeedSpeed over distanceBlue (#3B82F6)
Heart RateBPM over distanceRed (#EF4444)
CadenceRPM/SPM over distancePurple (#8B5CF6)
PowerWatts over distanceOrange (#F97316)

Chart Features

FeatureDescription
HoverShows exact values at cursor
ZoomClick and drag to zoom
PanShift + drag to pan
ResetDouble-click to reset view
Map SyncHover shows point on map

Chart Configuration

Configure in Components → GPS Tools → Options → Chart Settings:

SettingDefaultOptions
Chart Height200px100-500px
Fill ChartsYesYes/No
Show GridYesYes/No
Show LegendYesYes/No

Data Availability

Not all tracks have all data types:

File FormatElevationSpeedHeart RateCadencePower
GPXCalculatedIf recordedIf recordedIf recorded
KMLCalculated
TCX

Reading Elevation Charts

         ▲ Elevation (m)
2500 │ ●───● Peak
│ ╱ ╲
2000 │ ╱ ╲
│ ╱ ╲
1500 │ ╱ ╲ Descent
│ ╱ Climb ╲
1000 │● ●
└─────────────────────▶ Distance (km)
0 5 10 15 20

Key insights from elevation charts:

  • Steep climbs = Vertical sections
  • Gradual climbs = Angled sections
  • Flat terrain = Horizontal sections
  • Total gain = Sum of all uphill sections

Reading Speed Charts

         ▲ Speed (km/h)
25 │ ●───●
│ ╱ ╲ ●
20 │ ╱ ╲ ╱
│ ╱ ╲ ╱
15 │╱ ●
│ Stop
10 │
└─────────────────────▶ Distance (km)
0 5 10 15 20

Key insights from speed charts:

  • High peaks = Fast sections (downhill, flat)
  • Valleys = Slow sections (uphill, technical)
  • Drops to zero = Stops/breaks
  • Consistent line = Steady pace

Statistics Panel

The statistics panel shows key track metrics:

Distance Stats

StatDescription
Total DistanceFull track length
3D DistanceIncludes elevation changes

Elevation Stats

StatDescription
Elevation GainTotal uphill meters
Elevation LossTotal downhill meters
Max ElevationHighest point
Min ElevationLowest point
Total AscendCumulative ascent
Total DescendCumulative descent

Time Stats

StatDescription
DurationStart to end time
Moving TimeTime in motion
Stopped TimeTime at rest

Speed Stats

StatDescription
Average SpeedTotal distance / total time
Moving AverageDistance / moving time
Max SpeedPeak speed recorded

Fitness Stats (if available)

StatDescription
Avg Heart RateMean BPM
Max Heart RatePeak BPM
CaloriesEstimated energy

Customizing Appearance

CSS Variables

GPS Tools uses CSS variables for theming:

:root {
/* Track colors */
--gpstools-track-color: #3B82F6;
--gpstools-track-width: 3px;

/* Chart colors */
--gpstools-elevation-color: #22C55E;
--gpstools-speed-color: #3B82F6;
--gpstools-heartrate-color: #EF4444;

/* UI colors */
--gpstools-primary: #3B82F6;
--gpstools-background: #ffffff;
--gpstools-text: #1f2937;
}

Custom Map Styles

Override in your template CSS:

/* Map container */
.gpstools-map-container {
border-radius: 12px;
overflow: hidden;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Stats panel */
.gpstools-stats {
background: linear-gradient(135deg, #f8fafc, #f1f5f9);
padding: 1.5rem;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 1rem;
}

/* Chart container */
.gpstools-charts {
padding: 1rem;
background: #ffffff;
}

Responsive Design

GPS Tools is fully responsive:

/* Tablet and smaller */
@media (max-width: 768px) {
.gpstools-map-container {
height: 300px !important;
}

.gpstools-stats {
grid-template-columns: repeat(2, 1fr);
}
}

/* Mobile */
@media (max-width: 480px) {
.gpstools-stats {
grid-template-columns: 1fr;
}
}

Performance Optimization

Track Simplification

For performance, tracks are simplified for display:

  • Original coordinates preserved
  • Display uses Douglas-Peucker algorithm
  • Configurable point limit (default: 1000)
  • Shape maintained, fewer points

Lazy Loading

Enable lazy loading for embedded tracks:

  • Maps load when scrolled into view
  • Reduces initial page load
  • Better Core Web Vitals scores

Caching

Enable caching for better performance:

  • Parsed track data cached
  • Default: 3600 seconds (1 hour)
  • Reduces database queries

Troubleshooting Maps

Map Shows Gray/Blank

  1. Check browser console for errors
  2. Verify API key (for Google Maps)
  3. Check API key restrictions
  4. Ensure HTTPS on production

Track Not Visible

  1. Verify track has coordinates
  2. Check bounds calculation
  3. Try "Fit to Track" button
  4. Check track color vs. background

Slow Map Loading

  1. Enable track simplification
  2. Reduce max display points
  3. Enable lazy loading
  4. Use caching