When you select a destination on the map, UniMaps immediately draws the shortest walking path from your current position to that location. The route is computed by a Dijkstra implementation that runs against a campus graph of 51 nodes and 50 directed connections, all stored in memory on the Laravel backend for fast, zero-query response times.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Jcofles/Proyecto-web/llms.txt
Use this file to discover all available pages before exploring further.
The campus graph
The graph represents every navigable point on the ITFIP campus as a node and every walkable connection between two points as an edge. Here are the key numbers:| Property | Value |
|---|---|
| Total nodes | 51 |
| Total connections | 50 |
| Node types | pasillo, salon, baño, escaleras |
| Graph representation | Adjacency list |
| Distance unit | Meters |
id, a human-readable nombre, latitud/longitud coordinates, a tipo_id (node type), and a piso (floor number). Connections store the Euclidean distance between the two nodes in meters.
How distances are calculated
Before the graph is built, the distance between any two coordinate pairs is measured with the Haversine formula, which accounts for the curvature of the Earth and returns a result in meters:useGeolocation.js for computing the distance between your GPS position and campus nodes.
Dijkstra’s algorithm
The route endpoint uses a standard Dijkstra implementation over the campus adjacency list. It starts at the origin node, relaxes each edge, and reconstructs the path by following parent pointers back from the destination:Because all 51 nodes and 50 connections are stored in a static PHP array (not read from the database), every routing request runs entirely in memory. This eliminates query overhead and keeps response times fast even under concurrent load.
How to request a route
Pick origin and destination
On the map, your current GPS position is automatically snapped to the nearest node in the graph, which becomes the origin. You select the destination from the search box in the bottom-left HUD panel. Typing filters the list to matching mapped zones.Open the map
Navigate to
/map. The app locates you and places a blue marker at the nearest mapped node.Type a destination
Use the “¿A dónde vas?” search field to find a destination. Currently mapped zones are Entrada Universidad, Bloque D, and Cafetería.
Select a result
Tap any result in the dropdown. The route is calculated immediately and drawn on the map as an animated dashed green polyline.
API call
You can also call the route endpoint directly:Route response
A successful response includes the origin and destination node objects, the total distance in meters, the number of steps, and the full ordered list of nodes that make up the path:404 response:
Route visualization
The frontend draws the route as three stacked Leaflet polylines for a glowing effect:| Layer | Color | Purpose |
|---|---|---|
| Glow | #00ff00 at 12% opacity, weight 14 | Soft outer glow |
| Base | #004400 solid, weight 5 | Dark green backbone |
| Dash | #00ff00 dashed, weight 5 | Animated dashes |
| Progress | #ff4444 solid, weight 6 | Portion already walked |