This page explains how the Nodos repository is laid out and how every part connects to the others at runtime. The project deliberately avoids abstractions — there is no module system, no component framework, and no generated output. Understanding the file tree is essentially equivalent to understanding the entire architecture.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Observatorio-GC/Nodos/llms.txt
Use this file to discover all available pages before exploring further.
The project contains no
package.json, no build tool, and no module bundler. All third-party dependencies are either loaded from the unpkg CDN (Leaflet itself and togeojson) or bundled as plain .js files inside scripts/.Directory tree
Directory roles
css/ — Holds all stylesheet files. style.css is the hand-authored application stylesheet: it sets the Playfair Display font on the <h1> title and the Leaflet attribution control, defines the #map element height (responsive across breakpoints from 350 px up to 1920 px), and styles the fixed-position #referencias legend panel that appears when certain layers (ciclovías, caminabilidad) are toggled on. The remaining CSS files are distributed stylesheets for Leaflet plugins and are loaded verbatim.
js/ — Contains the hand-written JavaScript helpers that supplement index.html. The three files actively loaded by index.html are popups.js, iconos.js, and funcionesMapa.js. They are loaded after all data scripts and the Leaflet library, so they can reference both the global Leaflet L object and the layer variables defined in index.html.
scripts/ — The largest directory. It holds over 110 GeoJSON data files formatted as JavaScript variable declarations, plus the plugin JavaScript files for every Leaflet extension used by the map. Data files and plugin files live together in this flat directory.
img/ — PNG assets used as Leaflet marker icons. Each category of point feature has a dedicated icon (e.g., Asistencia.png for health facilities, Enseñanza.png for schools, Comercio.png for commerce). Several icons exist in two sizes — _r1.png and _r2.png — to support different display densities.
fonts/ — Self-hosted typeface files. Gotham (Bold, Book, Medium in .otf) is used for body text in UI components. Playfair Display (Regular, Bold, Italic, BoldItalic, Black, BlackItalic in .ttf) is used for the map title and the legend panel; it is also loaded from Google Fonts as a fallback via the @import at the top of style.css.
index.html structure
index.html is the single HTML file that ties the entire application together. Its structure is:
<head> — Imports all CSS files (application styles, Leaflet core, plugin stylesheets) and all JavaScript libraries (Leaflet from CDN, togeojson from CDN, then all plugin scripts from scripts/, and finally js/popups.js and js/iconos.js). After the libraries, every GeoJSON data file is loaded with its own <script type="text/javascript" src="scripts/Filename.js"> tag. By the time the <body> executes, all data variables and all helper functions are already in scope.
<header> — Contains inline styles that adjust Leaflet’s font settings, the <h1> title (“Red de Nodos Distritales”), an <img class="logoobserv"> element (hidden on small screens; style.css sets it to visibility: visible at viewports of 1024 px and above), the <div id="map"> element that Leaflet mounts into, and the <div id="referencias"> legend panel. The legend panel holds hidden <div class="icono_referencia"> elements that are shown/hidden by the onOverlayAdd / onOverlayRemove event handlers whenever the user toggles specific layers.
<body> — A single <script> block that:
- Instantiates the base tile layers (ESRI Satellite, Argenmap WMTS, OpenTopoMap, and OpenStreetMap — though only the first three are registered in
baseMaps). - Creates every overlay as a
L.geoJson(...)orL.marker(...)variable. - Calls
L.map('map', { layers: [mapabase_esri, godoycruz] }).setView([-32.9337, -68.8978], 13)to initialise the map. - Calls the style-function helpers (e.g.,
estiloDistritosDepartamentales(),estilocaminabilidad()) that iterate over layers and apply dynamic colours. - Builds the
baseMapsandgroupedOverlaysobjects. - Adds
L.control.mousePosition()to the map.
<script src="js/funcionesMapa.js"></script> is loaded, which registers the grouped layer control, scale bar, polyline measure tool, browser print control, file upload control, and the onOverlayAdd / onOverlayRemove legend-toggle handlers.
Data loading pattern
Each GeoJSON file inscripts/ declares one global variable whose value is a GeoJSON FeatureCollection. Example from scripts/Centrosdesalud.js:
index.html includes this file via a <script> tag:
pointToLayer and instead call .setStyle({ color: "...", fillOpacity: ... }) — or delegate to a dedicated style function for layers whose colours are data-driven (e.g., estiloDistritosDepartamentales() assigns one of nine colours based on each district’s qc_id property).
js/popups.js
This file contains every onEachFeature callback used in the map. Each function accepts (feature, layer), checks whether the relevant properties exist, and calls layer.bindPopup(htmlString). Examples:
estiloDistritosDepartamentales, estilozoni, estilocaminabilidad, etc.) that are called from index.html after the map is created.
js/iconos.js
This file defines the icon infrastructure for all point layers. It works in two stages:
Stage 1 — Extend L.Icon to create reusable base classes with shared anchor and shadow settings:
iconoParaTren uses a smaller iconSize: [20, 20] for transit-stop markers.
Stage 2 — Instantiate icon objects by passing iconUrl to the extended class:
pointToLayer option calls for each GeoJSON point feature:
asignarIcono* object ({ pointToLayer: crearIcono* }) for contexts where the full options object is passed directly to L.geoJson.