Managing Geofences
Geofences are custom map areas — polygons or lines — that NexaBus uses to detect when a vehicle enters or exits a specific zone. Unlike Stops, which are always simple circles tied to passenger pickup/drop-off, Geofences can be any shape and are meant for broader monitoring: restricted zones, service areas, speed zones, and similar use cases.
Accessing Geofences
Geofences has its own entry in the left-hand navigation menu, under the Transportation section.
Viewing Geofences
The Geofences table displays the following columns:
- ID: Unique identifier (hidden by default)
- Name: Geofence name
- Description: Optional description
- Shape: Polygon, Line, or Circle
- Sync Status: Connection status with visual indicators
On mobile devices, columns like ID, Description, Shape, and Sync Status are automatically hidden for better readability.
Searching for Geofences
Use the search field to find geofences. The search works across name and description fields. Results update as you type.
Customizing Columns
- Click the Columns button above the table.
- Check or uncheck columns to show or hide them.
Adding a Geofence
- Click the Add Geofence button.
- Complete the two tabs:
General Tab
- Name (Required): A descriptive name for the geofence (e.g., "Downtown Restricted Zone")
- Description (Optional): Additional information about the geofence
- Map: Draw the shape (see below)
Drawing the Shape
The map includes a drawing toolbar in the top-left corner:
- Polygon tool: Click to place each corner of the shape, then click the first point again (or double-click) to close it.
- Line tool: Click to place each point along the line, then double-click to finish.
- Trash tool: Deletes the current shape so you can redraw it.
The map also includes a search box and a "use my location" button in the top-right, so you can quickly jump to the area you want to draw in.
Once a shape is drawn:
- A confirmation message appears and the map's hint text updates to reflect that a shape is ready.
- The Create Geofence button is disabled until a shape exists.
- You can drag any point on the shape to adjust it, or use the trash tool and draw again.
Details Tab
All fields here are optional and control how the geofence is drawn on the map:
- Color: Pick a color for the shape's outline and fill. Defaults to blue if not set.
- Line Width: Thickness of the outline in pixels. Default: 2.
- Line Opacity: Transparency of the outline, from 0 (fully transparent) to 1 (fully opaque). Default: 1.
- Speed Limit (km/h): A speed limit for this zone. While a vehicle is inside the zone, this limit replaces the vehicle's own speed limit for Speed Limit Exceeded alerts and overspeed events — useful for site speed zones.
- Line Corridor Width (m): Only shown for line geofences. A vehicle counts as inside the geofence while it's within this many meters of the line on either side. This allows for normal GPS inaccuracy. Default: 25. If vehicles on the route trigger repeated exit/enter events, increase it (30–50 m usually works well on roads).
- Floor / Ceiling: Altitude range, for geofences that apply to a specific building floor or elevation band.
- Hide from map: When enabled, the geofence is excluded from the live Tracking page map (it still exists and still generates enter/exit events — it just isn't drawn).
- Click Create Geofence.
Very detailed shapes can't be saved: if a shape has too many points, the form shows an error under the map. Remove some points, or redraw the shape with fewer.
Creating a Geofence from a Recorded Route
Instead of drawing a line by hand, you can create one from a vehicle's actual trip. Generate the trip in the Replay report, click the geofence button next to the export button, and select Create geofence from route. This page then opens with the Add Geofence form filled in and the route drawn on the map, ready to adjust and save.
You can also create one from a planned route: on the Routes page, open a route's actions menu and select Create Geofence. The line follows the route's suggested driving path through its stops, rather than a recorded trip.
This is useful for fixed routes that vehicles drive every day: vehicles linked to the geofence generate an exit event when they leave the route.
Editing a Geofence
- Find the geofence in the table.
- Click the actions menu (three dots) in that row.
- Select Edit.
- The map automatically zooms to the existing shape. Adjust the shape, name, description, or Details tab fields as needed.
- Click Update Geofence.
Viewing a Geofence
- Find the geofence in the table.
- Click the actions menu (three dots) in that row.
- Select View.
This opens a read-only map showing the geofence's shape, color, and line styling.
Deleting a Geofence
- Find the geofence in the table.
- Click the actions menu (three dots) in that row.
- Select Delete.
- Confirm the deletion.
Understanding Sync Status
Geofences sync with the tracking server in real-time:
- Syncing: Spinning icon indicates sync in progress (yellow)
- Synced: Check icon confirms successful synchronization (green)
- Failed: Error icon indicates sync failed - click to retry (red)
Sync status updates automatically without refreshing the page.
Retry Sync
If a geofence shows "Failed" status:
- Click the sync status button, or
- Open the actions menu and select Retry Sync
The geofence will attempt to sync again with the tracking server.
Linking Geofences to Devices and Groups
Beyond the geofence itself, you can control which devices or device groups are associated with it:
- When adding or editing a Device, use the Geofences field in the Details tab to select one or more geofences.
- When adding or editing a Vehicle, use the Geofences field in the General tab — this assigns the geofences to the vehicle's linked device, so it's the same assignment shown on that Device.
- When adding or editing a Group, use the Geofences field to link geofences to every device in that group.
This determines which vehicles' movements are checked against the geofence for enter/exit events.
Geofences on the Tracking Map
Geofences (aside from any marked "Hide from map") appear as shaded shapes with their name labeled on the live Tracking page map, using the same color and line styling configured in the Details tab.
Pagination
The table displays 10 geofences per page. Use the pagination controls at the bottom to navigate:
- First and Last page buttons
- Previous and Next page buttons
- Current page indicator showing "Showing X to Y of Z"
Permissions
You need the appropriate permissions to add, edit, or delete geofences:
- Create: Requires geofence:create permission
- View: Requires geofence:view permission
- Edit: Requires geofence:update permission
- Delete: Requires geofence:delete permission
If these options are not visible, contact your administrator to request access.