Skip to content

The Map block

Route Maps adds one block, Map, and it works on any site and in any theme, with or without the RacerPacer plugin. Add it to a page, drop your places on it, and add a GPX if you have one. The maps come from OpenFreeMap, so there’s no API key to get.

The Map block draws the real map while you edit, so what you see is what goes on the page. Everything is set in the block’s sidebar.

The Map block in the editor.

  1. Add a Map block to a page.
  2. Places: click the small map in the sidebar to drop a place, then drag it to the exact spot. Or type a name and press Find on map. Give each place a name (“Start: village hall”) and an optional note (“Water and food”).
  3. Add the checkpoints the same way, in course order, and the finish.
  4. GPX lines: choose the course’s GPX file. Up to six lines on one map.
  5. Switch on Elevation profile and Download the GPX under the GPX lines.
  6. Look: pick a map style and a colour for the marks and the line.
  7. Display: keep the places listed under the map, numbered, each with a Directions link.
  8. Publish.

Places: click the small map to add one, or drag a mark to move it.

GPX lines, with the switches for the profile and the download.

Look: map style, colour, height and zoom.

Display: on the page or in a popup, the list under the map, and waiting for a press.

One place:

One place.

Several places, numbered, with a Directions link each:

Several places, numbered.

Places and a GPX line, with the profile:

Places and a GPX line.

Two GPX lines and no places:

Two GPX lines.

Your own colour for the marks and the line:

Your own colour.

Plain pins, with no list under the map:

Plain pins.

The five map styles are shown in Maps settings.

Under Display:

  • In a popup: the map sits behind a button and opens over the page. Set the button’s words.

    A map in a popup, behind its button.

  • Wait for a press: nothing loads until someone presses Show the map. Worth it when the page is long and the map is near the bottom, when most visitors come for something else, or when you’d rather nothing went to another server unasked. The map library is nearly 1MB of script before the first tile, which is a lot to ask of a phone on one bar of signal at a race start. The elevation profile is drawn into the page itself, so the distance, climb and shape are there before anyone presses anything.

    A map waiting for a press, with its profile already there.

Every map loads only when it’s scrolled into view anyway.

A GPX exported from a watch or Strava carries much more than the route: the time at every point, heart rate and cadence, the device, the activity’s name and often the runner’s own name. With a Download button, all of that would go to anyone who saves the file.

So Route Maps rewrites every GPX as it’s uploaded and keeps only the line: the latitude, longitude and height of each point, and the position and name of any waypoints. Everything else is dropped. The copy in your media library is the clean one; the original isn’t kept. A file with no route that can be read is refused. (A developer who needs the original files can switch the cleaning off with the racerpacer_maps_clean_gpx filter.)

It can’t know which end of the line is someone’s house, though. Trim the start and finish first: see Sharing routes and meeting points safely.

The same map in the classic editor or a page builder:

[rpmap_map points="54.4609,-3.0886,Village hall|54.4802,-3.1104,Lay-by" gpx="123" look="positron" height="360"]

For one place:

[rpmap_map lat="54.4609" lng="-3.0886" name="Village hall"]

points is a list of latitude,longitude,name joined by |. gpx is the GPX file’s ID in the media library (a comma-separated list for several). The other options are title, colour, zoom, display="popup", button (the popup button’s words), and the switches numbered, list, directions, click, profile and download, each yes or no. look is liberty, bright, positron, fiord or dark.

Nothing in Route Maps is about running. A walking group, a hiking club or a cycling club can use it the same way: where to meet, the route, how hilly it is and the stops along the way.

Hollin Ridge Walkers, a made-up walking group: the Wildstride theme in its Forest colours, with one Map block.