@datosgeo-atdt/geo-ui 0.6.0 → 0.7.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 +45 -0
- package/dist/components/MapaPMTiles.d.ts +3 -0
- package/dist/components/MapaPMTiles.d.ts.map +1 -1
- package/dist/geo-ui.js +2569 -2494
- package/dist/geo-ui.js.map +1 -1
- package/dist/geo-ui.umd.cjs +45 -44
- package/dist/geo-ui.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -172,6 +172,48 @@ cvegeo,nombre,valor
|
|
|
172
172
|
09010,Álvaro Obregón,175
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
+
### Ejemplo con Popup (información al pasar el mouse)
|
|
176
|
+
|
|
177
|
+
Puedes habilitar un popup que se muestra al pasar el mouse sobre las features:
|
|
178
|
+
|
|
179
|
+
```tsx
|
|
180
|
+
// Popup simple: solo muestra el nombre de la entidad/municipio
|
|
181
|
+
<MapaPMTiles
|
|
182
|
+
csvUrl="https://example.com/datos.csv"
|
|
183
|
+
fitToIds="09"
|
|
184
|
+
enablePopup={true}
|
|
185
|
+
/>
|
|
186
|
+
|
|
187
|
+
// Popup con datos del CSV
|
|
188
|
+
<MapaPMTiles
|
|
189
|
+
csvUrl="https://example.com/datos_poblacion.csv"
|
|
190
|
+
field="poblacion"
|
|
191
|
+
fitToIds="09"
|
|
192
|
+
enablePopup={true}
|
|
193
|
+
popupDataLabel="Población total"
|
|
194
|
+
popupDataField="poblacion"
|
|
195
|
+
/>
|
|
196
|
+
|
|
197
|
+
// Popup en modo municipios
|
|
198
|
+
<MapaPMTiles
|
|
199
|
+
csvUrl="https://example.com/datos_municipales.csv"
|
|
200
|
+
fitToIds="09"
|
|
201
|
+
showMunicipios={true}
|
|
202
|
+
enablePopup={true}
|
|
203
|
+
popupDataLabel="Habitantes"
|
|
204
|
+
popupDataField="poblacion"
|
|
205
|
+
mode="jenks"
|
|
206
|
+
/>
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**Comportamiento del popup:**
|
|
210
|
+
- Se muestra al pasar el mouse sobre las features (hover)
|
|
211
|
+
- **Nombre**: Muestra automáticamente el nombre de la entidad o municipio
|
|
212
|
+
- Entidades: usa un diccionario interno (ej: "09" → "Ciudad de México")
|
|
213
|
+
- Municipios: usa el campo `nomgeo` del PMTiles
|
|
214
|
+
- **Datos adicionales**: Si especificas `popupDataLabel` y `popupDataField`, muestra el valor del CSV
|
|
215
|
+
- Los números se formatean automáticamente con comas (ej: 1,234,567)
|
|
216
|
+
|
|
175
217
|
## Props
|
|
176
218
|
|
|
177
219
|
### Props Obligatorias
|
|
@@ -199,6 +241,9 @@ cvegeo,nombre,valor
|
|
|
199
241
|
| `bboxField` | `string` | `"bbox"` | Campo con bbox precalculado en PMTiles |
|
|
200
242
|
| `jenksK` | `number` | `5` | Número de clases para clasificación Jenks |
|
|
201
243
|
| `showMunicipios` | `boolean` | `false` | Activa modo municipal: muestra municipios con datos temáticos y entidad como contorno |
|
|
244
|
+
| `enablePopup` | `boolean` | `false` | Habilita popup con hover para mostrar información |
|
|
245
|
+
| `popupDataLabel` | `string` | `undefined` | Etiqueta para el dato adicional del popup (ej: "Población total") |
|
|
246
|
+
| `popupDataField` | `string` | `undefined` | Campo del CSV para mostrar en el popup (usa el valor de `field` si no se especifica) |
|
|
202
247
|
|
|
203
248
|
## Modos de Estilo
|
|
204
249
|
|
|
@@ -18,6 +18,9 @@ export interface MapaPMTilesProps {
|
|
|
18
18
|
bboxField?: string;
|
|
19
19
|
jenksK?: number;
|
|
20
20
|
showMunicipios?: boolean;
|
|
21
|
+
enablePopup?: boolean;
|
|
22
|
+
popupDataLabel?: string;
|
|
23
|
+
popupDataField?: string;
|
|
21
24
|
}
|
|
22
25
|
export declare const MapaPMTiles: React.FC<MapaPMTilesProps>;
|
|
23
26
|
//# 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;
|
|
1
|
+
{"version":3,"file":"MapaPMTiles.d.ts","sourceRoot":"","sources":["../../src/components/MapaPMTiles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,OAAO,mBAAmB,CAAC;AAE3B,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,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE;QACZ,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAmDD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA6ZlD,CAAC"}
|