Tracking & Zones
Monitor agent locations in real-time and define geographic zones for smarter task assignment.
Live Agent Tracking
The dashboard includes a live map that shows the real-time positions of all active agents in your organization. This is powered by Socket.IO and the Deliverty Driver mobile app.
How It Works
- The Deliverty Driver app sends GPS location updates via the
/trackingWebSocket namespace. - Location updates are sent approximately every 15 seconds with a minimum distance threshold of 10 meters to avoid redundant updates.
- The dashboard receives these updates in real-time and renders agent positions on a Leaflet map.
- Each agent is shown as a marker with their name and current status.
Map Features
- Agent markers: Custom markers show each agent's position, colored by their current status (available, on task, offline).
- Task markers: Pickup and drop-off locations for active tasks are shown on the map.
- Clustering: When zoomed out, nearby markers are grouped into clusters for readability.
- Click to details: Clicking an agent marker opens a popup with their name, active task (if any), and contact details.
- Auto-center: The map can auto-center on your organization's active area.
Agent Status on Map
| Status | Map Indicator | Meaning |
|---|---|---|
| Available | Green marker | Agent is online and ready to accept tasks |
| On Task | Blue marker | Agent is currently assigned to or working on a task |
| In Transit | Amber marker with route line | Agent is actively en route to a pickup or drop-off |
| Offline | Gray marker (faded) | Last known position — agent is not currently online |
Delivery Zones
Zones let you define geographic areas for organizing your delivery operations. Zones are used primarily by the zone-based assignment algorithm to match tasks with agents who operate in the same area.
Creating Zones
Zones are defined in the organization settings. Each zone has:
- Name: A descriptive label (e.g., "Downtown Cairo", "Nasr City", "6th October").
- Boundary: A geographic polygon defined by a set of coordinate points. This can be drawn on the map in the dashboard or defined via coordinates.
- Assigned agents: Agents can be associated with one or more zones, indicating their primary operating area.
Zone-Based Assignment
When the zone-based assignment algorithm is active:
- The system determines which zone the task's pickup or drop-off location falls within.
- Only agents assigned to that zone are considered for the task.
- Among the eligible agents, the system applies additional criteria (availability, current load) to select the best match.
If no agents are available in the task's zone, the system can optionally fall back to searching in adjacent zones or across all agents (configurable in the assignment configuration).
Location Data
Each task has a location record that stores:
| Field | Description |
|---|---|
pickupAddress | Human-readable pickup address |
pickupLatitude / pickupLongitude | GPS coordinates for the pickup point |
dropoffAddress | Human-readable drop-off address |
dropoffLatitude / dropoffLongitude | GPS coordinates for the drop-off point |
These coordinates are used for map rendering, distance calculations, and zone matching.
The tracking map uses Socket.IO to receive real-time updates. No polling is needed — the dashboard automatically reflects agent movements as they happen. The connection uses the /tracking namespace on the backend WebSocket server.
