Every overlay you see in the layer control panel is the result of three coordinated pieces: a GeoJSON data file inDocumentation 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.
scripts/ that exposes your data as a global JavaScript variable, a Leaflet layer variable declared in index.html that wraps that data with display options, and an entry in the groupedOverlays object that registers the layer under a named group in the control panel. All three must be in place before a new dataset appears on the map.
Create a
.js file inside the scripts/ directory. The file must assign your GeoJSON object to a global variable — that variable name is how index.html will reference the data.var MisComercios = {
"type": "FeatureCollection",
"name": "MisComercios",
"features": [
{
"type": "Feature",
"properties": { "Nombre": "Librería Central", "Direccion": "Av. San Martín 1234" },
"geometry": { "type": "Point", "coordinates": [-68.848, -32.925] }
}
]
};
In the
<!-- GEOJSON --> section of index.html (where all the other scripts/ data files are loaded), add a new <script> tag:Keep this alongside the other data script tags so it is loaded before the map initialisation code runs.
Inside the
<body> script block, in the /* OVERLAYS Y GRUPOS */ section, declare a new Leaflet GeoJSON layer variable. Use pointToLayer to assign an icon factory and onEachFeature to bind a popup:var misComercios = L.geoJson(MisComercios, {
pointToLayer: crearIconoComercio,
onEachFeature: agregarPopupfarmacias
});
See Icons & Styles for the full list of available
pointToLayer factory functions, and Popups for available onEachFeature popup functions.In the
groupedOverlays object, add your new variable under an existing group key or create a new group entirely. The string key you provide here is the label that appears in the layer control panel."COMERCIO": {
"Bares y Comidas": bar,
"Casas de Té y Café": cafe,
"Heladerías": hela,
"Farmacias": farmacias,
"Restaurantes": resto,
"Hipermercados": hiper,
"Supermercados": supermer,
"Mis Comercios": misComercios, // new entry
},
Polygon and line layers
Point layers usepointToLayer to render markers, but polygon and line layers skip that option and use setStyle() instead to control colour, fill, and border weight. Chain setStyle() directly on the L.geoJson() call:
index.html for layers such as barrios, barriospopulares, espverdes, and all the node district polygons. The setStyle() method accepts any Leaflet Path options including color, weight, opacity, fillColor, fillOpacity, and dashArray.