Skip to main content

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.

After the Leaflet map and all GeoJSON layers are created, a set of style functions is called to apply dynamic styles based on feature.properties. Each function iterates over its target layer with layer.eachLayer() and calls featureInstanceLayer.setStyle() with a colour derived from a specific property value. This approach allows each feature in a shared layer to be coloured individually without creating separate GeoJSON layers per category.
All style functions documented here are defined in js/popups.js, alongside the popup functions. The calls to those functions appear in the inline <script> block inside index.html. To find or edit a style function, search for function estilo in js/popups.js.

Style functions called at map initialisation

The following calls appear in index.html immediately after L.map() is constructed, under the comment /* FUNCIONES DE ESTILO DE OVERLAYS */:
estiloDistritosDepartamentales();
estilozoni();
estilored();
estilocloacas();
estilocuencas();
estiloley();
estiloinundacion();
estilosuelo();
estilometro();
estilosendero();
estilocaminabilidad();

Function reference

FunctionLayer VariableProperty UsedDescription
estiloDistritosDepartamentales()Depaqc_id (0–8)Colours departmental district polygons by numeric ID; fills at 25% opacity
estilozoni()zonificacionLayer (string)Fills zoning polygons by land-use category name; opacity 35%
estilored()redesaguaid (1–3)Styles water distribution network lines by type ID; opacity 75%
estilocloacas()sistcloacalid (1–3)Styles sewer/cloacal network lines by type ID; opacity 75%
estilocuencas()cuencasqc_id (1–3)Colours hydrological basins with a diagonal stripe pattern via L.StripePattern
estiloley()zonaleyid (1–5)Styles Ley 4886 zone polygons in greyscale shades; opacity 75%
estiloinundacion()inundacionid (1–4)Applies blue flood-risk gradient to inundation zones; opacity 75%
estilosuelo()sueloid (1–3)Colours soil classification polygons; opacity 75%
estilometro()metroid (1–2)Styles the metrotranvía line: red for active track, grey for other segments
estilosendero()sendGeoid (1)Styles the geological trail in burnt-orange (#cf7601); opacity 75%
estilocaminabilidad()trazaPROMEDIO_P (1–4)Colours walkability segments by average score; weight 5; opacity 100%

Colour schemes

estiloDistritosDepartamentales — Depa layer

Colours each of the nine departmental districts by its qc_id integer:
qc_idColourHex
0Purple#93278f
1Blue#0e0ef0
2Yellow#efba00
3Orange#ec6726
4Green#139b48
5Dark Red#941313
6Navy#105689
7Teal#41b6a5
8Pink#ff3eb2
All districts are rendered with fillOpacity: 0.25.

estilozoni — zonificacion layer

Colours zoning polygons by the string value of the Layer property:
Layer valueColourHex
CEMENTERIOBlue#202bf1
CENTRO CIVICODark Green#035d04
COMERCIALBlue#0055ff
COMERCIAL MIXTAYellow#e9e517
EXTENSION INDUSTRIALPurple#6619ff
INDUSTRIAL1Tan#dcc587
INDUSTRIAL2Steel Blue#6a9cd1
PARQUE RECREACIONLime Green#1ed736
CULTURALLavender#c074d1
RESIDENCIALCyan#48ccdb
RESIDENCIAL MIXTABurnt Orange#e95f28
All zones are rendered with fillOpacity: 0.35.

estilored and estilocloacas — redesagua / sistcloacal layers

Both functions share identical colour logic keyed on the id property:
idColourHex
1Light Blue#62b8e5
2Peach/Amber#fbb75b
3Red#f05d51
Rendered at fillOpacity: 0.75.

estilocuencas — cuencas layer

Hydrological basins receive a diagonal stripe fill via the leaflet-pattern plugin (L.StripePattern). The stripe options are:
{ height: 8, weight: 4, spaceWeight: 4, color: color_actual,
  spaceColor: color_actual, spaceOpacity: 0.3, angle: -45 }
qc_idColourHex
1Light Blue#62b8e5
2Peach/Amber#fbb75b
3Red#f05d51

estiloley — zonaley layer

Ley 4886 zones are styled in greyscale, keyed on id:
idColourHex
1Near-white#fafafa
2Medium grey#9f9f9f
3Light grey#b8b8b8
4Lighter grey#d7d7d7
5Dark grey#848484

estiloinundacion — inundacion layer

Flood risk zones use a blue gradient from low to high risk:
idRisk LevelColourHex
1LowPale Blue#c2dffb
2MediumMid Blue#73b3d8
3HighDeep Navy#08306b
4HighestDeep Navy#08306b

estilosuelo — suelo layer

Soil classification polygons use three distinct colours:
idSoil TypeColourHex
1Dusty Rose#d18581
2Sage Green#64c589
3Sand Yellow#dcc57d

estilometro — metro layer

The metrotranvía line uses two states:
idStateColour
1Active / operationalred
2Other / planned#b4afb3 (light grey)

estilosendero — sendGeo layer

The geological trail has a single style for id == 1:
idColourHex
1Burnt Orange#cf7601

The walkability style function

estilocaminabilidad() is the most prominent dynamic style function in the project. It colours each segment of the traza layer (Índice Final de Caminabilidad) based on the PROMEDIO_P average walkability score:
function estilocaminabilidad() {
    traza.eachLayer(function (featureInstanceLayer) {
        var id_feature = featureInstanceLayer.feature.properties['PROMEDIO_P'];
        if (id_feature == 1) {
            color_actual = '#e31a1c';
        } else if (id_feature == 2) {
            color_actual = '#ff7f00';
        } else if (id_feature == 3) {
            color_actual = '#fbeb09';
        } else if (id_feature == 4) {
            color_actual = '#16b934';
        }
        featureInstanceLayer.setStyle({
            color: color_actual, fillOpacity: 1, weight: 5
        });
    });
}
PROMEDIO_PRatingColourHex
"4"ÓptimoGreen#16b934
"3"BuenoYellow#fbeb09
"2"RegularOrange#ff7f00
"1"MaloRed#e31a1c
Segments are drawn at weight: 5 and fillOpacity: 1, making them visually prominent over the base map. The popup for each segment is handled by agregarPopupCaminabilidad.

General pattern

All style functions follow the same structure: iterate with eachLayer, read a property, pick a colour, call setStyle. The general template is:
function estiloMiCapa() {
    miCapa.eachLayer(function (featureInstanceLayer) {
        var categoria = featureInstanceLayer.feature.properties['CATEGORIA'];
        var color_actual = '#aaaaaa'; // default / fallback colour

        if (categoria === 'A') {
            color_actual = '#1a9641';
        } else if (categoria === 'B') {
            color_actual = '#a6d96a';
        } else if (categoria === 'C') {
            color_actual = '#fdae61';
        }

        featureInstanceLayer.setStyle({
            color: color_actual,
            fillColor: color_actual,
            fillOpacity: 0.7,
            weight: 1
        });
    });
}

// Call it after the map and layer are initialised:
estiloMiCapa();
Dynamic styling with eachLayer + setStyle() is useful when the same GeoJSON layer needs different colours per feature based on property values, avoiding the overhead of creating one L.geoJson() instance per category. It also makes it easy to update all colours at once by re-calling the function.

Build docs developers (and LLMs) love