Popup content is defined byDocumentation 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.
onEachFeature callback functions collected in js/popups.js. Each function receives two arguments — feature (the GeoJSON feature object) and layer (the Leaflet layer instance for that feature) — and calls layer.bindPopup(htmlString) with an HTML string built from feature.properties. The map’s L.geoJson() calls in index.html reference these functions by name via the onEachFeature option, so every feature in the dataset gets the same popup template with its own property values substituted in.
Built-in popup patterns
Simplest popup — single property
agregarPopupfarmacias is the minimal pattern used as a fallback for many layers. It renders just the feature name in bold:
js/popups.js
Multi-field popup
agregarPopupfarmaciasgc extends the basic pattern to show address, phone number, and district on separate lines. This is the popup used for the pharmacy layer:
js/popups.js
Image popup
agregarPopupturismo embeds a photo from the img/turismo/ folder using the filename stored in the Fotos property. The image is centred and sized to 200×160 px:
js/popups.js
Node popup with a labelled field
agregarPopupNodos is the popup used for all district node polygons (Grade 1, Grade 2, and proposed nodes). It labels the second field explicitly so the content is self-explanatory:
js/popups.js
Writing a custom popup function
Open
js/popups.js and add a new function at the end of the file. Replace MiCapa, nombre, categoria, and direccion with the actual property names from your GeoJSON dataset (check them with console.log(feature.properties) in your browser’s developer tools if you are unsure):function agregarPopupMiCapa(feature, layer) {
if (feature.properties && feature.properties.nombre) {
layer.bindPopup(
"<strong>" + feature.properties.nombre + "</strong><br/>" +
"Categoría: " + feature.properties.categoria + "<br/>" +
"Dirección: " + feature.properties.direccion
);
}
}
In the
/* OVERLAYS Y GRUPOS */ section of index.html, pass your new function as onEachFeature when declaring the layer:Common popup patterns reference
| Function | Key property checked | Typical content |
|---|---|---|
agregarPopupfarmacias | Nombre | Name only |
agregarPopupfarmaciasgc | Nombre | Name, address, phone, district |
agregarPopupSalud | Nombre_1 | Name and address |
agregarPopupescuelas | Nombre_1 | Name, level, management type |
agregarPopupHospital | Nombre_1 | Name, address, jurisdiction |
agregarPopupturismo | Nombre | Name, location, embedded photo |
agregarPopupGastronomia | Nombre | Name, address, hours, contact |
agregarPopupGastronomia2 | Nombre | Name, address, contact |
agregarPopupNodos | NOMBRE | Name and missing services |
agregarPopupPolos | NOMBRE | Name and planning proposal |
agregarPopupzoni | Layer | Zoning category name |
agregarPopupDistritosDepartamentales | Nombre_1 | District name and area (km²) |
agregarPopupcuencas | Nombre_1 | Watershed name and surface area |
agregarPopupDepen | Nombre_1 | Name; iframe embed if ENLACE present |
agregarPopupCaminabilidad | Name | Street name and walkability description |