@redus/georedus-ui 0.10.0 → 0.11.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/CHANGELOG.md +12 -0
- package/dist/DocumentIframe/index.d.ts +3 -0
- package/dist/GeoReDUS/GeoReDUS.d.ts +1 -0
- package/dist/GeoReDUS/util.d.ts +17 -0
- package/dist/main.js +465 -212
- package/dist/viewSpecs/basemaps/dataviz/index.d.ts +9 -8
- package/dist/viewSpecs/basemaps/satellite/index.d.ts +9 -8
- package/dist/viewSpecs/development/ana_br_bacias_hidrograficas.d.ts +1 -0
- package/dist/viewSpecs/development/curvatura.d.ts +26 -1
- package/dist/viewSpecs/development/declividade.d.ts +17 -18
- package/dist/viewSpecs/development/hand.d.ts +3 -0
- package/dist/viewSpecs/development/redus_mutirao_cop_2025.d.ts +6 -3
- package/dist/viewSpecs/development/temperatura_superficie.d.ts +3 -0
- package/dist/viewSpecs/presets/cem_censo/2022/choropleth/intramun/index.d.ts +18 -5
- package/dist/viewSpecs/presets/cem_censo/2022/choropleth/intramun/metadata/defaultMetadata.d.ts +1 -1
- package/dist/viewSpecs/presets/cem_censo/2022/choropleth/intramun/setor_censitario.d.ts +18 -5
- package/package.json +3 -1
- package/dist/GeoReDUS/_useMapStyle.d.ts +0 -1
package/dist/main.js
CHANGED
|
@@ -12,15 +12,16 @@ import { dataMergeProtocol } from '@orioro/vector-tile-util';
|
|
|
12
12
|
import maplibregl from 'maplibre-gl';
|
|
13
13
|
import { get as get$1 } from '@orioro/get';
|
|
14
14
|
import { buffer } from '@turf/turf';
|
|
15
|
+
import { scaleQuantile } from 'd3-scale';
|
|
15
16
|
import { csvParse } from 'd3-dsv';
|
|
16
17
|
import { strAutoCast } from '@orioro/cast';
|
|
17
18
|
import { fmtLayerAbsoluteId, waves_1, svgImageGenerator, SVG_PATTERNS, makeSyncedMaps, LayeredMap, useMapRegistry, useTilesLoading, HoverTooltip, layeredMapOnClickHandler, DynamicImages, ControlContainer, InspectControl, MapWindow, TerrainControl, fitGeometry } from '@orioro/react-maplibre-util';
|
|
18
|
-
import { colord } from 'colord';
|
|
19
|
-
import { Heading, Portal, Badge, Tabs, Tooltip, IconButton, Theme, Text, Popover, Dialog } from '@radix-ui/themes';
|
|
20
19
|
import styled, { keyframes } from 'styled-components';
|
|
21
|
-
import {
|
|
22
|
-
import { Icon } from '@mdi/react';
|
|
20
|
+
import { colord } from 'colord';
|
|
23
21
|
import React$1, { useState, useMemo, useCallback, useContext, createContext, useReducer, useEffect, useRef } from 'react';
|
|
22
|
+
import { Heading, Portal, Badge, Tabs, Tooltip, IconButton, Theme, Text, Popover, Dialog } from '@radix-ui/themes';
|
|
23
|
+
import { mdiSprout, mdiTree, mdiCurrencyUsd, mdiAccountMultipleOutline, mdiScaleBalance, mdiHelpCircleOutline, mdiDownload, mdiDotsVertical, mdiOpacity, mdiFilterVariant, mdiBookOpenVariant, mdiMap, mdiEarth, mdiHospitalBox, mdiHomeCity, mdiSchool, mdiAccountGroup, mdiContentCopy, mdiLinkVariant, mdiChevronLeft, mdiShareVariantOutline, mdiForumOutline, mdiDragVertical, mdiLayers, mdiClose, mdiHospital } from '@mdi/js';
|
|
24
|
+
import Icon$1, { Icon } from '@mdi/react';
|
|
24
25
|
import Confetti from 'react-confetti';
|
|
25
26
|
import { nodeIdFromPath } from '@orioro/tree-model';
|
|
26
27
|
import { makeDirNav } from '@orioro/react-dir-nav';
|
|
@@ -40,6 +41,7 @@ import { Legend } from '@orioro/react-chart-util';
|
|
|
40
41
|
import 'maplibre-gl/dist/maplibre-gl.css';
|
|
41
42
|
import { useQueries, useQuery } from '@tanstack/react-query';
|
|
42
43
|
import { AttributionControl, GeolocateControl, FullscreenControl, NavigationControl, ScaleControl, useMap } from 'react-map-gl/maplibre';
|
|
44
|
+
import { pointToTile, tileToBBOX } from '@mapbox/tilebelt';
|
|
43
45
|
|
|
44
46
|
function _arrayLikeToArray(r, a) {
|
|
45
47
|
(null == a || a > r.length) && (a = r.length);
|
|
@@ -4958,16 +4960,57 @@ function _censoColorScheme(colorSchemeName) {
|
|
|
4958
4960
|
return colorScheme;
|
|
4959
4961
|
}
|
|
4960
4962
|
|
|
4963
|
+
//
|
|
4964
|
+
// TODO: restructure and move into maplibre util with naturalBreaks
|
|
4965
|
+
// Maybe move into separate lib?
|
|
4966
|
+
//
|
|
4967
|
+
function _quantileBreakpoints(_ref) {
|
|
4968
|
+
var k = _ref.k,
|
|
4969
|
+
values = _ref.values,
|
|
4970
|
+
scalesByK = _ref.scalesByK,
|
|
4971
|
+
_ref$defaultColor = _ref.defaultColor,
|
|
4972
|
+
defaultColor = _ref$defaultColor === void 0 ? '#efefef' : _ref$defaultColor;
|
|
4973
|
+
var scale = scaleQuantile().domain(values) // your data
|
|
4974
|
+
.range(new Array(k).fill(null).map(function (_, idx) {
|
|
4975
|
+
return idx;
|
|
4976
|
+
})); // number of bins
|
|
4977
|
+
|
|
4978
|
+
var breaks = scale.quantiles(); // → the cutoff values
|
|
4979
|
+
|
|
4980
|
+
//
|
|
4981
|
+
// Will produce an array such as:
|
|
4982
|
+
// [
|
|
4983
|
+
// "below_10",
|
|
4984
|
+
// 10,
|
|
4985
|
+
// "between_10_20",
|
|
4986
|
+
// 20,
|
|
4987
|
+
// "between_20_30",
|
|
4988
|
+
// 30,
|
|
4989
|
+
// "above_30"
|
|
4990
|
+
// ]
|
|
4991
|
+
//
|
|
4992
|
+
|
|
4993
|
+
var colorScale = scalesByK[k];
|
|
4994
|
+
var colorScaleStops = breaks.map(function (breakValue, index) {
|
|
4995
|
+
var color = colorScale[index + 1];
|
|
4996
|
+
return index === 0 ? [
|
|
4997
|
+
// For below 0 values, will use defaultColor
|
|
4998
|
+
defaultColor, 0,
|
|
4999
|
+
// colorScale
|
|
5000
|
+
colorScale[0], breakValue, color] : [breakValue, color];
|
|
5001
|
+
}).flat(1);
|
|
5002
|
+
return colorScaleStops;
|
|
5003
|
+
}
|
|
4961
5004
|
function defaultMetadata(_x, _x2) {
|
|
4962
5005
|
return _defaultMetadata.apply(this, arguments);
|
|
4963
5006
|
}
|
|
4964
5007
|
function _defaultMetadata() {
|
|
4965
|
-
_defaultMetadata = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(
|
|
4966
|
-
var GLOBAL_CONTEXT, PARSED_SCHEMA, METADATA_API_ENDPOINT, municipioId, variableId, variant, rawDataCacheUrl, rawData, scaleValues, colorScheme;
|
|
5008
|
+
_defaultMetadata = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2, context) {
|
|
5009
|
+
var GLOBAL_CONTEXT, PARSED_SCHEMA, METADATA_API_ENDPOINT, municipioId, variableId, variant, rawDataCacheUrl, rawData, scaleValues, colorScheme, colorScaleStops;
|
|
4967
5010
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4968
5011
|
while (1) switch (_context.prev = _context.next) {
|
|
4969
5012
|
case 0:
|
|
4970
|
-
GLOBAL_CONTEXT =
|
|
5013
|
+
GLOBAL_CONTEXT = _ref2.GLOBAL_CONTEXT, PARSED_SCHEMA = _ref2.PARSED_SCHEMA;
|
|
4971
5014
|
METADATA_API_ENDPOINT = GLOBAL_CONTEXT.METADATA_API_ENDPOINT; // Load data on the municipio
|
|
4972
5015
|
municipioId = context.app.municipioId;
|
|
4973
5016
|
variableId = get$1(context, 'view.conf.data.variableId');
|
|
@@ -4987,6 +5030,12 @@ function _defaultMetadata() {
|
|
|
4987
5030
|
rawData = _context.sent;
|
|
4988
5031
|
scaleValues = get$1(rawData, "[].".concat(variableId));
|
|
4989
5032
|
colorScheme = _censoColorScheme(variant.colorScheme);
|
|
5033
|
+
colorScaleStops = variant.classificationMethod === 'quantile(5)' ? _quantileBreakpoints(_objectSpread2({
|
|
5034
|
+
k: 5,
|
|
5035
|
+
values: scaleValues
|
|
5036
|
+
}, colorScheme)) : ['$naturalBreaks', scaleValues, _objectSpread2(_objectSpread2({}, colorScheme), {}, {
|
|
5037
|
+
minK: 5
|
|
5038
|
+
})];
|
|
4990
5039
|
return _context.abrupt("return", {
|
|
4991
5040
|
//
|
|
4992
5041
|
// Review if this is actually needed, as now we are loading
|
|
@@ -4998,11 +5047,9 @@ function _defaultMetadata() {
|
|
|
4998
5047
|
rawDataCacheUrl: rawDataCacheUrl,
|
|
4999
5048
|
rawData: rawData,
|
|
5000
5049
|
colorScheme: colorScheme,
|
|
5001
|
-
colorScaleStops:
|
|
5002
|
-
minK: 5
|
|
5003
|
-
})]
|
|
5050
|
+
colorScaleStops: colorScaleStops
|
|
5004
5051
|
});
|
|
5005
|
-
case
|
|
5052
|
+
case 13:
|
|
5006
5053
|
case "end":
|
|
5007
5054
|
return _context.stop();
|
|
5008
5055
|
}
|
|
@@ -5339,6 +5386,13 @@ function setor_censitario_sources(_ref2) {
|
|
|
5339
5386
|
attribution: PARSED_SCHEMA.sourceLabel,
|
|
5340
5387
|
minzoom: 8,
|
|
5341
5388
|
//
|
|
5389
|
+
// TODO: review
|
|
5390
|
+
//
|
|
5391
|
+
bounds: resolve.fn(function (_ref3) {
|
|
5392
|
+
var app = _ref3.app;
|
|
5393
|
+
return app.mapBounds;
|
|
5394
|
+
}),
|
|
5395
|
+
//
|
|
5342
5396
|
// Prevent system from fetching data beyond necessary detail
|
|
5343
5397
|
//
|
|
5344
5398
|
maxzoom: BUILDINGS_MIN_ZOOM,
|
|
@@ -5362,8 +5416,8 @@ function setor_censitario_layers(opts) {
|
|
|
5362
5416
|
// vector source
|
|
5363
5417
|
//
|
|
5364
5418
|
var _vectorSourceFillColor = ['$flat', [['step', ['coalesce', ['get', 'value'], -1]], ['$get', 'view.metadata.colorScaleStops']]];
|
|
5365
|
-
var _filter = resolve.fn(function (
|
|
5366
|
-
var app =
|
|
5419
|
+
var _filter = resolve.fn(function (_ref5) {
|
|
5420
|
+
var app = _ref5.app;
|
|
5367
5421
|
return ['all',
|
|
5368
5422
|
//
|
|
5369
5423
|
// cd_situacao = '9' -> Massas de água,
|
|
@@ -5390,16 +5444,33 @@ function setor_censitario_layers(opts) {
|
|
|
5390
5444
|
legends: setor_censitario_legends(opts),
|
|
5391
5445
|
tooltip: {
|
|
5392
5446
|
title: ['$literal', ['$template', 'Setor censitário ${0}', ['$get', 'feature.properties.id']]],
|
|
5393
|
-
entries: [[['$get', ['$get', 'view.conf.data.variableId'], ['$get', 'view.metadata.labels']], ['$literal',
|
|
5447
|
+
entries: [[['$get', ['$get', 'view.conf.data.variableId'], ['$get', 'view.metadata.labels']], ['$literal', resolve.fn(function (context) {
|
|
5448
|
+
var variableId = get$1(context, 'view.conf.data.variableId');
|
|
5449
|
+
if (variableId === 'total_pessoas_por_hectare') {
|
|
5450
|
+
try {
|
|
5451
|
+
var value_src = JSON.parse(context.feature.properties.value_src);
|
|
5452
|
+
return value_src['bas.v0001'];
|
|
5453
|
+
} catch (err) {
|
|
5454
|
+
console.error(err);
|
|
5455
|
+
return null;
|
|
5456
|
+
}
|
|
5457
|
+
} else {
|
|
5458
|
+
return ['$fmt', ['$get', 'feature.properties.value'], {
|
|
5459
|
+
number: NUMBER_FMT
|
|
5460
|
+
}];
|
|
5461
|
+
}
|
|
5462
|
+
})
|
|
5463
|
+
|
|
5464
|
+
//
|
|
5465
|
+
// TODO: refactor
|
|
5466
|
+
// THIS IS THE ACTUAL:
|
|
5467
|
+
//
|
|
5394
5468
|
// [
|
|
5395
|
-
// '$
|
|
5396
|
-
// 'feature.properties
|
|
5397
|
-
//
|
|
5398
|
-
// ['$get', 'view.conf.data.variableId'],
|
|
5469
|
+
// '$fmt',
|
|
5470
|
+
// ['$get', 'feature.properties.value'],
|
|
5471
|
+
// { number: NUMBER_FMT },
|
|
5399
5472
|
// ],
|
|
5400
|
-
]
|
|
5401
|
-
number: NUMBER_FMT
|
|
5402
|
-
}]]]].concat(_toConsumableArray([
|
|
5473
|
+
]]].concat(_toConsumableArray([
|
|
5403
5474
|
// 'v0001',
|
|
5404
5475
|
// 'v0002',
|
|
5405
5476
|
// 'v0003',
|
|
@@ -5423,7 +5494,6 @@ function setor_censitario_layers(opts) {
|
|
|
5423
5494
|
// ['$get', 'view.conf.data.variableId'],
|
|
5424
5495
|
// ],
|
|
5425
5496
|
]]]])
|
|
5426
|
-
// entries: [CHART_UTIL._variableValueTooltipEntry],
|
|
5427
5497
|
},
|
|
5428
5498
|
filter: _filter,
|
|
5429
5499
|
// maxzoom: 14,
|
|
@@ -6463,6 +6533,7 @@ function _util_bacia(_ref) {
|
|
|
6463
6533
|
indicator_id: id,
|
|
6464
6534
|
id: id,
|
|
6465
6535
|
label: label,
|
|
6536
|
+
sourceLabel: 'ANA',
|
|
6466
6537
|
path: "Divis\xF5es territoriais / _ / Bacias Hidrogr\xE1ficas",
|
|
6467
6538
|
metadata: {},
|
|
6468
6539
|
sources: _defineProperty({}, id, {
|
|
@@ -6768,10 +6839,65 @@ function br_divisao_territorial_views(conf) {
|
|
|
6768
6839
|
'line-opacity': 0.5
|
|
6769
6840
|
}
|
|
6770
6841
|
}
|
|
6771
|
-
}, conf))
|
|
6842
|
+
}, conf))
|
|
6843
|
+
|
|
6844
|
+
// TEST
|
|
6845
|
+
// br_divisao_territorial({
|
|
6846
|
+
// path: 'ANA',
|
|
6847
|
+
// label: 'Trechos de drenagem',
|
|
6848
|
+
// id: 'ana_malha_br_bho_trechos_de_drenagem_2017.geom',
|
|
6849
|
+
// line: {
|
|
6850
|
+
// paint: {
|
|
6851
|
+
// 'line-color': 'magenta',
|
|
6852
|
+
// 'line-width': 2,
|
|
6853
|
+
// 'line-opacity': 0.5,
|
|
6854
|
+
// },
|
|
6855
|
+
// },
|
|
6856
|
+
// ...conf,
|
|
6857
|
+
// }),
|
|
6858
|
+
];
|
|
6859
|
+
}
|
|
6860
|
+
|
|
6861
|
+
var _templateObject$6;
|
|
6862
|
+
var StyledIframe = styled.iframe(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n border: none;\n width: 100%;\n height: 100%;\n"])));
|
|
6863
|
+
function DocumentIframe(_ref) {
|
|
6864
|
+
var src = _ref.src;
|
|
6865
|
+
return /*#__PURE__*/React.createElement(AspectRatio, {
|
|
6866
|
+
ratio: 210 / 297
|
|
6867
|
+
}, /*#__PURE__*/React.createElement(StyledIframe, {
|
|
6868
|
+
src: src
|
|
6869
|
+
}));
|
|
6772
6870
|
}
|
|
6773
6871
|
|
|
6774
6872
|
var CURVATURA_ID = 'curvatura';
|
|
6873
|
+
var TRANSPARENT$2 = [0, 0, 0, 0];
|
|
6874
|
+
var CURVATURA_CLASSES = [{
|
|
6875
|
+
value: 1,
|
|
6876
|
+
label: 'Muito côncava',
|
|
6877
|
+
color: '#d92bcb'
|
|
6878
|
+
}, {
|
|
6879
|
+
value: 2,
|
|
6880
|
+
label: 'Côncava',
|
|
6881
|
+
color: '#b49bcb'
|
|
6882
|
+
}, {
|
|
6883
|
+
value: 3,
|
|
6884
|
+
label: 'Retilínea',
|
|
6885
|
+
color: '#dcdcdc'
|
|
6886
|
+
}, {
|
|
6887
|
+
value: 4,
|
|
6888
|
+
label: 'Convexa',
|
|
6889
|
+
color: '#f3ce5e'
|
|
6890
|
+
}, {
|
|
6891
|
+
value: 5,
|
|
6892
|
+
label: 'Muito convexa',
|
|
6893
|
+
color: '#fd952e'
|
|
6894
|
+
}];
|
|
6895
|
+
var DEFAULT_CURVATURA_ACTIVE_CLASSSES = CURVATURA_CLASSES.map(function (cl) {
|
|
6896
|
+
return cl.value;
|
|
6897
|
+
});
|
|
6898
|
+
function _curvaturaActiveClasses(candidate) {
|
|
6899
|
+
return Array.isArray(candidate) && candidate.length > 0 ? candidate : DEFAULT_CURVATURA_ACTIVE_CLASSSES;
|
|
6900
|
+
}
|
|
6775
6901
|
function curvatura(_ref) {
|
|
6776
6902
|
var RASTER_TILE_SERVER_ENDPOINT = _ref.RASTER_TILE_SERVER_ENDPOINT,
|
|
6777
6903
|
mosaicJsonUrl = _ref.mosaicJsonUrl;
|
|
@@ -6781,49 +6907,42 @@ function curvatura(_ref) {
|
|
|
6781
6907
|
collection_id: CURVATURA_ID,
|
|
6782
6908
|
indicator_id: CURVATURA_ID,
|
|
6783
6909
|
id: CURVATURA_ID,
|
|
6910
|
+
sourceLabel: 'ANADEM (ANA)',
|
|
6784
6911
|
label: 'Forma da encosta - Em perfil',
|
|
6912
|
+
shortDescription: 'Refere-se às formas côncava, convexa e retilínea do terreno, analisada em perfil',
|
|
6785
6913
|
path: "Emerg\xEAncias clim\xE1ticas / / Suscetibilidade a deslizamentos",
|
|
6914
|
+
metodology: /*#__PURE__*/React.createElement(DocumentIframe, {
|
|
6915
|
+
src: "/georedus/metodologia/perfil-de-curvatura.pdf"
|
|
6916
|
+
}),
|
|
6786
6917
|
confSchema: {
|
|
6787
6918
|
data: {
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
// const maxLabel = `${temperaturaRange[1]}°${temperaturaRange[1] === DEFAULT_DECLIVIDADE_RANGE[1] ? '+' : ''}`
|
|
6801
|
-
// return `Intervalo de temperatura (${minLabel} - ${maxLabel})`
|
|
6802
|
-
// }),
|
|
6803
|
-
// ),
|
|
6804
|
-
// helperText: 'Intervalo de temperatura apresentado',
|
|
6805
|
-
// },
|
|
6919
|
+
curvaturaActiveClasses: {
|
|
6920
|
+
type: 'checkboxSelect',
|
|
6921
|
+
options: CURVATURA_CLASSES.map(function (curv) {
|
|
6922
|
+
return {
|
|
6923
|
+
label: curv.label,
|
|
6924
|
+
value: curv.value
|
|
6925
|
+
};
|
|
6926
|
+
}),
|
|
6927
|
+
defaultValue: CURVATURA_CLASSES.map(function (curv) {
|
|
6928
|
+
return curv.value;
|
|
6929
|
+
})
|
|
6930
|
+
}
|
|
6806
6931
|
}
|
|
6807
6932
|
},
|
|
6808
6933
|
metadata: {},
|
|
6809
6934
|
sources: _defineProperty({}, CURVATURA_ID, {
|
|
6810
|
-
minzoom:
|
|
6935
|
+
minzoom: 9,
|
|
6811
6936
|
maxzoom: 14,
|
|
6812
6937
|
type: 'raster',
|
|
6813
6938
|
tiles: [resolve.fn(function (_ref2) {
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
// )
|
|
6818
|
-
|
|
6939
|
+
var _conf$data;
|
|
6940
|
+
var conf = _ref2.view.conf;
|
|
6941
|
+
var curvaturaActiveClasses = _curvaturaActiveClasses(conf === null || conf === void 0 || (_conf$data = conf.data) === null || _conf$data === void 0 ? void 0 : _conf$data.curvaturaActiveClasses);
|
|
6819
6942
|
var baseUrl = "".concat(RASTER_TILE_SERVER_ENDPOINT, "/mosaicjson/tiles/WebMercatorQuad/{z}/{x}/{y}").concat(DEVICE_PIXEL_RATIO_SUFFIX);
|
|
6820
|
-
var COLOR_MAP = {
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
3: '#dcdcdc',
|
|
6824
|
-
4: '#f3ce5e',
|
|
6825
|
-
5: '#fd952e'
|
|
6826
|
-
};
|
|
6943
|
+
var COLOR_MAP = Object.fromEntries(CURVATURA_CLASSES.map(function (curv) {
|
|
6944
|
+
return [curv.value, curvaturaActiveClasses.includes(curv.value) ? curv.color : TRANSPARENT$2];
|
|
6945
|
+
}));
|
|
6827
6946
|
return "".concat(baseUrl, "?").concat($urlSearch([{
|
|
6828
6947
|
url: mosaicJsonUrl,
|
|
6829
6948
|
colormap: COLOR_MAP
|
|
@@ -6831,25 +6950,33 @@ function curvatura(_ref) {
|
|
|
6831
6950
|
})]
|
|
6832
6951
|
}),
|
|
6833
6952
|
layers: _defineProperty({}, "".concat(CURVATURA_ID), {
|
|
6834
|
-
minzoom:
|
|
6953
|
+
minzoom: 9,
|
|
6835
6954
|
// zIndex: 10,
|
|
6836
6955
|
type: 'raster',
|
|
6837
6956
|
source: CURVATURA_ID,
|
|
6838
6957
|
paint: {
|
|
6839
6958
|
'raster-opacity': 0.85
|
|
6840
|
-
}
|
|
6959
|
+
},
|
|
6960
|
+
legends: [{
|
|
6961
|
+
type: 'CategoricalLegend',
|
|
6962
|
+
title: 'Forma da encosta',
|
|
6963
|
+
items: resolve.fn(function (_ref3) {
|
|
6964
|
+
var _conf$data2;
|
|
6965
|
+
var conf = _ref3.view.conf;
|
|
6966
|
+
var curvaturaActiveClasses = _curvaturaActiveClasses(conf === null || conf === void 0 || (_conf$data2 = conf.data) === null || _conf$data2 === void 0 ? void 0 : _conf$data2.curvaturaActiveClasses);
|
|
6967
|
+
return CURVATURA_CLASSES.filter(function (curv) {
|
|
6968
|
+
return curvaturaActiveClasses.includes(curv.value);
|
|
6969
|
+
});
|
|
6970
|
+
})
|
|
6971
|
+
}]
|
|
6841
6972
|
})
|
|
6842
6973
|
};
|
|
6843
6974
|
}
|
|
6844
6975
|
|
|
6845
6976
|
var DECLIVIDADE_ID = 'declividade';
|
|
6846
|
-
var DEFAULT_DECLIVIDADE_RANGE = [0, 45];
|
|
6847
6977
|
var TRANSPARENT$1 = [0, 0, 0, 0];
|
|
6848
|
-
function _declividadeRange(candidate) {
|
|
6849
|
-
return Array.isArray(candidate) && candidate.length === 2 && typeof candidate[0] === 'number' && typeof candidate[1] === 'number' ? candidate : DEFAULT_DECLIVIDADE_RANGE;
|
|
6850
|
-
}
|
|
6851
6978
|
var PRECISION$1 = 0.00000001;
|
|
6852
|
-
var
|
|
6979
|
+
var DECLIVIDADE_CLASSES = [{
|
|
6853
6980
|
color: '#2B83BA',
|
|
6854
6981
|
label: '0º',
|
|
6855
6982
|
range: [0, 0 + PRECISION$1 - PRECISION$1 / 10]
|
|
@@ -6889,7 +7016,17 @@ var CLASSES_DECLIVIDADE = [{
|
|
|
6889
7016
|
color: '#860003',
|
|
6890
7017
|
label: 'Acima de 45º',
|
|
6891
7018
|
range: [45 + PRECISION$1, 999999]
|
|
6892
|
-
}]
|
|
7019
|
+
}].map(function (cl) {
|
|
7020
|
+
return _objectSpread2(_objectSpread2({}, cl), {}, {
|
|
7021
|
+
value: cl.label
|
|
7022
|
+
});
|
|
7023
|
+
});
|
|
7024
|
+
var DEFAULT_DECLIVIDADE_ACTIVE_CLASSSES = DECLIVIDADE_CLASSES.map(function (cl) {
|
|
7025
|
+
return cl.value;
|
|
7026
|
+
});
|
|
7027
|
+
function _declividadeActiveClasses(candidate) {
|
|
7028
|
+
return Array.isArray(candidate) && candidate.length > 0 ? candidate : DEFAULT_DECLIVIDADE_ACTIVE_CLASSSES;
|
|
7029
|
+
}
|
|
6893
7030
|
function declividade(_ref) {
|
|
6894
7031
|
var RASTER_TILE_SERVER_ENDPOINT = _ref.RASTER_TILE_SERVER_ENDPOINT,
|
|
6895
7032
|
mosaicJsonUrl = _ref.mosaicJsonUrl;
|
|
@@ -6899,53 +7036,50 @@ function declividade(_ref) {
|
|
|
6899
7036
|
collection_id: DECLIVIDADE_ID,
|
|
6900
7037
|
indicator_id: DECLIVIDADE_ID,
|
|
6901
7038
|
id: DECLIVIDADE_ID,
|
|
7039
|
+
sourceLabel: 'ANADEM (ANA)',
|
|
6902
7040
|
label: 'Declividade',
|
|
7041
|
+
shortDescription: 'Ângulo de inclinação da superfície do terreno com relação à horizontal',
|
|
6903
7042
|
path: "Emerg\xEAncias clim\xE1ticas / / Suscetibilidade a deslizamentos",
|
|
7043
|
+
metodology: /*#__PURE__*/React.createElement(DocumentIframe, {
|
|
7044
|
+
src: "/georedus/metodologia/declividade.pdf"
|
|
7045
|
+
}),
|
|
6904
7046
|
confSchema: {
|
|
6905
7047
|
data: {
|
|
6906
|
-
|
|
6907
|
-
type: '
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
return "Intervalo de declividade (".concat(minLabel, " - ").concat(maxLabel, ")");
|
|
6918
|
-
})),
|
|
6919
|
-
helperText: 'Intervalo de declividade apresentado'
|
|
7048
|
+
declividadeActiveClasses: {
|
|
7049
|
+
type: 'checkboxSelect',
|
|
7050
|
+
options: DECLIVIDADE_CLASSES.map(function (cl) {
|
|
7051
|
+
return {
|
|
7052
|
+
label: cl.label,
|
|
7053
|
+
value: cl.value
|
|
7054
|
+
};
|
|
7055
|
+
}),
|
|
7056
|
+
defaultValue: DECLIVIDADE_CLASSES.map(function (cl) {
|
|
7057
|
+
return cl.value;
|
|
7058
|
+
})
|
|
6920
7059
|
}
|
|
6921
7060
|
}
|
|
6922
7061
|
},
|
|
6923
7062
|
metadata: {},
|
|
6924
7063
|
sources: _defineProperty({}, DECLIVIDADE_ID, {
|
|
6925
|
-
minzoom:
|
|
7064
|
+
minzoom: 9,
|
|
6926
7065
|
maxzoom: 14,
|
|
6927
7066
|
type: 'raster',
|
|
6928
7067
|
tiles: [resolve.fn(function (_ref2) {
|
|
6929
7068
|
var _conf$data;
|
|
6930
7069
|
var conf = _ref2.view.conf;
|
|
6931
|
-
var
|
|
7070
|
+
var declividadeActiveClasses = _declividadeActiveClasses(conf === null || conf === void 0 || (_conf$data = conf.data) === null || _conf$data === void 0 ? void 0 : _conf$data.declividadeActiveClasses);
|
|
6932
7071
|
var baseUrl = "".concat(RASTER_TILE_SERVER_ENDPOINT, "/mosaicjson/tiles/WebMercatorQuad/{z}/{x}/{y}").concat(DEVICE_PIXEL_RATIO_SUFFIX);
|
|
6933
|
-
var COLOR_MAP =
|
|
6934
|
-
return [cl.range, cl.color];
|
|
7072
|
+
var COLOR_MAP = DECLIVIDADE_CLASSES.map(function (cl) {
|
|
7073
|
+
return [cl.range, declividadeActiveClasses.includes(cl.value) ? cl.color : TRANSPARENT$1];
|
|
6935
7074
|
});
|
|
6936
7075
|
return "".concat(baseUrl, "?").concat($urlSearch([{
|
|
6937
7076
|
url: mosaicJsonUrl,
|
|
6938
|
-
colormap: COLOR_MAP
|
|
6939
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
6940
|
-
bounds = _ref4[0],
|
|
6941
|
-
color = _ref4[1];
|
|
6942
|
-
return [bounds, bounds[0] >= declividadeRange[0] && bounds[1] <= declividadeRange[1] ? color : TRANSPARENT$1];
|
|
6943
|
-
})
|
|
7077
|
+
colormap: COLOR_MAP
|
|
6944
7078
|
}]));
|
|
6945
7079
|
})]
|
|
6946
7080
|
}),
|
|
6947
7081
|
layers: _defineProperty({}, "".concat(DECLIVIDADE_ID), {
|
|
6948
|
-
minzoom:
|
|
7082
|
+
minzoom: 9,
|
|
6949
7083
|
// zIndex: 10,
|
|
6950
7084
|
type: 'raster',
|
|
6951
7085
|
source: DECLIVIDADE_ID,
|
|
@@ -6955,7 +7089,14 @@ function declividade(_ref) {
|
|
|
6955
7089
|
legends: [{
|
|
6956
7090
|
type: 'CategoricalLegend',
|
|
6957
7091
|
title: 'Classes de Declividade',
|
|
6958
|
-
items:
|
|
7092
|
+
items: resolve.fn(function (_ref3) {
|
|
7093
|
+
var _conf$data2;
|
|
7094
|
+
var conf = _ref3.view.conf;
|
|
7095
|
+
var declividadeActiveClasses = _declividadeActiveClasses(conf === null || conf === void 0 || (_conf$data2 = conf.data) === null || _conf$data2 === void 0 ? void 0 : _conf$data2.declividadeActiveClasses);
|
|
7096
|
+
return DECLIVIDADE_CLASSES.filter(function (cl) {
|
|
7097
|
+
return declividadeActiveClasses.includes(cl.value);
|
|
7098
|
+
});
|
|
7099
|
+
})
|
|
6959
7100
|
}]
|
|
6960
7101
|
})
|
|
6961
7102
|
};
|
|
@@ -6977,8 +7118,8 @@ var COLOR_MAP_BASE = [[[0, 0.1], colord(BASE_COLOR).darken(0.2).toHex()], [[0.10
|
|
|
6977
7118
|
function hand_legends() {
|
|
6978
7119
|
return [{
|
|
6979
7120
|
type: 'ContinuousColorLegend',
|
|
6980
|
-
title: 'Altura da drenagem mais próxima',
|
|
6981
|
-
unit: '
|
|
7121
|
+
title: 'Altura acima da drenagem mais próxima',
|
|
7122
|
+
unit: 'metros',
|
|
6982
7123
|
numberUnit: 'm',
|
|
6983
7124
|
colors: resolve.fn(function (_ref) {
|
|
6984
7125
|
var conf = _ref.view.conf;
|
|
@@ -7012,8 +7153,13 @@ function hand(_ref7) {
|
|
|
7012
7153
|
collection_id: HAND_ID,
|
|
7013
7154
|
indicator_id: HAND_ID,
|
|
7014
7155
|
id: HAND_ID,
|
|
7015
|
-
|
|
7016
|
-
|
|
7156
|
+
sourceLabel: 'ANADEM (ANA)',
|
|
7157
|
+
label: 'Altura acima da drenagem mais próxima',
|
|
7158
|
+
shortDescription: 'Áreas suscetíveis à inundação calculadas por meio da distância vertical em relação ao canal de drenagem mais próximo',
|
|
7159
|
+
path: "Emerg\xEAncias clim\xE1ticas / / Suscetibilidade \xE0 inunda\xE7\xE3o",
|
|
7160
|
+
metodology: /*#__PURE__*/React.createElement(DocumentIframe, {
|
|
7161
|
+
src: "/georedus/metodologia/inundacao-hand.pdf"
|
|
7162
|
+
}),
|
|
7017
7163
|
confSchema: {
|
|
7018
7164
|
data: {
|
|
7019
7165
|
handValue: {
|
|
@@ -7033,7 +7179,7 @@ function hand(_ref7) {
|
|
|
7033
7179
|
metadata: {},
|
|
7034
7180
|
sources: _defineProperty({}, HAND_ID, {
|
|
7035
7181
|
type: 'raster',
|
|
7036
|
-
minzoom:
|
|
7182
|
+
minzoom: 9,
|
|
7037
7183
|
maxzoom: 14,
|
|
7038
7184
|
tiles: [resolve.fn(function (_ref8) {
|
|
7039
7185
|
var conf = _ref8.view.conf;
|
|
@@ -7052,7 +7198,7 @@ function hand(_ref7) {
|
|
|
7052
7198
|
})]
|
|
7053
7199
|
}),
|
|
7054
7200
|
layers: _defineProperty({}, "".concat(HAND_ID), {
|
|
7055
|
-
minzoom:
|
|
7201
|
+
minzoom: 9,
|
|
7056
7202
|
// zIndex: 10,
|
|
7057
7203
|
type: 'raster',
|
|
7058
7204
|
source: HAND_ID,
|
|
@@ -7174,13 +7320,13 @@ function AsyncImage(_ref) {
|
|
|
7174
7320
|
_useState2 = _slicedToArray(_useState, 2),
|
|
7175
7321
|
loaded = _useState2[0],
|
|
7176
7322
|
setLoaded = _useState2[1];
|
|
7177
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7323
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
7178
7324
|
style: {
|
|
7179
7325
|
position: 'relative'
|
|
7180
7326
|
}
|
|
7181
|
-
}, /*#__PURE__*/React.createElement(AspectRatio, {
|
|
7327
|
+
}, /*#__PURE__*/React$1.createElement(AspectRatio, {
|
|
7182
7328
|
ratio: 16 / 9
|
|
7183
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
7329
|
+
}, /*#__PURE__*/React$1.createElement("img", {
|
|
7184
7330
|
src: src,
|
|
7185
7331
|
onLoad: function onLoad() {
|
|
7186
7332
|
return setLoaded(true);
|
|
@@ -7192,7 +7338,7 @@ function AsyncImage(_ref) {
|
|
|
7192
7338
|
display: loaded ? 'block' : 'none',
|
|
7193
7339
|
maxWidth: '100%'
|
|
7194
7340
|
}
|
|
7195
|
-
})), !loaded && /*#__PURE__*/React.createElement(LoadingIndicator, {
|
|
7341
|
+
})), !loaded && /*#__PURE__*/React$1.createElement(LoadingIndicator, {
|
|
7196
7342
|
style: {
|
|
7197
7343
|
position: 'absolute',
|
|
7198
7344
|
top: '50%',
|
|
@@ -7256,8 +7402,10 @@ function redus_mutirao_cop_2025(conf) {
|
|
|
7256
7402
|
collection_id: REDUS_MUTIRAO_COP_2025_ID,
|
|
7257
7403
|
indicator_id: REDUS_MUTIRAO_COP_2025_ID,
|
|
7258
7404
|
id: REDUS_MUTIRAO_COP_2025_ID,
|
|
7405
|
+
sourceLabel: 'ReDUS',
|
|
7406
|
+
path: "Emerg\xEAncias Clim\xE1ticas / _ / Mutir\xE3o COP30 - Bel\xE9m",
|
|
7259
7407
|
label: 'Mutirão ReDUS COP30',
|
|
7260
|
-
|
|
7408
|
+
shortDescription: 'Ações concretas de Desenvolvimento Urbano Sustentável mapeadas no Mutirão ReDUS rumo à COP30',
|
|
7261
7409
|
metadata: {},
|
|
7262
7410
|
sources: _defineProperty({}, REDUS_MUTIRAO_COP_2025_ID, {
|
|
7263
7411
|
type: 'vector',
|
|
@@ -7311,104 +7459,105 @@ function redus_mutirao_cop_2025(conf) {
|
|
|
7311
7459
|
case 0:
|
|
7312
7460
|
properties = feature.properties;
|
|
7313
7461
|
_context.next = 3;
|
|
7314
|
-
return context.dialogs.view(/*#__PURE__*/React.createElement(Flex, {
|
|
7462
|
+
return context.dialogs.view(/*#__PURE__*/React$1.createElement(Flex, {
|
|
7315
7463
|
direction: "column",
|
|
7316
7464
|
gap: "4"
|
|
7317
|
-
}, /*#__PURE__*/React.createElement(Flex, {
|
|
7465
|
+
}, /*#__PURE__*/React$1.createElement(Flex, {
|
|
7318
7466
|
direction: "column",
|
|
7319
7467
|
gap: "2"
|
|
7320
|
-
}, /*#__PURE__*/React.createElement(Heading, {
|
|
7468
|
+
}, /*#__PURE__*/React$1.createElement(Heading, {
|
|
7321
7469
|
as: "h1",
|
|
7322
7470
|
size: "6"
|
|
7323
|
-
}, properties.name), /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(Confetti, {
|
|
7471
|
+
}, properties.name), /*#__PURE__*/React$1.createElement(Portal, null, /*#__PURE__*/React$1.createElement(Confetti, {
|
|
7324
7472
|
style: {
|
|
7325
7473
|
position: 'fixed',
|
|
7326
7474
|
top: 0,
|
|
7327
7475
|
left: 0,
|
|
7328
|
-
zIndex: 9999
|
|
7476
|
+
zIndex: 9999,
|
|
7477
|
+
width: '100vw'
|
|
7329
7478
|
},
|
|
7330
7479
|
recycle: false,
|
|
7331
7480
|
numberOfPieces: 700,
|
|
7332
7481
|
tweenDuration: 8000
|
|
7333
|
-
})), (properties.eixos_cop_30_text || properties.odus_text) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(AutoWrapContainer, null, JSON.parse(properties.eixos_cop_30_text).map(function (eixo, idx) {
|
|
7334
|
-
return /*#__PURE__*/React.createElement(Badge, {
|
|
7482
|
+
})), (properties.eixos_cop_30_text || properties.odus_text) && /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement(AutoWrapContainer, null, JSON.parse(properties.eixos_cop_30_text).map(function (eixo, idx) {
|
|
7483
|
+
return /*#__PURE__*/React$1.createElement(Badge, {
|
|
7335
7484
|
color: "green",
|
|
7336
7485
|
key: idx
|
|
7337
7486
|
}, _eixoShortLabel(eixo));
|
|
7338
7487
|
}), JSON.parse(properties.odus_text).map(function (obj, idx) {
|
|
7339
|
-
return /*#__PURE__*/React.createElement(Badge, {
|
|
7488
|
+
return /*#__PURE__*/React$1.createElement(Badge, {
|
|
7340
7489
|
key: idx
|
|
7341
7490
|
}, obj);
|
|
7342
|
-
}))), /*#__PURE__*/React.createElement(Heading, {
|
|
7491
|
+
}))), /*#__PURE__*/React$1.createElement(Heading, {
|
|
7343
7492
|
as: "h3",
|
|
7344
7493
|
size: "2",
|
|
7345
7494
|
style: {
|
|
7346
7495
|
fontWeight: 'normal'
|
|
7347
7496
|
}
|
|
7348
|
-
}, "Organiza\xE7\xE3o respons\xE1vel:", ' ', /*#__PURE__*/React.createElement("strong", null, properties.organizacao)), properties.parcerias && /*#__PURE__*/React.createElement(Heading, {
|
|
7497
|
+
}, "Organiza\xE7\xE3o respons\xE1vel:", ' ', /*#__PURE__*/React$1.createElement("strong", null, properties.organizacao)), properties.parcerias && /*#__PURE__*/React$1.createElement(Heading, {
|
|
7349
7498
|
as: "h3",
|
|
7350
7499
|
size: "2",
|
|
7351
7500
|
style: {
|
|
7352
7501
|
fontWeight: 'normal'
|
|
7353
7502
|
}
|
|
7354
|
-
}, "Em parceria com: ", /*#__PURE__*/React.createElement("strong", null, properties.parcerias)), /*#__PURE__*/React.createElement(Heading, {
|
|
7503
|
+
}, "Em parceria com: ", /*#__PURE__*/React$1.createElement("strong", null, properties.parcerias)), /*#__PURE__*/React$1.createElement(Heading, {
|
|
7355
7504
|
as: "h3",
|
|
7356
7505
|
size: "2",
|
|
7357
7506
|
style: {
|
|
7358
7507
|
fontWeight: 'normal'
|
|
7359
7508
|
}
|
|
7360
|
-
}, "Cidade:", ' ', /*#__PURE__*/React.createElement("strong", null, properties.cidade, " - ", properties.estado))), properties.cover_image && /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement("img", {
|
|
7509
|
+
}, "Cidade:", ' ', /*#__PURE__*/React$1.createElement("strong", null, properties.cidade, " - ", properties.estado))), properties.cover_image && /*#__PURE__*/React$1.createElement(Box, null, /*#__PURE__*/React$1.createElement("img", {
|
|
7361
7510
|
style: {
|
|
7362
7511
|
maxWidth: '100%'
|
|
7363
7512
|
},
|
|
7364
7513
|
src: properties.cover_image
|
|
7365
|
-
})), properties.descricao_text && /*#__PURE__*/React.createElement(Flex, {
|
|
7514
|
+
})), properties.descricao_text && /*#__PURE__*/React$1.createElement(Flex, {
|
|
7366
7515
|
gap: "2"
|
|
7367
|
-
}, /*#__PURE__*/React.createElement(Heading, {
|
|
7516
|
+
}, /*#__PURE__*/React$1.createElement(Heading, {
|
|
7368
7517
|
size: "3"
|
|
7369
|
-
}, "Descri\xE7\xE3o:"), /*#__PURE__*/React.createElement(RichTextOutput, {
|
|
7518
|
+
}, "Descri\xE7\xE3o:"), /*#__PURE__*/React$1.createElement(RichTextOutput, {
|
|
7370
7519
|
value: JSON.parse(properties.descricao_text)
|
|
7371
|
-
})), properties.impacto_text && /*#__PURE__*/React.createElement(Flex, {
|
|
7520
|
+
})), properties.impacto_text && /*#__PURE__*/React$1.createElement(Flex, {
|
|
7372
7521
|
gap: "2"
|
|
7373
|
-
}, /*#__PURE__*/React.createElement(Heading, {
|
|
7522
|
+
}, /*#__PURE__*/React$1.createElement(Heading, {
|
|
7374
7523
|
size: "3"
|
|
7375
|
-
}, "Impacto:"), /*#__PURE__*/React.createElement(RichTextOutput, {
|
|
7524
|
+
}, "Impacto:"), /*#__PURE__*/React$1.createElement(RichTextOutput, {
|
|
7376
7525
|
value: JSON.parse(properties.impacto_text)
|
|
7377
|
-
})), properties.escala_de_atuacao_text && /*#__PURE__*/React.createElement(Flex, {
|
|
7526
|
+
})), properties.escala_de_atuacao_text && /*#__PURE__*/React$1.createElement(Flex, {
|
|
7378
7527
|
gap: "2"
|
|
7379
|
-
}, /*#__PURE__*/React.createElement(Heading, {
|
|
7528
|
+
}, /*#__PURE__*/React$1.createElement(Heading, {
|
|
7380
7529
|
size: "3"
|
|
7381
|
-
}, "Escala de atua\xE7\xE3o:"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnstyledList, null, JSON.parse(properties.escala_de_atuacao_text).map(function (escala, idx) {
|
|
7382
|
-
return /*#__PURE__*/React.createElement("li", {
|
|
7530
|
+
}, "Escala de atua\xE7\xE3o:"), /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement(UnstyledList, null, JSON.parse(properties.escala_de_atuacao_text).map(function (escala, idx) {
|
|
7531
|
+
return /*#__PURE__*/React$1.createElement("li", {
|
|
7383
7532
|
key: idx
|
|
7384
7533
|
}, escala);
|
|
7385
|
-
})))), properties.fase_text && /*#__PURE__*/React.createElement(Flex, {
|
|
7534
|
+
})))), properties.fase_text && /*#__PURE__*/React$1.createElement(Flex, {
|
|
7386
7535
|
gap: "2"
|
|
7387
|
-
}, /*#__PURE__*/React.createElement(Heading, {
|
|
7536
|
+
}, /*#__PURE__*/React$1.createElement(Heading, {
|
|
7388
7537
|
size: "3"
|
|
7389
|
-
}, "Fase:"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnstyledList, null, JSON.parse(properties.fase_text).map(function (fase, idx) {
|
|
7390
|
-
return /*#__PURE__*/React.createElement("li", {
|
|
7538
|
+
}, "Fase:"), /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement(UnstyledList, null, JSON.parse(properties.fase_text).map(function (fase, idx) {
|
|
7539
|
+
return /*#__PURE__*/React$1.createElement("li", {
|
|
7391
7540
|
key: idx
|
|
7392
7541
|
}, fase);
|
|
7393
|
-
})))), /*#__PURE__*/React.createElement(Flex, {
|
|
7542
|
+
})))), /*#__PURE__*/React$1.createElement(Flex, {
|
|
7394
7543
|
gap: "2"
|
|
7395
|
-
}, /*#__PURE__*/React.createElement(Heading, {
|
|
7544
|
+
}, /*#__PURE__*/React$1.createElement(Heading, {
|
|
7396
7545
|
size: "3"
|
|
7397
|
-
}, "Informa\xE7\xF5es de contato:"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnstyledList, null, _ensureUrl(properties.site) && /*#__PURE__*/React.createElement("li", null, "Site:", ' ', /*#__PURE__*/React.createElement("a", {
|
|
7546
|
+
}, "Informa\xE7\xF5es de contato:"), /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement(UnstyledList, null, _ensureUrl(properties.site) && /*#__PURE__*/React$1.createElement("li", null, "Site:", ' ', /*#__PURE__*/React$1.createElement("a", {
|
|
7398
7547
|
href: _ensureUrl(properties.site),
|
|
7399
7548
|
target: "_blank",
|
|
7400
7549
|
rel: "noreferrer noopener"
|
|
7401
|
-
}, _ensureUrl(properties.site))), properties.redes_sociais && /*#__PURE__*/React.createElement("li", null, "Redes sociais: ", properties.redes_sociais), properties.email && /*#__PURE__*/React.createElement("li", null, "E-mail:", ' ', /*#__PURE__*/React.createElement("a", {
|
|
7550
|
+
}, _ensureUrl(properties.site))), properties.redes_sociais && /*#__PURE__*/React$1.createElement("li", null, "Redes sociais: ", properties.redes_sociais), properties.email && /*#__PURE__*/React$1.createElement("li", null, "E-mail:", ' ', /*#__PURE__*/React$1.createElement("a", {
|
|
7402
7551
|
href: "mailto:".concat(properties.email)
|
|
7403
|
-
}, properties.email))))), properties.other_attachments_text && /*#__PURE__*/React.createElement(Flex, {
|
|
7552
|
+
}, properties.email))))), properties.other_attachments_text && /*#__PURE__*/React$1.createElement(Flex, {
|
|
7404
7553
|
gap: "2"
|
|
7405
|
-
}, /*#__PURE__*/React.createElement(Heading, {
|
|
7554
|
+
}, /*#__PURE__*/React$1.createElement(Heading, {
|
|
7406
7555
|
size: "3"
|
|
7407
|
-
}, "Mais informa\xE7\xF5es:"), /*#__PURE__*/React.createElement(EvenSpacedList, {
|
|
7556
|
+
}, "Mais informa\xE7\xF5es:"), /*#__PURE__*/React$1.createElement(EvenSpacedList, {
|
|
7408
7557
|
columns: 2,
|
|
7409
7558
|
gap: "3"
|
|
7410
7559
|
}, JSON.parse(properties.other_attachments_text).map(function (fase, idx) {
|
|
7411
|
-
return /*#__PURE__*/React.createElement(FileOutput, {
|
|
7560
|
+
return /*#__PURE__*/React$1.createElement(FileOutput, {
|
|
7412
7561
|
value: fase,
|
|
7413
7562
|
key: idx
|
|
7414
7563
|
});
|
|
@@ -7432,11 +7581,11 @@ function redus_mutirao_cop_2025(conf) {
|
|
|
7432
7581
|
var _feature$properties;
|
|
7433
7582
|
return item.value === (feature === null || feature === void 0 || (_feature$properties = feature.properties) === null || _feature$properties === void 0 ? void 0 : _feature$properties.eixos_cop_30_primeiro);
|
|
7434
7583
|
}) || null;
|
|
7435
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7584
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
7436
7585
|
style: {
|
|
7437
7586
|
display: 'inline-flex'
|
|
7438
7587
|
}
|
|
7439
|
-
}, eixo && /*#__PURE__*/React.createElement(Icon, {
|
|
7588
|
+
}, eixo && /*#__PURE__*/React$1.createElement(Icon, {
|
|
7440
7589
|
path: eixo.iconPath,
|
|
7441
7590
|
size: "18px",
|
|
7442
7591
|
style: {
|
|
@@ -7454,7 +7603,7 @@ function redus_mutirao_cop_2025(conf) {
|
|
|
7454
7603
|
return (_feature$properties3 = feature.properties) !== null && _feature$properties3 !== void 0 && _feature$properties3.parcerias ? ['Parcerias', (_feature$properties4 = feature.properties) === null || _feature$properties4 === void 0 ? void 0 : _feature$properties4.parcerias] : null;
|
|
7455
7604
|
})), resolve.literal(resolve.fn(function (_ref4) {
|
|
7456
7605
|
var feature = _ref4.feature;
|
|
7457
|
-
return feature.properties.cover_image ? [null, /*#__PURE__*/React.createElement(AsyncImage, {
|
|
7606
|
+
return feature.properties.cover_image ? [null, /*#__PURE__*/React$1.createElement(AsyncImage, {
|
|
7458
7607
|
style: {
|
|
7459
7608
|
maxWidth: '100%'
|
|
7460
7609
|
},
|
|
@@ -7469,7 +7618,7 @@ function redus_mutirao_cop_2025(conf) {
|
|
|
7469
7618
|
items: LEGEND_ITEMS.map(function (item) {
|
|
7470
7619
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
7471
7620
|
box: {
|
|
7472
|
-
children: item.iconPath && /*#__PURE__*/React.createElement(Icon, {
|
|
7621
|
+
children: item.iconPath && /*#__PURE__*/React$1.createElement(Icon, {
|
|
7473
7622
|
path: item.iconPath,
|
|
7474
7623
|
size: "14px",
|
|
7475
7624
|
color: "white"
|
|
@@ -7508,7 +7657,7 @@ function temperatura_legends() {
|
|
|
7508
7657
|
return [{
|
|
7509
7658
|
type: 'ContinuousColorLegend',
|
|
7510
7659
|
title: 'Temperatura máxima de superfície (ºC)',
|
|
7511
|
-
unit: 'Valor médio em º
|
|
7660
|
+
unit: 'Valor médio em º Celsius da temperatura máxima no período de 2021 - 2025',
|
|
7512
7661
|
numberUnit: 'º',
|
|
7513
7662
|
colors: resolve.fn(function (_ref) {
|
|
7514
7663
|
var _conf$data;
|
|
@@ -7540,65 +7689,64 @@ function temperatura_superficie(_ref7) {
|
|
|
7540
7689
|
var RASTER_TILE_SERVER_ENDPOINT = _ref7.RASTER_TILE_SERVER_ENDPOINT,
|
|
7541
7690
|
mosaicJsonUrl = _ref7.mosaicJsonUrl;
|
|
7542
7691
|
var DEVICE_PIXEL_RATIO_SUFFIX = typeof window !== 'undefined' && window.devicePixelRatio > 1 ? '@2x' : '';
|
|
7543
|
-
return {
|
|
7692
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
7544
7693
|
viewType: VIEW_TYPE_SURFACE_CHOROPLETH,
|
|
7545
7694
|
collection_id: TEMPERATURA_SUPERFICIE_ID,
|
|
7546
7695
|
indicator_id: TEMPERATURA_SUPERFICIE_ID,
|
|
7547
7696
|
id: TEMPERATURA_SUPERFICIE_ID,
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7552
|
-
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
|
|
7561
|
-
|
|
7562
|
-
|
|
7563
|
-
|
|
7564
|
-
|
|
7565
|
-
|
|
7566
|
-
|
|
7567
|
-
|
|
7697
|
+
sourceLabel: 'Landsat-8 e Landsat-9',
|
|
7698
|
+
shortDescription: 'Refere-se à',
|
|
7699
|
+
metodology: /*#__PURE__*/React.createElement(DocumentIframe, {
|
|
7700
|
+
src: "/georedus/metodologia/maximas-de-temperatura.pdf"
|
|
7701
|
+
}),
|
|
7702
|
+
label: 'Temperatura máxima de superfície (ºC)'
|
|
7703
|
+
}, "shortDescription", 'Valores máximos anuais de temperatura de superfície do período de 2021 a 2025'), "year", '2021 - 2025'), "path", "Emerg\xEAncias clim\xE1ticas / / Extremos de temperatura"), "confSchema", {
|
|
7704
|
+
data: {
|
|
7705
|
+
temperaturaRange: {
|
|
7706
|
+
type: 'range',
|
|
7707
|
+
defaultValue: DEFAULT_TEMPERATURA_RANGE,
|
|
7708
|
+
step: 1,
|
|
7709
|
+
min: DEFAULT_TEMPERATURA_RANGE[0],
|
|
7710
|
+
max: DEFAULT_TEMPERATURA_RANGE[1],
|
|
7711
|
+
label: resolve.literal(resolve.fn(function (context) {
|
|
7712
|
+
var _context$value;
|
|
7713
|
+
var temperaturaRange = _temperaturaRange((_context$value = context.value) === null || _context$value === void 0 ? void 0 : _context$value.temperaturaRange);
|
|
7714
|
+
var minLabel = "".concat(temperaturaRange[0], "\xB0");
|
|
7715
|
+
var maxLabel = "".concat(temperaturaRange[1], "\xB0").concat(temperaturaRange[1] === DEFAULT_TEMPERATURA_RANGE[1] ? '+' : '');
|
|
7716
|
+
return "Intervalo de temperatura (".concat(minLabel, " - ").concat(maxLabel, ")");
|
|
7717
|
+
})),
|
|
7718
|
+
helperText: 'Intervalo de temperatura apresentado'
|
|
7568
7719
|
}
|
|
7720
|
+
}
|
|
7721
|
+
}), "metadata", {}), "sources", _defineProperty({}, TEMPERATURA_SUPERFICIE_ID, {
|
|
7722
|
+
minzoom: 9,
|
|
7723
|
+
maxzoom: 14,
|
|
7724
|
+
type: 'raster',
|
|
7725
|
+
tiles: [resolve.fn(function (_ref8) {
|
|
7726
|
+
var _conf$data3;
|
|
7727
|
+
var conf = _ref8.view.conf;
|
|
7728
|
+
var temperaturaRange = _temperaturaRange(conf === null || conf === void 0 || (_conf$data3 = conf.data) === null || _conf$data3 === void 0 ? void 0 : _conf$data3.temperaturaRange);
|
|
7729
|
+
var baseUrl = "".concat(RASTER_TILE_SERVER_ENDPOINT, "/mosaicjson/tiles/WebMercatorQuad/{z}/{x}/{y}").concat(DEVICE_PIXEL_RATIO_SUFFIX);
|
|
7730
|
+
return "".concat(baseUrl, "?").concat($urlSearch([{
|
|
7731
|
+
url: mosaicJsonUrl,
|
|
7732
|
+
colormap: COLOR_MAP.map(function (_ref9) {
|
|
7733
|
+
var _ref10 = _slicedToArray(_ref9, 2),
|
|
7734
|
+
bounds = _ref10[0],
|
|
7735
|
+
color = _ref10[1];
|
|
7736
|
+
return [bounds, bounds[0] >= temperaturaRange[0] && bounds[1] <= temperaturaRange[1] ? color : TRANSPARENT];
|
|
7737
|
+
})
|
|
7738
|
+
}]));
|
|
7739
|
+
})]
|
|
7740
|
+
})), "layers", _defineProperty({}, "".concat(TEMPERATURA_SUPERFICIE_ID), {
|
|
7741
|
+
minzoom: 9,
|
|
7742
|
+
// zIndex: 10,
|
|
7743
|
+
type: 'raster',
|
|
7744
|
+
source: TEMPERATURA_SUPERFICIE_ID,
|
|
7745
|
+
paint: {
|
|
7746
|
+
'raster-opacity': 0.85
|
|
7569
7747
|
},
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
minzoom: 7,
|
|
7573
|
-
maxzoom: 14,
|
|
7574
|
-
type: 'raster',
|
|
7575
|
-
tiles: [resolve.fn(function (_ref8) {
|
|
7576
|
-
var _conf$data3;
|
|
7577
|
-
var conf = _ref8.view.conf;
|
|
7578
|
-
var temperaturaRange = _temperaturaRange(conf === null || conf === void 0 || (_conf$data3 = conf.data) === null || _conf$data3 === void 0 ? void 0 : _conf$data3.temperaturaRange);
|
|
7579
|
-
var baseUrl = "".concat(RASTER_TILE_SERVER_ENDPOINT, "/mosaicjson/tiles/WebMercatorQuad/{z}/{x}/{y}").concat(DEVICE_PIXEL_RATIO_SUFFIX);
|
|
7580
|
-
return "".concat(baseUrl, "?").concat($urlSearch([{
|
|
7581
|
-
url: mosaicJsonUrl,
|
|
7582
|
-
colormap: COLOR_MAP.map(function (_ref9) {
|
|
7583
|
-
var _ref10 = _slicedToArray(_ref9, 2),
|
|
7584
|
-
bounds = _ref10[0],
|
|
7585
|
-
color = _ref10[1];
|
|
7586
|
-
return [bounds, bounds[0] >= temperaturaRange[0] && bounds[1] <= temperaturaRange[1] ? color : TRANSPARENT];
|
|
7587
|
-
})
|
|
7588
|
-
}]));
|
|
7589
|
-
})]
|
|
7590
|
-
}),
|
|
7591
|
-
layers: _defineProperty({}, "".concat(TEMPERATURA_SUPERFICIE_ID), {
|
|
7592
|
-
minzoom: 7,
|
|
7593
|
-
// zIndex: 10,
|
|
7594
|
-
type: 'raster',
|
|
7595
|
-
source: TEMPERATURA_SUPERFICIE_ID,
|
|
7596
|
-
paint: {
|
|
7597
|
-
'raster-opacity': 0.85
|
|
7598
|
-
},
|
|
7599
|
-
legends: temperatura_legends()
|
|
7600
|
-
})
|
|
7601
|
-
};
|
|
7748
|
+
legends: temperatura_legends()
|
|
7749
|
+
}));
|
|
7602
7750
|
}
|
|
7603
7751
|
|
|
7604
7752
|
var index = /*#__PURE__*/Object.freeze({
|
|
@@ -7749,7 +7897,7 @@ function ViewConfTabs(_ref) {
|
|
|
7749
7897
|
variant: "ghost",
|
|
7750
7898
|
size: "1",
|
|
7751
7899
|
onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
7752
|
-
var
|
|
7900
|
+
var contents, metodologyBody;
|
|
7753
7901
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
7754
7902
|
while (1) switch (_context2.prev = _context2.next) {
|
|
7755
7903
|
case 0:
|
|
@@ -7772,7 +7920,7 @@ function ViewConfTabs(_ref) {
|
|
|
7772
7920
|
return res.text();
|
|
7773
7921
|
}) : viewSpec.metodology);
|
|
7774
7922
|
case 8:
|
|
7775
|
-
return _context.abrupt("return",
|
|
7923
|
+
return _context.abrupt("return", viewSpec.metodology);
|
|
7776
7924
|
case 9:
|
|
7777
7925
|
case "end":
|
|
7778
7926
|
return _context.stop();
|
|
@@ -7780,19 +7928,16 @@ function ViewConfTabs(_ref) {
|
|
|
7780
7928
|
}, _callee);
|
|
7781
7929
|
})));
|
|
7782
7930
|
case 2:
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
}
|
|
7931
|
+
contents = _context2.sent;
|
|
7932
|
+
metodologyBody = typeof contents === 'string' ? /*#__PURE__*/React$1.createElement(Markdown, {
|
|
7933
|
+
children: contents.trim()
|
|
7934
|
+
}) : contents;
|
|
7788
7935
|
_context2.next = 6;
|
|
7789
7936
|
return dialogs.view({
|
|
7790
7937
|
maxHeight: '90vh',
|
|
7791
7938
|
children: /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(Heading, {
|
|
7792
7939
|
as: "h1"
|
|
7793
|
-
}, viewSpec.label, " - Notas metodol\xF3gicas"),
|
|
7794
|
-
children: markdown.trim()
|
|
7795
|
-
}))
|
|
7940
|
+
}, viewSpec.label, " - Notas metodol\xF3gicas"), metodologyBody)
|
|
7796
7941
|
});
|
|
7797
7942
|
case 6:
|
|
7798
7943
|
case "end":
|
|
@@ -7978,7 +8123,23 @@ function ViewControl(_ref8) {
|
|
|
7978
8123
|
textTransform: 'uppercase'
|
|
7979
8124
|
},
|
|
7980
8125
|
size: "1"
|
|
7981
|
-
}, viewSpec.sourceLabel)
|
|
8126
|
+
}, viewSpec.sourceLabel), viewSpec.shortDescription && /*#__PURE__*/React$1.createElement(Flex, {
|
|
8127
|
+
direction: "row",
|
|
8128
|
+
gap: "2"
|
|
8129
|
+
}, /*#__PURE__*/React$1.createElement(Icon$1, {
|
|
8130
|
+
style: {
|
|
8131
|
+
flexShrink: 0,
|
|
8132
|
+
color: 'var(--gray-9)'
|
|
8133
|
+
},
|
|
8134
|
+
path: mdiBookOpenVariant,
|
|
8135
|
+
size: "20px"
|
|
8136
|
+
}), /*#__PURE__*/React$1.createElement(Text, {
|
|
8137
|
+
color: "gray",
|
|
8138
|
+
style: {
|
|
8139
|
+
color: 'var(--gray-9)'
|
|
8140
|
+
},
|
|
8141
|
+
size: "1"
|
|
8142
|
+
}, viewSpec.shortDescription))), /*#__PURE__*/React$1.createElement(SwitchInput, {
|
|
7982
8143
|
radius: "full",
|
|
7983
8144
|
value: active,
|
|
7984
8145
|
onSetValue: function onSetValue() {
|
|
@@ -8674,12 +8835,15 @@ var ViewLayoutSortable = makeSortableMultiList({
|
|
|
8674
8835
|
viewSpecs = _useContext.viewSpecs,
|
|
8675
8836
|
viewConfState = _useContext.viewConfState,
|
|
8676
8837
|
viewConfDispatch = _useContext.viewConfDispatch;
|
|
8838
|
+
var viewSpec = viewSpecs === null || viewSpecs === void 0 ? void 0 : viewSpecs.find(function (spec) {
|
|
8839
|
+
return spec.id === item.id;
|
|
8840
|
+
});
|
|
8677
8841
|
|
|
8678
8842
|
// const boxShadow = isDragOverlay
|
|
8679
8843
|
// ? 'rgba(0, 0, 0, 0.35) 0px 5px 15px;'
|
|
8680
8844
|
// : 'none'
|
|
8681
8845
|
|
|
8682
|
-
return /*#__PURE__*/React$1.createElement(Flex, {
|
|
8846
|
+
return viewSpec && /*#__PURE__*/React$1.createElement(Flex, {
|
|
8683
8847
|
direction: "row",
|
|
8684
8848
|
alignItems: "center",
|
|
8685
8849
|
gap: "0",
|
|
@@ -8713,9 +8877,7 @@ var ViewLayoutSortable = makeSortableMultiList({
|
|
|
8713
8877
|
height: CONTROL_HEIGHT
|
|
8714
8878
|
},
|
|
8715
8879
|
path: true,
|
|
8716
|
-
viewSpec:
|
|
8717
|
-
return spec.id === item.id;
|
|
8718
|
-
}),
|
|
8880
|
+
viewSpec: omit(viewSpec, ['shortDescription']),
|
|
8719
8881
|
viewConf: viewConfState.byId[item.id],
|
|
8720
8882
|
viewConfState: viewConfState,
|
|
8721
8883
|
configurable: false,
|
|
@@ -8966,6 +9128,23 @@ function _coordinatesFromDeviceLocation() {
|
|
|
8966
9128
|
function resolveInitialMunicipioId(_x) {
|
|
8967
9129
|
return _resolveInitialMunicipioId.apply(this, arguments);
|
|
8968
9130
|
}
|
|
9131
|
+
|
|
9132
|
+
/**
|
|
9133
|
+
* Returns a bbox covering the 3×3 grid of tiles around the tile that contains
|
|
9134
|
+
* (lng, lat) at the given zoom. Useful for limiting map bounds or prefetching.
|
|
9135
|
+
*
|
|
9136
|
+
* TILE LAYOUT (center tile is x,y):
|
|
9137
|
+
*
|
|
9138
|
+
* +---------+---------+---------+
|
|
9139
|
+
* | x-1,y-1 | x,y-1 | x+1,y-1 |
|
|
9140
|
+
* +---------+---------+---------+
|
|
9141
|
+
* | x-1,y | x,y | x+1,y |
|
|
9142
|
+
* +---------+---------+---------+
|
|
9143
|
+
* | x-1,y+1 | x,y+1 | x+1,y+1 |
|
|
9144
|
+
* +---------+---------+---------+
|
|
9145
|
+
*
|
|
9146
|
+
* Returns: [minLng, minLat, maxLng, maxLat]
|
|
9147
|
+
*/
|
|
8969
9148
|
function _resolveInitialMunicipioId() {
|
|
8970
9149
|
_resolveInitialMunicipioId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref) {
|
|
8971
9150
|
var METADATA_API_ENDPOINT, coordinates, defaultCoordinates;
|
|
@@ -9021,6 +9200,30 @@ function _resolveInitialMunicipioId() {
|
|
|
9021
9200
|
}));
|
|
9022
9201
|
return _resolveInitialMunicipioId.apply(this, arguments);
|
|
9023
9202
|
}
|
|
9203
|
+
function getSurroundingTilesBbox(lng, lat, zoom) {
|
|
9204
|
+
// Tile under center point
|
|
9205
|
+
var _pointToTile = pointToTile(lng, lat, zoom),
|
|
9206
|
+
_pointToTile2 = _slicedToArray(_pointToTile, 2),
|
|
9207
|
+
x = _pointToTile2[0],
|
|
9208
|
+
y = _pointToTile2[1];
|
|
9209
|
+
var minLng = Infinity;
|
|
9210
|
+
var minLat = Infinity;
|
|
9211
|
+
var maxLng = -Infinity;
|
|
9212
|
+
var maxLat = -Infinity;
|
|
9213
|
+
|
|
9214
|
+
// 3×3 block of tiles around the center tile
|
|
9215
|
+
for (var dx = -1; dx <= 1; dx++) {
|
|
9216
|
+
for (var dy = -1; dy <= 1; dy++) {
|
|
9217
|
+
var tile = [x + dx, y + dy, zoom];
|
|
9218
|
+
var bbox = tileToBBOX(tile);
|
|
9219
|
+
minLng = Math.min(minLng, bbox[0]);
|
|
9220
|
+
minLat = Math.min(minLat, bbox[1]);
|
|
9221
|
+
maxLng = Math.max(maxLng, bbox[2]);
|
|
9222
|
+
maxLat = Math.max(maxLat, bbox[3]);
|
|
9223
|
+
}
|
|
9224
|
+
}
|
|
9225
|
+
return [minLng, minLat, maxLng, maxLat];
|
|
9226
|
+
}
|
|
9024
9227
|
|
|
9025
9228
|
// TODO generalize for allow input types and output types
|
|
9026
9229
|
function parseGeoFileMetadata(_x) {
|
|
@@ -10897,16 +11100,26 @@ function _flyToMunicipio2() {
|
|
|
10897
11100
|
while (1) switch (_context4.prev = _context4.next) {
|
|
10898
11101
|
case 0:
|
|
10899
11102
|
_context4.next = 2;
|
|
10900
|
-
return fetch("".concat(METADATA_API_ENDPOINT, "/
|
|
11103
|
+
return fetch("".concat(METADATA_API_ENDPOINT, "/ibge_malha_br_municipio_2024?select=area_urbana_bbox_geom&id=eq.").concat(municipioId)).then(function (res) {
|
|
10901
11104
|
return res.json();
|
|
10902
11105
|
});
|
|
10903
11106
|
case 2:
|
|
10904
11107
|
_yield$fetch$then = _context4.sent;
|
|
10905
11108
|
_yield$fetch$then2 = _slicedToArray(_yield$fetch$then, 1);
|
|
10906
11109
|
mun = _yield$fetch$then2[0];
|
|
10907
|
-
if (mun && mun.
|
|
10908
|
-
fitGeometry(map, mun.
|
|
11110
|
+
if (mun && mun.area_urbana_bbox_geom) {
|
|
11111
|
+
fitGeometry(map, mun.area_urbana_bbox_geom, options);
|
|
10909
11112
|
}
|
|
11113
|
+
|
|
11114
|
+
// const [mun] = await fetch(
|
|
11115
|
+
// `${METADATA_API_ENDPOINT}/ibge_malha_br_municipio?select=bbox&id=eq.${municipioId}`,
|
|
11116
|
+
// ).then((res) => res.json())
|
|
11117
|
+
|
|
11118
|
+
// if (mun && mun.bbox) {
|
|
11119
|
+
// console.log('mun.bbox', mun.bbox)
|
|
11120
|
+
|
|
11121
|
+
// fitGeometry(map, mun.bbox, options)
|
|
11122
|
+
// }
|
|
10910
11123
|
case 6:
|
|
10911
11124
|
case "end":
|
|
10912
11125
|
return _context4.stop();
|
|
@@ -10963,6 +11176,19 @@ var FULL_MAP_STYLE = {
|
|
|
10963
11176
|
dataviz: BASEMAPS.dataviz.fullMapStyle(),
|
|
10964
11177
|
satellite: BASEMAPS.satellite.fullMapStyle()
|
|
10965
11178
|
};
|
|
11179
|
+
function _bboxContains(a, b) {
|
|
11180
|
+
var _a = _slicedToArray(a, 4),
|
|
11181
|
+
aMinLng = _a[0],
|
|
11182
|
+
aMinLat = _a[1],
|
|
11183
|
+
aMaxLng = _a[2],
|
|
11184
|
+
aMaxLat = _a[3];
|
|
11185
|
+
var _b = _slicedToArray(b, 4),
|
|
11186
|
+
bMinLng = _b[0],
|
|
11187
|
+
bMinLat = _b[1],
|
|
11188
|
+
bMaxLng = _b[2],
|
|
11189
|
+
bMaxLat = _b[3];
|
|
11190
|
+
return bMinLng >= aMinLng && bMinLat >= aMinLat && bMaxLng <= aMaxLng && bMaxLat <= aMaxLat;
|
|
11191
|
+
}
|
|
10966
11192
|
|
|
10967
11193
|
//
|
|
10968
11194
|
// TODO: review, this is clearly not a structured way
|
|
@@ -11069,6 +11295,10 @@ function GeoReDUSInner(_ref2) {
|
|
|
11069
11295
|
var syncedMapsRef = useRef(null);
|
|
11070
11296
|
var mapRegistry = useMapRegistry();
|
|
11071
11297
|
var tilesLoading = useTilesLoading(mapRegistry.maps);
|
|
11298
|
+
var _useState5 = useState(null),
|
|
11299
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
11300
|
+
mapBounds = _useState6[0],
|
|
11301
|
+
setMapBounds = _useState6[1];
|
|
11072
11302
|
var _useLocalState = useLocalState(globalState.municipioId, function (nextMunicipioId) {
|
|
11073
11303
|
return onSetGlobalState(_objectSpread2(_objectSpread2({}, globalState), {}, {
|
|
11074
11304
|
municipioId: nextMunicipioId
|
|
@@ -11146,9 +11376,10 @@ function GeoReDUSInner(_ref2) {
|
|
|
11146
11376
|
// in order for views not recompute on every zoom change
|
|
11147
11377
|
//
|
|
11148
11378
|
zoomLevel: zoomLevel,
|
|
11149
|
-
regional: regional
|
|
11379
|
+
regional: regional,
|
|
11380
|
+
mapBounds: mapBounds
|
|
11150
11381
|
};
|
|
11151
|
-
}, [municipioId, baseMapStyle, zoomLevel, regional]);
|
|
11382
|
+
}, [municipioId, baseMapStyle, zoomLevel, regional, mapBounds]);
|
|
11152
11383
|
var _useViews = useViews({
|
|
11153
11384
|
viewSpecs: viewSpecsQuery.data,
|
|
11154
11385
|
viewConfState: viewConfState,
|
|
@@ -11430,6 +11661,24 @@ function GeoReDUSInner(_ref2) {
|
|
|
11430
11661
|
var zoom = (_e$viewState = e.viewState) === null || _e$viewState === void 0 ? void 0 : _e$viewState.zoom;
|
|
11431
11662
|
var nextZoomLevel = zoom > 8 ? 'intramun' : zoom > 5 ? 'intrauf' : zoom > 3 ? 'intrabr' : null;
|
|
11432
11663
|
setZoomLevel(nextZoomLevel);
|
|
11664
|
+
}
|
|
11665
|
+
//
|
|
11666
|
+
// TODO: review mapBounds calculation
|
|
11667
|
+
//
|
|
11668
|
+
,
|
|
11669
|
+
onMoveEnd: function onMoveEnd(e) {
|
|
11670
|
+
var _e$viewState2 = e.viewState,
|
|
11671
|
+
latitude = _e$viewState2.latitude,
|
|
11672
|
+
longitude = _e$viewState2.longitude;
|
|
11673
|
+
var bounds = e.target.getBounds();
|
|
11674
|
+
var minLng = bounds.getWest();
|
|
11675
|
+
var maxLng = bounds.getEast();
|
|
11676
|
+
var minLat = bounds.getSouth();
|
|
11677
|
+
var maxLat = bounds.getNorth();
|
|
11678
|
+
var viewBounds = [minLng, minLat, maxLng, maxLat];
|
|
11679
|
+
if (!mapBounds || !_bboxContains(mapBounds, viewBounds)) {
|
|
11680
|
+
setMapBounds(getSurroundingTilesBbox(longitude, latitude, 7));
|
|
11681
|
+
}
|
|
11433
11682
|
},
|
|
11434
11683
|
onDrag: function onDrag() {
|
|
11435
11684
|
if (resolvedLayout.length > 1 && leftPanelOpen) {
|
|
@@ -11443,6 +11692,10 @@ function GeoReDUSInner(_ref2) {
|
|
|
11443
11692
|
ref: syncedMapsRef,
|
|
11444
11693
|
onLoad: function onLoad(evt) {
|
|
11445
11694
|
_refocus(evt.target);
|
|
11695
|
+
|
|
11696
|
+
// For debugging:
|
|
11697
|
+
// evt.target.showTileBoundaries = true
|
|
11698
|
+
|
|
11446
11699
|
mapRegistry.onLoad(evt);
|
|
11447
11700
|
},
|
|
11448
11701
|
onRemove: function onRemove(evt) {
|
|
@@ -11582,4 +11835,4 @@ function GeoReDUS(props) {
|
|
|
11582
11835
|
}, /*#__PURE__*/React$1.createElement(DialogsProvider, null, /*#__PURE__*/React$1.createElement(GeoReDUSInner, props))));
|
|
11583
11836
|
}
|
|
11584
11837
|
|
|
11585
|
-
export { GeoReDUS, index as UNSTABLE_VIEW_SPEC, VTX_PROTOCOL, memoFetchData, vtx, vtxSetup, vtxUrl };
|
|
11838
|
+
export { GeoReDUS, index as UNSTABLE_VIEW_SPEC, VTX_PROTOCOL, _bboxContains, memoFetchData, vtx, vtxSetup, vtxUrl };
|