@trismegisto/maps 3.3.13 → 3.4.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 +29 -5
- package/dist/basemaps/br/index.d.ts +10 -0
- package/dist/basemaps/br/index.js +4 -0
- package/dist/basemaps/br/index.js.map +1 -0
- package/{types/trismegisto-maps-basemaps-br.d.ts → dist/basemaps/br-mesorregioes/index.d.ts} +3 -7
- package/dist/basemaps/br-mesorregioes/index.js +4 -0
- package/dist/basemaps/br-mesorregioes/index.js.map +1 -0
- package/dist/basemaps/br-microrregioes/index.d.ts +10 -0
- package/dist/basemaps/br-microrregioes/index.js +4 -0
- package/dist/basemaps/br-microrregioes/index.js.map +1 -0
- package/dist/basemaps/br-municipios/ac/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/ac/index.js +4 -0
- package/dist/basemaps/br-municipios/ac/index.js.map +1 -0
- package/dist/basemaps/br-municipios/al/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/al/index.js +4 -0
- package/dist/basemaps/br-municipios/al/index.js.map +1 -0
- package/dist/basemaps/br-municipios/am/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/am/index.js +4 -0
- package/dist/basemaps/br-municipios/am/index.js.map +1 -0
- package/dist/basemaps/br-municipios/ap/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/ap/index.js +4 -0
- package/dist/basemaps/br-municipios/ap/index.js.map +1 -0
- package/dist/basemaps/br-municipios/ba/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/ba/index.js +4 -0
- package/dist/basemaps/br-municipios/ba/index.js.map +1 -0
- package/dist/basemaps/br-municipios/ce/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/ce/index.js +4 -0
- package/dist/basemaps/br-municipios/ce/index.js.map +1 -0
- package/dist/basemaps/br-municipios/df/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/df/index.js +4 -0
- package/dist/basemaps/br-municipios/df/index.js.map +1 -0
- package/dist/basemaps/br-municipios/es/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/es/index.js +4 -0
- package/dist/basemaps/br-municipios/es/index.js.map +1 -0
- package/dist/basemaps/br-municipios/go/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/go/index.js +4 -0
- package/dist/basemaps/br-municipios/go/index.js.map +1 -0
- package/dist/basemaps/br-municipios/ma/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/ma/index.js +4 -0
- package/dist/basemaps/br-municipios/ma/index.js.map +1 -0
- package/dist/basemaps/br-municipios/mg/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/mg/index.js +4 -0
- package/dist/basemaps/br-municipios/mg/index.js.map +1 -0
- package/dist/basemaps/br-municipios/ms/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/ms/index.js +4 -0
- package/dist/basemaps/br-municipios/ms/index.js.map +1 -0
- package/dist/basemaps/br-municipios/mt/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/mt/index.js +4 -0
- package/dist/basemaps/br-municipios/mt/index.js.map +1 -0
- package/dist/basemaps/br-municipios/pa/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/pa/index.js +4 -0
- package/dist/basemaps/br-municipios/pa/index.js.map +1 -0
- package/dist/basemaps/br-municipios/pb/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/pb/index.js +4 -0
- package/dist/basemaps/br-municipios/pb/index.js.map +1 -0
- package/dist/basemaps/br-municipios/pe/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/pe/index.js +4 -0
- package/dist/basemaps/br-municipios/pe/index.js.map +1 -0
- package/dist/basemaps/br-municipios/pi/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/pi/index.js +4 -0
- package/dist/basemaps/br-municipios/pi/index.js.map +1 -0
- package/dist/basemaps/br-municipios/pr/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/pr/index.js +4 -0
- package/dist/basemaps/br-municipios/pr/index.js.map +1 -0
- package/dist/basemaps/br-municipios/rj/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/rj/index.js +4 -0
- package/dist/basemaps/br-municipios/rj/index.js.map +1 -0
- package/dist/basemaps/br-municipios/rn/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/rn/index.js +4 -0
- package/dist/basemaps/br-municipios/rn/index.js.map +1 -0
- package/dist/basemaps/br-municipios/ro/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/ro/index.js +4 -0
- package/dist/basemaps/br-municipios/ro/index.js.map +1 -0
- package/dist/basemaps/br-municipios/rr/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/rr/index.js +4 -0
- package/dist/basemaps/br-municipios/rr/index.js.map +1 -0
- package/dist/basemaps/br-municipios/rs/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/rs/index.js +4 -0
- package/dist/basemaps/br-municipios/rs/index.js.map +1 -0
- package/dist/basemaps/br-municipios/sc/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/sc/index.js +4 -0
- package/dist/basemaps/br-municipios/sc/index.js.map +1 -0
- package/dist/basemaps/br-municipios/se/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/se/index.js +4 -0
- package/dist/basemaps/br-municipios/se/index.js.map +1 -0
- package/dist/basemaps/br-municipios/sp/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/sp/index.js +4 -0
- package/dist/basemaps/br-municipios/sp/index.js.map +1 -0
- package/dist/basemaps/br-municipios/to/index.d.ts +10 -0
- package/dist/basemaps/br-municipios/to/index.js +4 -0
- package/dist/basemaps/br-municipios/to/index.js.map +1 -0
- package/dist/basemaps/world/index.d.ts +10 -0
- package/dist/basemaps/world/index.js +4 -0
- package/dist/basemaps/world/index.js.map +1 -0
- package/dist/basemaps/world-50m/index.d.ts +10 -0
- package/dist/basemaps/world-50m/index.js +4 -0
- package/dist/basemaps/world-50m/index.js.map +1 -0
- package/dist/src/core/basemap-loaders.generated.d.ts +7 -0
- package/dist/src/core/basemap-loaders.generated.js +67 -0
- package/dist/src/core/basemap-loaders.generated.js.map +1 -0
- package/dist/src/core/basemap.d.ts +86 -0
- package/dist/src/core/basemap.js +286 -0
- package/dist/src/core/basemap.js.map +1 -0
- package/dist/src/core/choropleth-layer.d.ts +63 -0
- package/dist/src/core/choropleth-layer.js +112 -0
- package/dist/src/core/choropleth-layer.js.map +1 -0
- package/dist/src/core/choropleth.d.ts +61 -0
- package/dist/src/core/choropleth.js +121 -0
- package/dist/src/core/choropleth.js.map +1 -0
- package/dist/src/core/cluster-groups.d.ts +32 -0
- package/dist/src/core/cluster-groups.js +45 -0
- package/dist/src/core/cluster-groups.js.map +1 -0
- package/dist/src/core/cluster.d.ts +16 -0
- package/dist/src/core/cluster.js +58 -0
- package/dist/src/core/cluster.js.map +1 -0
- package/dist/src/core/engine.d.ts +95 -0
- package/dist/src/core/engine.js +223 -0
- package/dist/src/core/engine.js.map +1 -0
- package/dist/src/core/geo.d.ts +49 -0
- package/dist/src/core/geo.js +93 -0
- package/dist/src/core/geo.js.map +1 -0
- package/dist/src/core/geojson.d.ts +68 -0
- package/dist/src/core/geojson.js +80 -0
- package/dist/src/core/geojson.js.map +1 -0
- package/dist/src/core/index.d.ts +26 -0
- package/dist/src/core/index.js +34 -0
- package/dist/src/core/index.js.map +1 -0
- package/dist/src/core/interactions.d.ts +76 -0
- package/dist/src/core/interactions.js +338 -0
- package/dist/src/core/interactions.js.map +1 -0
- package/dist/src/core/localities.d.ts +36 -0
- package/dist/src/core/localities.js +63 -0
- package/dist/src/core/localities.js.map +1 -0
- package/dist/src/core/map-layers.d.ts +152 -0
- package/dist/src/core/map-layers.js +141 -0
- package/dist/src/core/map-layers.js.map +1 -0
- package/dist/src/core/maps-i18n.d.ts +19 -0
- package/dist/src/core/maps-i18n.js +25 -0
- package/dist/src/core/maps-i18n.js.map +1 -0
- package/dist/src/core/maps-messages.d.ts +125 -0
- package/dist/src/core/maps-messages.en.d.ts +2 -0
- package/dist/src/core/maps-messages.en.js +83 -0
- package/dist/src/core/maps-messages.en.js.map +1 -0
- package/dist/src/core/maps-messages.es.d.ts +2 -0
- package/dist/src/core/maps-messages.es.js +83 -0
- package/dist/src/core/maps-messages.es.js.map +1 -0
- package/dist/src/core/maps-messages.js +83 -0
- package/dist/src/core/maps-messages.js.map +1 -0
- package/dist/src/core/projection.d.ts +42 -0
- package/dist/src/core/projection.js +59 -0
- package/dist/src/core/projection.js.map +1 -0
- package/dist/src/core/regions-layer.d.ts +27 -0
- package/dist/src/core/regions-layer.js +43 -0
- package/dist/src/core/regions-layer.js.map +1 -0
- package/dist/src/core/route-view.d.ts +54 -0
- package/dist/src/core/route-view.js +107 -0
- package/dist/src/core/route-view.js.map +1 -0
- package/dist/src/core/route.d.ts +80 -0
- package/dist/src/core/route.js +164 -0
- package/dist/src/core/route.js.map +1 -0
- package/dist/src/core/scale.d.ts +15 -0
- package/dist/src/core/scale.js +45 -0
- package/dist/src/core/scale.js.map +1 -0
- package/dist/src/core/shapes.d.ts +34 -0
- package/dist/src/core/shapes.js +74 -0
- package/dist/src/core/shapes.js.map +1 -0
- package/dist/src/core/street-view.d.ts +19 -0
- package/dist/src/core/street-view.js +30 -0
- package/dist/src/core/street-view.js.map +1 -0
- package/dist/src/core/tiles.d.ts +74 -0
- package/dist/src/core/tiles.js +216 -0
- package/dist/src/core/tiles.js.map +1 -0
- package/dist/src/core/topology.d.ts +61 -0
- package/dist/src/core/topology.js +145 -0
- package/dist/src/core/topology.js.map +1 -0
- package/dist/src/core/vector.d.ts +21 -0
- package/dist/src/core/vector.js +57 -0
- package/dist/src/core/vector.js.map +1 -0
- package/dist/src/core/view.d.ts +44 -0
- package/dist/src/core/view.js +90 -0
- package/dist/src/core/view.js.map +1 -0
- package/package.json +34 -149
- package/fesm2022/trismegisto-maps-basemaps-br-mesorregioes.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-mesorregioes.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-microrregioes.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-microrregioes.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-ac.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-ac.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-al.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-al.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-am.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-am.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-ap.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-ap.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-ba.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-ba.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-ce.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-ce.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-df.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-df.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-es.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-es.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-go.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-go.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-ma.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-ma.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-mg.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-mg.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-ms.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-ms.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-mt.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-mt.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-pa.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-pa.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-pb.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-pb.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-pe.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-pe.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-pi.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-pi.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-pr.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-pr.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-rj.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-rj.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-rn.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-rn.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-ro.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-ro.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-rr.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-rr.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-rs.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-rs.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-sc.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-sc.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-se.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-se.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-sp.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-sp.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-to.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br-municipios-to.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-br.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-br.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-world-50m.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-world-50m.mjs.map +0 -1
- package/fesm2022/trismegisto-maps-basemaps-world.mjs +0 -10
- package/fesm2022/trismegisto-maps-basemaps-world.mjs.map +0 -1
- package/fesm2022/trismegisto-maps.mjs +0 -4901
- package/fesm2022/trismegisto-maps.mjs.map +0 -1
- package/types/trismegisto-maps-basemaps-br-mesorregioes.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-mesorregioes.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-microrregioes.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-microrregioes.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-ac.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-ac.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-al.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-al.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-am.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-am.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-ap.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-ap.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-ba.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-ba.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-ce.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-ce.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-df.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-df.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-es.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-es.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-go.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-go.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-ma.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-ma.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-mg.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-mg.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-ms.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-ms.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-mt.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-mt.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-pa.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-pa.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-pb.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-pb.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-pe.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-pe.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-pi.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-pi.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-pr.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-pr.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-rj.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-rj.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-rn.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-rn.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-ro.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-ro.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-rr.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-rr.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-rs.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-rs.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-sc.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-sc.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-se.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-se.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-sp.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-sp.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br-municipios-to.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-br-municipios-to.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-br.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-world-50m.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-world-50m.d.ts.map +0 -1
- package/types/trismegisto-maps-basemaps-world.d.ts +0 -14
- package/types/trismegisto-maps-basemaps-world.d.ts.map +0 -1
- package/types/trismegisto-maps.d.ts +0 -1785
- package/types/trismegisto-maps.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../basemaps/world-50m/index.ts"],"names":[],"mappings":"AAYA,4FAA4F;AAC5F,MAAM,CAAC,MAAM,mBAAmB,GAAsB,IAAI,CAAC,KAAK,CAAC,o4nQAAo4nQ,CAAC,CAAC;AACv8nQ,MAAM,CAAC,MAAM,OAAO,GAAG,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BasemapData } from './topology';
|
|
2
|
+
type Loader = () => Promise<BasemapData>;
|
|
3
|
+
/** Um carregador por ponto de entrada (`@trismegisto/maps/basemaps/<chave>`). */
|
|
4
|
+
export declare const BASEMAP_LOADERS: Readonly<Record<string, Loader>>;
|
|
5
|
+
/** Código IBGE de cada UF, pela sigla (as 27 unidades da federação). */
|
|
6
|
+
export declare const BR_UF_CODES: Readonly<Record<string, string>>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const pick = (m) => m.BASEMAP;
|
|
2
|
+
/** Um carregador por ponto de entrada (`@trismegisto/maps/basemaps/<chave>`). */
|
|
3
|
+
export const BASEMAP_LOADERS = {
|
|
4
|
+
world: () => import('@trismegisto/maps/basemaps/world').then(pick),
|
|
5
|
+
'world-50m': () => import('@trismegisto/maps/basemaps/world-50m').then(pick),
|
|
6
|
+
br: () => import('@trismegisto/maps/basemaps/br').then(pick),
|
|
7
|
+
'br-mesorregioes': () => import('@trismegisto/maps/basemaps/br-mesorregioes').then(pick),
|
|
8
|
+
'br-microrregioes': () => import('@trismegisto/maps/basemaps/br-microrregioes').then(pick),
|
|
9
|
+
'br-municipios/ro': () => import('@trismegisto/maps/basemaps/br-municipios/ro').then(pick),
|
|
10
|
+
'br-municipios/ac': () => import('@trismegisto/maps/basemaps/br-municipios/ac').then(pick),
|
|
11
|
+
'br-municipios/am': () => import('@trismegisto/maps/basemaps/br-municipios/am').then(pick),
|
|
12
|
+
'br-municipios/rr': () => import('@trismegisto/maps/basemaps/br-municipios/rr').then(pick),
|
|
13
|
+
'br-municipios/pa': () => import('@trismegisto/maps/basemaps/br-municipios/pa').then(pick),
|
|
14
|
+
'br-municipios/ap': () => import('@trismegisto/maps/basemaps/br-municipios/ap').then(pick),
|
|
15
|
+
'br-municipios/to': () => import('@trismegisto/maps/basemaps/br-municipios/to').then(pick),
|
|
16
|
+
'br-municipios/ma': () => import('@trismegisto/maps/basemaps/br-municipios/ma').then(pick),
|
|
17
|
+
'br-municipios/pi': () => import('@trismegisto/maps/basemaps/br-municipios/pi').then(pick),
|
|
18
|
+
'br-municipios/ce': () => import('@trismegisto/maps/basemaps/br-municipios/ce').then(pick),
|
|
19
|
+
'br-municipios/rn': () => import('@trismegisto/maps/basemaps/br-municipios/rn').then(pick),
|
|
20
|
+
'br-municipios/pb': () => import('@trismegisto/maps/basemaps/br-municipios/pb').then(pick),
|
|
21
|
+
'br-municipios/pe': () => import('@trismegisto/maps/basemaps/br-municipios/pe').then(pick),
|
|
22
|
+
'br-municipios/al': () => import('@trismegisto/maps/basemaps/br-municipios/al').then(pick),
|
|
23
|
+
'br-municipios/se': () => import('@trismegisto/maps/basemaps/br-municipios/se').then(pick),
|
|
24
|
+
'br-municipios/ba': () => import('@trismegisto/maps/basemaps/br-municipios/ba').then(pick),
|
|
25
|
+
'br-municipios/mg': () => import('@trismegisto/maps/basemaps/br-municipios/mg').then(pick),
|
|
26
|
+
'br-municipios/es': () => import('@trismegisto/maps/basemaps/br-municipios/es').then(pick),
|
|
27
|
+
'br-municipios/rj': () => import('@trismegisto/maps/basemaps/br-municipios/rj').then(pick),
|
|
28
|
+
'br-municipios/sp': () => import('@trismegisto/maps/basemaps/br-municipios/sp').then(pick),
|
|
29
|
+
'br-municipios/pr': () => import('@trismegisto/maps/basemaps/br-municipios/pr').then(pick),
|
|
30
|
+
'br-municipios/sc': () => import('@trismegisto/maps/basemaps/br-municipios/sc').then(pick),
|
|
31
|
+
'br-municipios/rs': () => import('@trismegisto/maps/basemaps/br-municipios/rs').then(pick),
|
|
32
|
+
'br-municipios/ms': () => import('@trismegisto/maps/basemaps/br-municipios/ms').then(pick),
|
|
33
|
+
'br-municipios/mt': () => import('@trismegisto/maps/basemaps/br-municipios/mt').then(pick),
|
|
34
|
+
'br-municipios/go': () => import('@trismegisto/maps/basemaps/br-municipios/go').then(pick),
|
|
35
|
+
'br-municipios/df': () => import('@trismegisto/maps/basemaps/br-municipios/df').then(pick),
|
|
36
|
+
};
|
|
37
|
+
/** Código IBGE de cada UF, pela sigla (as 27 unidades da federação). */
|
|
38
|
+
export const BR_UF_CODES = {
|
|
39
|
+
RO: '11',
|
|
40
|
+
AC: '12',
|
|
41
|
+
AM: '13',
|
|
42
|
+
RR: '14',
|
|
43
|
+
PA: '15',
|
|
44
|
+
AP: '16',
|
|
45
|
+
TO: '17',
|
|
46
|
+
MA: '21',
|
|
47
|
+
PI: '22',
|
|
48
|
+
CE: '23',
|
|
49
|
+
RN: '24',
|
|
50
|
+
PB: '25',
|
|
51
|
+
PE: '26',
|
|
52
|
+
AL: '27',
|
|
53
|
+
SE: '28',
|
|
54
|
+
BA: '29',
|
|
55
|
+
MG: '31',
|
|
56
|
+
ES: '32',
|
|
57
|
+
RJ: '33',
|
|
58
|
+
SP: '35',
|
|
59
|
+
PR: '41',
|
|
60
|
+
SC: '42',
|
|
61
|
+
RS: '43',
|
|
62
|
+
MS: '50',
|
|
63
|
+
MT: '51',
|
|
64
|
+
GO: '52',
|
|
65
|
+
DF: '53',
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=basemap-loaders.generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basemap-loaders.generated.js","sourceRoot":"","sources":["../../../src/core/basemap-loaders.generated.ts"],"names":[],"mappings":"AAMA,MAAM,IAAI,GAAG,CAAC,CAAuB,EAAE,EAAE,CAAC,CAAC,CAAC,OAAsB,CAAC;AAEnE,iFAAiF;AACjF,MAAM,CAAC,MAAM,eAAe,GAAqC;IAC/D,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,kCAAkC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IAClE,WAAW,EAAE,GAAG,EAAE,CA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* Camadas de mapa base: resolve o id de uma camada (`'br/ufs'`, `'world'`...) para o ponto de entrada que
|
|
3
|
+
* traz os dados, carrega sob demanda (import dinâmico — o bundler do app separa cada nível num chunk) e
|
|
4
|
+
* prepara as regiões para desenhar: anéis já projetados no Mercator (fração do mundo, independente do
|
|
5
|
+
* zoom), retângulo, ponto de rótulo e área.
|
|
6
|
+
*/
|
|
7
|
+
import { LatLng, LatLngBounds } from './geo';
|
|
8
|
+
import { LayerFrame } from './tiles';
|
|
9
|
+
import { BasemapData } from './topology';
|
|
10
|
+
/** Ids das camadas embutidas. Municípios: `br/municipios/<sigla ou código IBGE da UF>`. */
|
|
11
|
+
export type BasemapLayerId = 'world' | 'world/110m' | 'world/50m' | 'br/regioes' | 'br/ufs' | 'br/mesorregioes' | 'br/microrregioes' | `br/municipios/${string}`;
|
|
12
|
+
/** Uma região do mapa base (país, UF, município...). */
|
|
13
|
+
export interface BasemapRegion {
|
|
14
|
+
/** Código oficial: ISO 3166-1 alfa-3 (países) ou código IBGE (regiões, UFs, municípios...). */
|
|
15
|
+
readonly id: string;
|
|
16
|
+
/** Nome (pt-BR). Países trazem também `name_en`/`name_es` em `properties`. */
|
|
17
|
+
readonly name: string;
|
|
18
|
+
readonly properties: Readonly<Record<string, unknown>>;
|
|
19
|
+
/**
|
|
20
|
+
* Anéis projetados: cada um `[x0, y0, x1, y1, ...]` em fração do mundo do Mercator (0–1; multiplique
|
|
21
|
+
* por `worldSize(zoom)` para ter pixels). Anéis externos e furos juntos (regra evenodd).
|
|
22
|
+
*/
|
|
23
|
+
readonly rings: readonly Float64Array[];
|
|
24
|
+
readonly bounds: LatLngBounds;
|
|
25
|
+
/** Ponto para rótulo/dica, dentro da região. */
|
|
26
|
+
readonly labelPoint: LatLng;
|
|
27
|
+
/** Área projetada (fração² do mundo) — para priorizar rótulos. */
|
|
28
|
+
readonly area: number;
|
|
29
|
+
}
|
|
30
|
+
/** Camada pronta para desenhar. */
|
|
31
|
+
export interface BasemapLayer {
|
|
32
|
+
/** Id da camada (`'br/ufs'`) ou `<dados>/<objeto>` quando montada de dados importados. */
|
|
33
|
+
readonly id: string;
|
|
34
|
+
readonly data: BasemapData;
|
|
35
|
+
/** Objeto da topologia usado. */
|
|
36
|
+
readonly object: string;
|
|
37
|
+
readonly regions: readonly BasemapRegion[];
|
|
38
|
+
readonly bounds: LatLngBounds;
|
|
39
|
+
readonly attribution: string;
|
|
40
|
+
readonly maxZoom: number;
|
|
41
|
+
}
|
|
42
|
+
/** Ponto de entrada (`@trismegisto/maps/basemaps/<entry>`) e objeto da topologia de um id de camada. */
|
|
43
|
+
export declare function resolveBasemapLayerId(id: string): {
|
|
44
|
+
readonly entry: string;
|
|
45
|
+
readonly object: string;
|
|
46
|
+
} | null;
|
|
47
|
+
/** Sigla da UF a partir da sigla (qualquer caixa) ou do código IBGE de 2 dígitos. `null` se não existe. */
|
|
48
|
+
export declare function ufSigla(value: string | number): string | null;
|
|
49
|
+
/** Siglas das 27 UFs, na ordem do código IBGE. */
|
|
50
|
+
export declare function brUfSiglas(): string[];
|
|
51
|
+
/** Carrega os dados de um ponto de entrada (uma vez só; as chamadas seguintes reaproveitam a promessa). */
|
|
52
|
+
export declare function loadBasemapData(entry: string): Promise<BasemapData>;
|
|
53
|
+
/** Carrega e prepara a camada pelo id (`'br/ufs'`, `'br/municipios/SP'`, `'world'`...). */
|
|
54
|
+
export declare function loadBasemapLayer(id: BasemapLayerId | string): Promise<BasemapLayer>;
|
|
55
|
+
/**
|
|
56
|
+
* Prepara uma camada a partir de dados já importados (`import { BASEMAP } from '@trismegisto/maps/basemaps/br'`).
|
|
57
|
+
* Sem `object`, usa o primeiro objeto da topologia. Resultado em cache por dados + objeto.
|
|
58
|
+
*/
|
|
59
|
+
export declare function basemapLayer(data: BasemapData, object?: string, id?: string): BasemapLayer;
|
|
60
|
+
/** Nome da região no idioma (`name_en`, `name_es` quando existem; senão `name`). */
|
|
61
|
+
export declare function regionName(region: BasemapRegion, locale: string): string;
|
|
62
|
+
/** Graus → fração do mundo do Mercator (mesma conta de `latLngToPixel`, sem o tamanho do mundo). */
|
|
63
|
+
export declare function projectFraction(lng: number, lat: number): [number, number];
|
|
64
|
+
/**
|
|
65
|
+
* Atributo `d` da região no enquadramento: anéis em pixels da camada, descartando pontos a menos de
|
|
66
|
+
* `minStep` px do anterior (nos zooms baixos a maior parte dos vértices cai no mesmo pixel). Anel que
|
|
67
|
+
* encolhe a menos de 3 pontos some — a não ser que a região inteira sumisse, aí desenha sem descarte.
|
|
68
|
+
*/
|
|
69
|
+
export declare function regionPath(region: BasemapRegion, frame: LayerFrame, tileSize?: number, minStep?: number): string;
|
|
70
|
+
/** Ponto da camada (pixels) de uma coordenada já projetada em fração do mundo. */
|
|
71
|
+
export declare function fractionToLayer(x: number, y: number, frame: LayerFrame, tileSize?: number): {
|
|
72
|
+
x: number;
|
|
73
|
+
y: number;
|
|
74
|
+
};
|
|
75
|
+
export interface RegionLabel {
|
|
76
|
+
readonly id: string;
|
|
77
|
+
readonly text: string;
|
|
78
|
+
readonly x: number;
|
|
79
|
+
readonly y: number;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Rótulos que cabem sem se sobrepor: das regiões maiores para as menores, cada texto ocupa um retângulo
|
|
83
|
+
* estimado (`fontSize` × 0,6 por caractere); o que colide com um já posto, ou cuja região é menor que o
|
|
84
|
+
* próprio texto, fica de fora.
|
|
85
|
+
*/
|
|
86
|
+
export declare function placeLabels(regions: readonly BasemapRegion[], text: (region: BasemapRegion) => string, frame: LayerFrame, fontSize: number, tileSize?: number): RegionLabel[];
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { DEFAULT_TILE_SIZE, MAX_LATITUDE, worldSize } from './projection';
|
|
2
|
+
import { BASEMAP_LOADERS, BR_UF_CODES } from './basemap-loaders.generated';
|
|
3
|
+
import { topologyFeatures, topologyObjects } from './topology';
|
|
4
|
+
/** Ponto de entrada (`@trismegisto/maps/basemaps/<entry>`) e objeto da topologia de um id de camada. */
|
|
5
|
+
export function resolveBasemapLayerId(id) {
|
|
6
|
+
const key = id.trim().replace(/^\/+|\/+$/g, '');
|
|
7
|
+
switch (key.toLowerCase()) {
|
|
8
|
+
case 'world':
|
|
9
|
+
case 'world/110m':
|
|
10
|
+
return { entry: 'world', object: 'paises' };
|
|
11
|
+
case 'world/50m':
|
|
12
|
+
return { entry: 'world-50m', object: 'paises' };
|
|
13
|
+
case 'br/regioes':
|
|
14
|
+
return { entry: 'br', object: 'regioes' };
|
|
15
|
+
case 'br/ufs':
|
|
16
|
+
case 'br/estados':
|
|
17
|
+
return { entry: 'br', object: 'ufs' };
|
|
18
|
+
case 'br/mesorregioes':
|
|
19
|
+
return { entry: 'br-mesorregioes', object: 'mesorregioes' };
|
|
20
|
+
case 'br/microrregioes':
|
|
21
|
+
return { entry: 'br-microrregioes', object: 'microrregioes' };
|
|
22
|
+
}
|
|
23
|
+
const m = /^br\/municipios\/(\w+)$/i.exec(key);
|
|
24
|
+
if (m) {
|
|
25
|
+
const uf = ufSigla(m[1]);
|
|
26
|
+
return uf ? { entry: `br-municipios/${uf.toLowerCase()}`, object: 'municipios' } : null;
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
/** Sigla da UF a partir da sigla (qualquer caixa) ou do código IBGE de 2 dígitos. `null` se não existe. */
|
|
31
|
+
export function ufSigla(value) {
|
|
32
|
+
const v = String(value).trim().toUpperCase();
|
|
33
|
+
if (BR_UF_CODES[v])
|
|
34
|
+
return v;
|
|
35
|
+
const hit = Object.entries(BR_UF_CODES).find(([, code]) => code === v);
|
|
36
|
+
return hit ? hit[0] : null;
|
|
37
|
+
}
|
|
38
|
+
/** Siglas das 27 UFs, na ordem do código IBGE. */
|
|
39
|
+
export function brUfSiglas() {
|
|
40
|
+
return Object.entries(BR_UF_CODES)
|
|
41
|
+
.sort((a, b) => Number(a[1]) - Number(b[1]))
|
|
42
|
+
.map(([s]) => s);
|
|
43
|
+
}
|
|
44
|
+
const DATA_CACHE = new Map();
|
|
45
|
+
const LAYER_CACHE = new WeakMap();
|
|
46
|
+
/** Carrega os dados de um ponto de entrada (uma vez só; as chamadas seguintes reaproveitam a promessa). */
|
|
47
|
+
export function loadBasemapData(entry) {
|
|
48
|
+
let pending = DATA_CACHE.get(entry);
|
|
49
|
+
if (!pending) {
|
|
50
|
+
const loader = BASEMAP_LOADERS[entry];
|
|
51
|
+
if (!loader)
|
|
52
|
+
return Promise.reject(new Error(`[hermes-maps] mapa base desconhecido "${entry}"`));
|
|
53
|
+
pending = loader();
|
|
54
|
+
// Falha de rede (chunk que não chegou) não fica no cache: a próxima tentativa recarrega.
|
|
55
|
+
pending.catch(() => DATA_CACHE.delete(entry));
|
|
56
|
+
DATA_CACHE.set(entry, pending);
|
|
57
|
+
}
|
|
58
|
+
return pending;
|
|
59
|
+
}
|
|
60
|
+
/** Carrega e prepara a camada pelo id (`'br/ufs'`, `'br/municipios/SP'`, `'world'`...). */
|
|
61
|
+
export async function loadBasemapLayer(id) {
|
|
62
|
+
const resolved = resolveBasemapLayerId(id);
|
|
63
|
+
if (!resolved)
|
|
64
|
+
throw new Error(`[hermes-maps] camada de mapa base desconhecida "${id}"`);
|
|
65
|
+
const data = await loadBasemapData(resolved.entry);
|
|
66
|
+
return basemapLayer(data, resolved.object, id);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Prepara uma camada a partir de dados já importados (`import { BASEMAP } from '@trismegisto/maps/basemaps/br'`).
|
|
70
|
+
* Sem `object`, usa o primeiro objeto da topologia. Resultado em cache por dados + objeto.
|
|
71
|
+
*/
|
|
72
|
+
export function basemapLayer(data, object, id) {
|
|
73
|
+
const name = object ?? topologyObjects(data.topology)[0] ?? '';
|
|
74
|
+
let byObject = LAYER_CACHE.get(data);
|
|
75
|
+
if (!byObject) {
|
|
76
|
+
byObject = new Map();
|
|
77
|
+
LAYER_CACHE.set(data, byObject);
|
|
78
|
+
}
|
|
79
|
+
const cached = byObject.get(name);
|
|
80
|
+
if (cached)
|
|
81
|
+
return id && cached.id !== id ? { ...cached, id } : cached;
|
|
82
|
+
const regions = [];
|
|
83
|
+
for (const feature of topologyFeatures(data.topology, name).features) {
|
|
84
|
+
const g = feature.geometry;
|
|
85
|
+
if (!g || (g.type !== 'Polygon' && g.type !== 'MultiPolygon'))
|
|
86
|
+
continue;
|
|
87
|
+
const polygons = g.type === 'Polygon' ? [g.coordinates] : g.coordinates;
|
|
88
|
+
const props = (feature.properties ?? {});
|
|
89
|
+
const rings = [];
|
|
90
|
+
let south = Infinity;
|
|
91
|
+
let west = Infinity;
|
|
92
|
+
let north = -Infinity;
|
|
93
|
+
let east = -Infinity;
|
|
94
|
+
let area = 0;
|
|
95
|
+
let largest = { area: -1, ring: null };
|
|
96
|
+
for (const polygon of polygons) {
|
|
97
|
+
polygon.forEach((ring, index) => {
|
|
98
|
+
const projected = projectRing(ring);
|
|
99
|
+
if (projected.length < 6)
|
|
100
|
+
return;
|
|
101
|
+
rings.push(projected);
|
|
102
|
+
const a = ringArea(projected);
|
|
103
|
+
if (index === 0) {
|
|
104
|
+
area += a;
|
|
105
|
+
if (a > largest.area)
|
|
106
|
+
largest = { area: a, ring: projected };
|
|
107
|
+
}
|
|
108
|
+
else
|
|
109
|
+
area -= a;
|
|
110
|
+
for (const p of ring) {
|
|
111
|
+
south = Math.min(south, p[1]);
|
|
112
|
+
north = Math.max(north, p[1]);
|
|
113
|
+
west = Math.min(west, p[0]);
|
|
114
|
+
east = Math.max(east, p[0]);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
if (!rings.length)
|
|
119
|
+
continue;
|
|
120
|
+
const lx = Number(props['lx']);
|
|
121
|
+
const ly = Number(props['ly']);
|
|
122
|
+
const labelPoint = Number.isFinite(lx) && Number.isFinite(ly) ? { lat: ly, lng: lx } : unprojectPoint(centroid(largest.ring ?? rings[0]));
|
|
123
|
+
const properties = { ...props };
|
|
124
|
+
delete properties['lx'];
|
|
125
|
+
delete properties['ly'];
|
|
126
|
+
regions.push({
|
|
127
|
+
id: String(feature.id ?? props['id'] ?? regions.length),
|
|
128
|
+
name: String(props['name'] ?? feature.id ?? ''),
|
|
129
|
+
properties,
|
|
130
|
+
rings,
|
|
131
|
+
bounds: { south, west, north, east },
|
|
132
|
+
labelPoint,
|
|
133
|
+
area: Math.max(area, 0),
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
const bounds = regions.reduce((acc, r) => acc
|
|
137
|
+
? {
|
|
138
|
+
south: Math.min(acc.south, r.bounds.south),
|
|
139
|
+
west: Math.min(acc.west, r.bounds.west),
|
|
140
|
+
north: Math.max(acc.north, r.bounds.north),
|
|
141
|
+
east: Math.max(acc.east, r.bounds.east),
|
|
142
|
+
}
|
|
143
|
+
: r.bounds, null) ?? { south: -MAX_LATITUDE, west: -180, north: MAX_LATITUDE, east: 180 };
|
|
144
|
+
const layer = {
|
|
145
|
+
id: id ?? `${data.id}/${name}`,
|
|
146
|
+
data,
|
|
147
|
+
object: name,
|
|
148
|
+
regions,
|
|
149
|
+
bounds: { ...bounds, south: Math.max(bounds.south, -MAX_LATITUDE), north: Math.min(bounds.north, MAX_LATITUDE) },
|
|
150
|
+
attribution: data.attribution,
|
|
151
|
+
maxZoom: data.maxZoom,
|
|
152
|
+
};
|
|
153
|
+
byObject.set(name, layer);
|
|
154
|
+
return layer;
|
|
155
|
+
}
|
|
156
|
+
/** Nome da região no idioma (`name_en`, `name_es` quando existem; senão `name`). */
|
|
157
|
+
export function regionName(region, locale) {
|
|
158
|
+
const lang = locale.toLowerCase().split(/[-_]/)[0];
|
|
159
|
+
const localized = lang && lang !== 'pt' ? region.properties[`name_${lang}`] : undefined;
|
|
160
|
+
return typeof localized === 'string' && localized ? localized : region.name;
|
|
161
|
+
}
|
|
162
|
+
// ------------------------------------------------------------------ projeção dos anéis
|
|
163
|
+
const DEG = Math.PI / 180;
|
|
164
|
+
const MAX_SIN = Math.sin(MAX_LATITUDE * DEG);
|
|
165
|
+
/** Graus → fração do mundo do Mercator (mesma conta de `latLngToPixel`, sem o tamanho do mundo). */
|
|
166
|
+
export function projectFraction(lng, lat) {
|
|
167
|
+
const s = Math.max(-MAX_SIN, Math.min(MAX_SIN, Math.sin(lat * DEG)));
|
|
168
|
+
return [lng / 360 + 0.5, 0.5 - Math.log((1 + s) / (1 - s)) / (4 * Math.PI)];
|
|
169
|
+
}
|
|
170
|
+
function projectRing(ring) {
|
|
171
|
+
const out = new Float64Array(ring.length * 2);
|
|
172
|
+
ring.forEach((p, k) => {
|
|
173
|
+
const [x, y] = projectFraction(p[0], p[1]);
|
|
174
|
+
out[k * 2] = x;
|
|
175
|
+
out[k * 2 + 1] = y;
|
|
176
|
+
});
|
|
177
|
+
return out;
|
|
178
|
+
}
|
|
179
|
+
function unprojectPoint([x, y]) {
|
|
180
|
+
const lat = (2 * Math.atan(Math.exp((0.5 - y) * 2 * Math.PI)) - Math.PI / 2) / DEG;
|
|
181
|
+
return { lat, lng: (x - 0.5) * 360 };
|
|
182
|
+
}
|
|
183
|
+
function ringArea(r) {
|
|
184
|
+
let a = 0;
|
|
185
|
+
const n = r.length / 2;
|
|
186
|
+
for (let i = 0, j = n - 1; i < n; j = i++)
|
|
187
|
+
a += r[j * 2] * r[i * 2 + 1] - r[i * 2] * r[j * 2 + 1];
|
|
188
|
+
return Math.abs(a / 2);
|
|
189
|
+
}
|
|
190
|
+
function centroid(r) {
|
|
191
|
+
let x = 0;
|
|
192
|
+
let y = 0;
|
|
193
|
+
let a = 0;
|
|
194
|
+
const n = r.length / 2;
|
|
195
|
+
for (let i = 0, j = n - 1; i < n; j = i++) {
|
|
196
|
+
const f = r[j * 2] * r[i * 2 + 1] - r[i * 2] * r[j * 2 + 1];
|
|
197
|
+
x += (r[j * 2] + r[i * 2]) * f;
|
|
198
|
+
y += (r[j * 2 + 1] + r[i * 2 + 1]) * f;
|
|
199
|
+
a += f;
|
|
200
|
+
}
|
|
201
|
+
if (!a)
|
|
202
|
+
return [r[0], r[1]];
|
|
203
|
+
return [x / (3 * a), y / (3 * a)];
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Atributo `d` da região no enquadramento: anéis em pixels da camada, descartando pontos a menos de
|
|
207
|
+
* `minStep` px do anterior (nos zooms baixos a maior parte dos vértices cai no mesmo pixel). Anel que
|
|
208
|
+
* encolhe a menos de 3 pontos some — a não ser que a região inteira sumisse, aí desenha sem descarte.
|
|
209
|
+
*/
|
|
210
|
+
export function regionPath(region, frame, tileSize = DEFAULT_TILE_SIZE, minStep = 0.75) {
|
|
211
|
+
const d = ringsPath(region.rings, frame, tileSize, minStep);
|
|
212
|
+
return d || ringsPath(region.rings, frame, tileSize, 0);
|
|
213
|
+
}
|
|
214
|
+
function ringsPath(rings, frame, tileSize, minStep) {
|
|
215
|
+
const size = worldSize(frame.zoom, tileSize);
|
|
216
|
+
const ox = frame.origin.x;
|
|
217
|
+
const oy = frame.origin.y;
|
|
218
|
+
const min2 = minStep * minStep;
|
|
219
|
+
let d = '';
|
|
220
|
+
for (const ring of rings) {
|
|
221
|
+
const n = ring.length / 2;
|
|
222
|
+
let part = '';
|
|
223
|
+
let count = 0;
|
|
224
|
+
let lx = NaN;
|
|
225
|
+
let ly = NaN;
|
|
226
|
+
for (let k = 0; k < n; k++) {
|
|
227
|
+
const x = ring[k * 2] * size - ox;
|
|
228
|
+
const y = ring[k * 2 + 1] * size - oy;
|
|
229
|
+
const last = k === n - 1;
|
|
230
|
+
if (count && !last) {
|
|
231
|
+
const dx = x - lx;
|
|
232
|
+
const dy = y - ly;
|
|
233
|
+
if (dx * dx + dy * dy < min2)
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
const rx = Math.round(x * 10) / 10;
|
|
237
|
+
const ry = Math.round(y * 10) / 10;
|
|
238
|
+
if (rx === lx && ry === ly)
|
|
239
|
+
continue;
|
|
240
|
+
part += (count ? 'L' : 'M') + rx + ' ' + ry;
|
|
241
|
+
lx = rx;
|
|
242
|
+
ly = ry;
|
|
243
|
+
count++;
|
|
244
|
+
}
|
|
245
|
+
if (count >= 3)
|
|
246
|
+
d += part + 'z';
|
|
247
|
+
}
|
|
248
|
+
return d;
|
|
249
|
+
}
|
|
250
|
+
/** Ponto da camada (pixels) de uma coordenada já projetada em fração do mundo. */
|
|
251
|
+
export function fractionToLayer(x, y, frame, tileSize = DEFAULT_TILE_SIZE) {
|
|
252
|
+
const size = worldSize(frame.zoom, tileSize);
|
|
253
|
+
return { x: x * size - frame.origin.x, y: y * size - frame.origin.y };
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Rótulos que cabem sem se sobrepor: das regiões maiores para as menores, cada texto ocupa um retângulo
|
|
257
|
+
* estimado (`fontSize` × 0,6 por caractere); o que colide com um já posto, ou cuja região é menor que o
|
|
258
|
+
* próprio texto, fica de fora.
|
|
259
|
+
*/
|
|
260
|
+
export function placeLabels(regions, text, frame, fontSize, tileSize = DEFAULT_TILE_SIZE) {
|
|
261
|
+
const size = worldSize(frame.zoom, tileSize);
|
|
262
|
+
const placed = [];
|
|
263
|
+
const out = [];
|
|
264
|
+
const sorted = [...regions].sort((a, b) => b.area - a.area);
|
|
265
|
+
for (const region of sorted) {
|
|
266
|
+
const label = text(region);
|
|
267
|
+
if (!label)
|
|
268
|
+
continue;
|
|
269
|
+
const w = label.length * fontSize * 0.6;
|
|
270
|
+
const h = fontSize * 1.2;
|
|
271
|
+
// A região precisa ter pelo menos a largura do texto (área ≈ lado²).
|
|
272
|
+
const side = Math.sqrt(region.area) * size;
|
|
273
|
+
if (side < Math.min(w, fontSize * 2.5))
|
|
274
|
+
continue;
|
|
275
|
+
const [fx, fy] = projectFraction(region.labelPoint.lng, region.labelPoint.lat);
|
|
276
|
+
const x = fx * size - frame.origin.x;
|
|
277
|
+
const y = fy * size - frame.origin.y;
|
|
278
|
+
const box = { x0: x - w / 2 - 2, y0: y - h / 2, x1: x + w / 2 + 2, y1: y + h / 2 };
|
|
279
|
+
if (placed.some((b) => box.x0 < b.x1 && box.x1 > b.x0 && box.y0 < b.y1 && box.y1 > b.y0))
|
|
280
|
+
continue;
|
|
281
|
+
placed.push(box);
|
|
282
|
+
out.push({ id: region.id, text: label, x: Math.round(x * 10) / 10, y: Math.round(y * 10) / 10 });
|
|
283
|
+
}
|
|
284
|
+
return out;
|
|
285
|
+
}
|
|
286
|
+
//# sourceMappingURL=basemap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basemap.js","sourceRoot":"","sources":["../../../src/core/basemap.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAe,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA6C5E,wGAAwG;AACxG,MAAM,UAAU,qBAAqB,CAAC,EAAU;IAC9C,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IAChD,QAAQ,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC;QAC1B,KAAK,OAAO,CAAC;QACb,KAAK,YAAY;YACf,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;QAC9C,KAAK,WAAW;YACd,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;QAClD,KAAK,YAAY;YACf,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;QAC5C,KAAK,QAAQ,CAAC;QACd,KAAK,YAAY;YACf,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;QACxC,KAAK,iBAAiB;YACpB,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAA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,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;YAAE,SAAS;QACnG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjB,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACnG,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { BasemapRegion } from './basemap';
|
|
2
|
+
import { ChoroplethClass, ChoroplethMatch, ChoroplethOptions } from './choropleth';
|
|
3
|
+
import { MapDataPanel, MapLegendItem } from './map-layers';
|
|
4
|
+
import type { MapsMessages } from './maps-messages';
|
|
5
|
+
/** Uma região com tudo que o SVG e a leitura precisam. */
|
|
6
|
+
export interface ChoroplethItem {
|
|
7
|
+
readonly region: BasemapRegion;
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly value: number | null;
|
|
10
|
+
readonly row: Readonly<Record<string, unknown>> | null;
|
|
11
|
+
readonly valueText: string;
|
|
12
|
+
readonly cls: ChoroplethClass | null;
|
|
13
|
+
readonly label: string;
|
|
14
|
+
}
|
|
15
|
+
/** Item desenhado: a região e o caminho dela no enquadramento atual. */
|
|
16
|
+
export interface ChoroplethDrawnItem {
|
|
17
|
+
readonly item: ChoroplethItem;
|
|
18
|
+
readonly d: string;
|
|
19
|
+
}
|
|
20
|
+
/** Formatador dos valores: o do app ou número no idioma (até 2 casas). */
|
|
21
|
+
export declare function choroplethFormatter(custom: ((value: number) => string) | null | undefined, locale: string): (value: number) => string;
|
|
22
|
+
/** Classes da escala com os valores ligados. */
|
|
23
|
+
export declare function choroplethClassList(matches: ReadonlyMap<string, ChoroplethMatch>, options: ChoroplethOptions): ChoroplethClass[];
|
|
24
|
+
/** Regiões em ordem alfabética (a ordem do teclado, da lista e da tabela). */
|
|
25
|
+
export declare function choroplethItems(regions: readonly BasemapRegion[], matches: ReadonlyMap<string, ChoroplethMatch>, classes: readonly ChoroplethClass[], format: (value: number) => string, locale: string, text: MapsMessages['data']): ChoroplethItem[];
|
|
26
|
+
/** Itens com caminho no enquadramento (os que não têm geometria visível ficam de fora). */
|
|
27
|
+
export declare function choroplethDrawn(items: readonly ChoroplethItem[], paths: readonly {
|
|
28
|
+
readonly region: BasemapRegion;
|
|
29
|
+
readonly d: string;
|
|
30
|
+
}[]): ChoroplethDrawnItem[];
|
|
31
|
+
/** Região com `tabindex="0"` (a última vai para o fim da lista se a camada encolheu). */
|
|
32
|
+
export declare function choroplethTabStop(active: number, count: number): number;
|
|
33
|
+
/** Itens da legenda: intervalo por cor + "Sem dados" quando falta valor. */
|
|
34
|
+
export declare function choroplethLegend(classes: readonly ChoroplethClass[], items: readonly ChoroplethItem[], format: (value: number) => string, text: MapsMessages['data']): MapLegendItem[];
|
|
35
|
+
export interface ChoroplethPanelOptions {
|
|
36
|
+
readonly id: string;
|
|
37
|
+
/** Nome do conjunto de dados (vazio: o nome padrão do mapa). */
|
|
38
|
+
readonly label: string;
|
|
39
|
+
/** Legenda sobre o mapa (`null`: sem legenda). */
|
|
40
|
+
readonly legend: readonly MapLegendItem[] | null;
|
|
41
|
+
/** Botão e tabela de dados. */
|
|
42
|
+
readonly table: boolean;
|
|
43
|
+
readonly regionLabel: string;
|
|
44
|
+
readonly valueLabel: string;
|
|
45
|
+
}
|
|
46
|
+
/** Painel (legenda + tabela) que a camada pede ao mapa; `null` sem legenda nem tabela. */
|
|
47
|
+
export declare function choroplethPanel(options: ChoroplethPanelOptions, items: readonly ChoroplethItem[], text: MapsMessages): MapDataPanel | null;
|
|
48
|
+
/** Nome da lista de regiões focáveis. */
|
|
49
|
+
export declare function choroplethListLabel(label: string, text: MapsMessages): string;
|
|
50
|
+
/** O que uma tecla faz na lista de regiões. */
|
|
51
|
+
export type RegionKeyAction = {
|
|
52
|
+
readonly type: 'move';
|
|
53
|
+
readonly index: number;
|
|
54
|
+
} | {
|
|
55
|
+
readonly type: 'select';
|
|
56
|
+
} | {
|
|
57
|
+
readonly type: 'exit';
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Tecla na região `index` de `count`: setas andam uma, PageUp/PageDown dez, Home/End vão às pontas, Enter/Espaço
|
|
61
|
+
* selecionam e Esc volta ao mapa. `null`: a tecla não é da lista.
|
|
62
|
+
*/
|
|
63
|
+
export declare function regionKeyAction(key: string, index: number, count: number): RegionKeyAction | null;
|