RoadNav EU & UK
WP plugin - app for mob devices
by TFA Workspace / OpenAI · github.com/raivis-kalnins/roadnav-eu-uk · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/raivis-kalnins/roadnav-eu-uk/archive/refs/heads/master.zipRoadNav EU & UK WordPress Plugin
RoadNav EU & UK is a lightweight MVP WordPress plugin for a Waze/Google Maps-style road information page. It is designed for the UK, Estonia, Latvia, Lithuania, the Baltic region, and EU countries.
What it does now
Current plugin version: 0.3.0
-
Adds a
[roadnav_eu_uk]shortcode and[roadnav_eu_uk fullscreen="1"]mobile app mode. -
Displays an OpenStreetMap/Leaflet map.
-
Lets visitors choose UK, Estonia, Latvia, Lithuania, Baltic states, EU + UK, or individual EU countries.
-
Lets visitors enter a start and destination.
-
Geocodes locations through your WordPress backend using Nominatim.
-
Calculates a driving route through your WordPress backend using OSRM.
-
Draws the route on the map and shows route distance/time.
-
Includes a no-header/no-footer WordPress page template: RoadNav Fullscreen App.
-
Shows live GPS speed, estimated remaining distance, ETA, and camera count.
-
Can follow the user's live GPS position on mobile.
-
Auto-collapses the route form when live driving starts, leaving a full-map driving view with speed, remaining distance, ETA, and cameras visible.
-
Adds floating mobile controls for Full screen / Exit full, Open route, Details, and Exit live.
-
Hides the black top bar and bottom route summary while driving, with a Details button to temporarily open the route summary.
-
Includes landscape-phone CSS so the metrics and panels move out of the map centre when the phone is rotated horizontally.
-
Uses miles/yards and mph automatically when the selected country is United Kingdom; EU/Baltic countries use km and km/h.
-
Adds Waze-style map controls for zoom in/out, reset/recenter to current GPS location, and follow/following mode.
-
Can request the browser Screen Wake Lock during live navigation so the phone screen stays awake where supported.
-
Smooths the live GPS dot to reduce jumping from noisy mobile GPS samples.
-
Auto-reroutes from current location when live GPS moves away from the route for several seconds.
-
Looks up mapped speed limits near the live GPS location from OpenStreetMap/Overpass where available.
-
Supports saved local places in the browser, including Home and other saved addresses.
-
Can show a small driver contact widget with only configured Call, SMS/Message, and WhatsApp buttons plus a close button.
-
Supports separate traffic GeoJSON feeds and draws congestion as red/orange road lines.
-
Detects mapped fixed camera points and basic average-speed camera ways/relations from OpenStreetMap where mapped. Average-speed zones are drawn as a green line and shown in a left-side live panel with calculated average speed.
-
Loads mapped speed-camera points from OpenStreetMap via Overpass, automatically after routing if enabled.
-
Allows visitors to submit accident, roadworks, closure, traffic, camera, or hazard reports.
-
Allows admins to approve user reports in WordPress.
-
Supports external GeoJSON roadwork/incident feeds configured in plugin settings.
Installation
- Upload the
roadnav-eu-ukfolder towp-content/plugins/, or upload the ZIP in WordPress Admin > Plugins > Add New > Upload Plugin. - Activate RoadNav EU & UK.
- Go to Settings > RoadNav EU & UK.
- Create a WordPress page and add:
[roadnav_eu_uk]
For a fullscreen mobile navigation page such as /go/, create or edit that page, choose the RoadNav Fullscreen App page template, and add:
[roadnav_eu_uk fullscreen="1"]
If the fullscreen-template page content is left empty, the template renders [roadnav_eu_uk fullscreen="1"] automatically. The alias [road_navigation_app] also works.
Fullscreen/mobile notes
- Use the floating Full screen button at the top-right of the map for a cleaner mobile view. The button changes to Exit full when browser fullscreen is active. Some mobile browsers may not allow true browser fullscreen; in that case the plugin uses a compact full-map fallback.
- When live mode starts, the route form, black top bar, and route-summary text area are automatically hidden for a cleaner driving view. Tap the floating Open route button to bring the form back.
- Tap Details during live mode to temporarily show the route summary, then Hide details to return to full-map driving view.
- Tap Exit live to stop GPS following.
- In landscape phone orientation, the live metrics become a compact block at the lower-left and panels open as side overlays.
- The fullscreen template intentionally does not call your active theme's header or footer. It still calls
wp_head()andwp_footer()so plugin assets, analytics, and WordPress scripts can load. - Mobile live mode requires HTTPS and browser location permission.
- Screen wake lock also requires browser support, HTTPS, and a user action. If the browser blocks wake lock, live navigation still works but the operating system may still dim/sleep.
- Speed is read from the device GPS when available. Where the browser/device does not provide GPS speed, the plugin estimates speed from position changes.
- Remaining distance is estimated from the current GPS point to the drawn route and destination. Auto-reroute is basic and uses the current OSRM-compatible routing endpoint. For production-grade turn-by-turn instructions, map matching, lane guidance, and traffic-aware rerouting, connect a dedicated navigation SDK/API.
Important production notes
The default setup uses public demo/open services:
- OpenStreetMap tile server
- Nominatim public geocoding
- OSRM public routing demo server
- Overpass public API
These are suitable for testing and low-volume prototypes only. For production, use paid or self-hosted services such as:
- A dedicated tile provider or your own tile server
- A paid/self-hosted Nominatim, Pelias, Photon, Mapbox, Google, TomTom, Here, etc. geocoder
- A paid/self-hosted OSRM, GraphHopper, Valhalla, OpenRouteService, Mapbox, Google Routes, TomTom, Here, etc. routing service
- Official National Access Point / DATEX II road feeds converted into GeoJSON
External GeoJSON feeds
In Settings > RoadNav EU & UK, use External GeoJSON feeds like this:
[
{
"country": "uk",
"name": "My UK roadworks feed",
"url": "https://example.com/uk-roadworks.geojson",
"type": "roadwork"
},
{
"country": "lv",
"name": "My Latvia incidents feed",
"url": "https://example.com/lv-incidents.geojson",
"type": "hazard"
}
]
Each feed must return GeoJSON FeatureCollection. Feature properties can include:
titleornamedescriptionordetailskind:accident,roadwork,closure,traffic,camera, orhazard
Traffic GeoJSON feeds
Google live traffic cannot simply be copied onto OpenStreetMap/Leaflet tiles. To show traffic with this plugin, configure Traffic GeoJSON feeds in Settings > RoadNav EU & UK. The feed should return GeoJSON LineString or MultiLineString features for congested road sections.
Example:
[
{
"country": "uk",
"name": "My traffic feed",
"url": "https://example.com/traffic.geojson"
}
]
Recommended traffic feature properties:
titleornamedescriptionordetailsseverity:heavy,moderate, orslow
Heavy traffic is shown as a red line, moderate as amber, and slow/lighter congestion as orange.
Speed limits and average-speed cameras
Speed limits and camera data come from OpenStreetMap/Overpass by default. Coverage depends on what local mappers have added. The speed-limit display is advisory only and may be missing or wrong on some roads.
Average-speed camera support looks for mapped OSM objects such as enforcement=average_speed and average_speed. When a line/section is available, the plugin draws it green and calculates a simple average speed from the point where the driver entered the detected zone.
Saved places
Saved places are stored in the visitor's browser local storage. They are not sent to WordPress unless the user types or routes to them. Save a destination as Home to make the Home button work.
Driver contact widget
Enable this in Settings > RoadNav EU & UK and enter only the phone/WhatsApp numbers you want to show. The widget displays Call, Message/SMS, and WhatsApp links plus a close button. If a visitor closes it, it stays hidden in that browser until local storage is cleared.
Suggested next build steps
- Add a background importer that converts official DATEX II and national traffic feeds to GeoJSON and caches them.
- Add moderation/rate limiting for public reports.
- Add report expiry rules, for example traffic reports expire after 2 hours, roadworks after 7 days.
- Add PWA support for installable mobile experience.
- Add voice alerts, distance-to-camera warnings, and average-speed-zone warnings.
- Move heavy routing/geocoding to production APIs.
Safety
This plugin is a planning and road-information aid. It should not encourage typing or interacting with the app while driving. Always design the public page with hands-free use in mind.