Leaflet
// JS (ejemplo básico)
fetch('https://chartismx.com/api/getGeomDigitalMaps?layerName=municipio&entidad=19&municipio=039')
.then(r => r.json())
.then(geo => L.geoJSON(geo).addTo(map));
GeoJSON listo para Leaflet/Mapbox. Endpoints idempotentes, GET-only.
https://chartismx.com/api
// JS (ejemplo básico)
fetch('https://chartismx.com/api/getGeomDigitalMaps?layerName=municipio&entidad=19&municipio=039')
.then(r => r.json())
.then(geo => L.geoJSON(geo).addTo(map));
curl "https://chartismx.com/api/pointToSeccion?lat=25.67&lng=-100.31"
curl "https://chartismx.com/api/getSeccionesByMunicipio?entidad=19&municipio=039"
| Método | Ruta | Descripción | Parámetros |
|---|---|---|---|
| GET | /api/entidad2 |
Lista entidades | — |
| GET | /api/getDistritos |
Distritos por entidad | entidad |
| GET | /api/getMunicipios |
Municipios por entidad | entidad |
| GET | /api/getLocalidades |
Localidades por municipio | entidad, municipio |
| GET | /api/getColonias |
Colonias por municipio | entidad, municipio |
| GET | /api/getSecciones |
Secciones por entidad | entidad |
| GET | /api/getGeomDigitalMaps |
GeoJSON por capa | layerName + llaves (ver abajo) |
| GET | /api/getSeccionLabels |
Labels materializados (opcional) | — |
| GET | /api/getSeccionesByMunicipio |
Secciones de un municipio | entidad, municipio |
| GET | /api/getSeccionesByDistrito |
Secciones de un distrito | entidad, distrito |
| GET | /api/getSeccionesByLocalidad |
Secciones que tocan una localidad | entidad, municipio, localidad |
| GET | /api/getSeccionesByColonia |
Secciones que tocan una colonia (GID) | entidad, municipio, colonia |
| GET | /api/pointToSeccion |
Punto → sección | lat, lng |
| GET | /api/pointContext |
Contexto administrativo del punto | lat, lng |
getGeomDigitalMaps)layerName=entidad → entidadlayerName=distrito → entidad, distritolayerName=municipio → entidad, municipiolayerName=localidad → entidad, municipio, localidadlayerName=colonia → entidad, municipio, colonia(gid)layerName=seccion → entidad, seccionSi el punto cae en borde, se aplica un buffer de 5 m (EPSG:3857) como fallback.
GET https://chartismx.com/api/pointToSeccion?lat=25.67&lng=-100.31
Si necesitas token para entornos públicos, escríbenos a hola@chartismx.com. Habilitamos claves y rate limits por proyecto.
En producción limita Access-Control-Allow-Origin a tus dominios (p. ej. https://chartismx.com). Las peticiones GET admiten preflight OPTIONS.
Endpoint de salud:
GET https://chartismx.com/status