@datosgeo-atdt/geo-ui 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -127,10 +127,50 @@ Muestra **solo** las entidades seleccionadas y ajusta el mapa automáticamente a
127
127
  ```
128
128
 
129
129
  **Ventajas de usar `fitToIds`:**
130
- - No necesitas configurar `pmtilesUrl` (está integrado)
131
- - Filtra automáticamente para mostrar solo las entidades seleccionadas
132
- - Calcula y ajusta el bbox combinado sin animación de zoom
133
- - Carga directo en la vista correcta
130
+ - No necesitas configurar `pmtilesUrl` (está integrado)
131
+ - Filtra automáticamente para mostrar solo las entidades seleccionadas
132
+ - Calcula y ajusta el bbox combinado sin animación de zoom
133
+ - Carga directo en la vista correcta
134
+
135
+ ### Ejemplo con showMunicipios (visualización municipal)
136
+
137
+ Cuando activas `showMunicipios={true}`, el componente cambia a **nivel municipal**:
138
+ - La **entidad** se muestra solo como **contorno** (outline grueso)
139
+ - Los **municipios** dentro de esa entidad se muestran con el **relleno temático** (boolean o jenks)
140
+ - Los datos CSV se unen usando el **cvegeo municipal** (5 dígitos)
141
+
142
+ ```tsx
143
+ // Mostrar municipios de Ciudad de México (09)
144
+ // El CSV debe tener cvegeo municipal (ej: "09002", "09010", etc.)
145
+ <MapaPMTiles
146
+ csvUrl="https://example.com/datos_municipales.csv"
147
+ fitToIds="09"
148
+ showMunicipios={true}
149
+ mode="jenks"
150
+ jenksK={5}
151
+ />
152
+
153
+ // Mostrar municipios de múltiples entidades
154
+ <MapaPMTiles
155
+ csvUrl="https://example.com/datos_municipales.csv"
156
+ fitToIds={["09", "15", "14"]}
157
+ showMunicipios={true}
158
+ />
159
+ ```
160
+
161
+ **¿Cómo funciona?**
162
+ 1. `fitToIds="09"` extrae automáticamente `cve_ent="09"` (primeros 2 dígitos)
163
+ 2. Filtra y muestra **todos los municipios** con `cve_ent="09"`
164
+ 3. La entidad "09" se dibuja solo como contorno
165
+ 4. Los municipios se rellenan según los valores del CSV unidos por `cvegeo` (5 dígitos)
166
+
167
+ **Formato CSV para municipios:**
168
+ ```csv
169
+ cvegeo,nombre,valor
170
+ 09002,Azcapotzalco,150
171
+ 09003,Coyoacán,200
172
+ 09010,Álvaro Obregón,175
173
+ ```
134
174
 
135
175
  ## Props
136
176
 
@@ -158,6 +198,7 @@ Muestra **solo** las entidades seleccionadas y ajusta el mapa automáticamente a
158
198
  | `fitToIds` | `string \| string[]` | `undefined` | ID o array de IDs de features para filtrar y hacer zoom automático (sin animación) |
159
199
  | `bboxField` | `string` | `"bbox"` | Campo con bbox precalculado en PMTiles |
160
200
  | `jenksK` | `number` | `5` | Número de clases para clasificación Jenks |
201
+ | `showMunicipios` | `boolean` | `false` | Activa modo municipal: muestra municipios con datos temáticos y entidad como contorno |
161
202
 
162
203
  ## Modos de Estilo
163
204
 
@@ -17,6 +17,7 @@ export interface MapaPMTilesProps {
17
17
  fitToIds?: string | string[];
18
18
  bboxField?: string;
19
19
  jenksK?: number;
20
+ showMunicipios?: boolean;
20
21
  }
21
22
  export declare const MapaPMTiles: React.FC<MapaPMTilesProps>;
22
23
  //# sourceMappingURL=MapaPMTiles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MapaPMTiles.d.ts","sourceRoot":"","sources":["../../src/components/MapaPMTiles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAO3D,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC3B,KAAK,CAAC,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