@trismegisto/maps 3.3.3 → 3.3.4
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.
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, computed, NgZone, input, numberAttribute, booleanAttribute, output, viewChild, signal, Injector, ElementRef, afterNextRender, DestroyRef, effect, untracked, ChangeDetectionStrategy, ViewEncapsulation, Component, model, contentChild, Directive } from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, computed, NgZone, input, numberAttribute, booleanAttribute, output, viewChild, signal, Injector, ElementRef, afterNextRender, DestroyRef, effect, untracked, ChangeDetectionStrategy, ViewEncapsulation, Component, model, contentChild, contentChildren, Directive } from '@angular/core';
|
|
3
3
|
import { HermesI18nService, liveCatalog } from '@trismegisto/angular/i18n';
|
|
4
4
|
import { ICON_PLUS, ICON_MINUS, IconComponent, ICON_TIMES } from '@trismegisto/angular/icon';
|
|
5
5
|
import { LegendComponent } from '@trismegisto/angular/legend';
|
|
6
6
|
import { mergeCatalog, registerIcons, prefersReducedMotion, formatMessage } from '@trismegisto/primitives';
|
|
7
|
+
import { SpinnerComponent } from '@trismegisto/angular/spinner';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Tipos e utilitários geográficos e de geometria plana, sem framework.
|
|
@@ -1813,6 +1814,289 @@ function toNumber(value) {
|
|
|
1813
1814
|
return Number.isFinite(n) ? n : null;
|
|
1814
1815
|
}
|
|
1815
1816
|
|
|
1817
|
+
// Agrupamento de pontos próximos na tela (clusters de marcadores), sem framework: recebe posições em
|
|
1818
|
+
// pixels (já projetadas no zoom atual) e devolve os grupos. Portável para qualquer camada de UI.
|
|
1819
|
+
/**
|
|
1820
|
+
* Agrupa pontos a até `radius` px de distância do primeiro ponto do grupo (guloso, na ordem de
|
|
1821
|
+
* entrada: o resultado é estável para a mesma entrada). Usa uma grade de células do tamanho do raio
|
|
1822
|
+
* para não comparar todos com todos. Pontos com coordenada inválida ficam sozinhos.
|
|
1823
|
+
*/
|
|
1824
|
+
function clusterPoints(points, radius) {
|
|
1825
|
+
const r = Math.max(0, radius);
|
|
1826
|
+
const taken = new Uint8Array(points.length);
|
|
1827
|
+
const cell = r > 0 ? r : 1;
|
|
1828
|
+
const grid = new Map();
|
|
1829
|
+
const key = (cx, cy) => `${cx}:${cy}`;
|
|
1830
|
+
points.forEach((p, i) => {
|
|
1831
|
+
if (!Number.isFinite(p.x) || !Number.isFinite(p.y))
|
|
1832
|
+
return;
|
|
1833
|
+
const k = key(Math.floor(p.x / cell), Math.floor(p.y / cell));
|
|
1834
|
+
const list = grid.get(k);
|
|
1835
|
+
if (list)
|
|
1836
|
+
list.push(i);
|
|
1837
|
+
else
|
|
1838
|
+
grid.set(k, [i]);
|
|
1839
|
+
});
|
|
1840
|
+
const out = [];
|
|
1841
|
+
points.forEach((seed, i) => {
|
|
1842
|
+
if (taken[i])
|
|
1843
|
+
return;
|
|
1844
|
+
taken[i] = 1;
|
|
1845
|
+
const members = [i];
|
|
1846
|
+
if (r > 0 && Number.isFinite(seed.x) && Number.isFinite(seed.y)) {
|
|
1847
|
+
const cx = Math.floor(seed.x / cell);
|
|
1848
|
+
const cy = Math.floor(seed.y / cell);
|
|
1849
|
+
for (let dx = -1; dx <= 1; dx++) {
|
|
1850
|
+
for (let dy = -1; dy <= 1; dy++) {
|
|
1851
|
+
for (const j of grid.get(key(cx + dx, cy + dy)) ?? []) {
|
|
1852
|
+
if (taken[j])
|
|
1853
|
+
continue;
|
|
1854
|
+
const q = points[j];
|
|
1855
|
+
if (Math.hypot(q.x - seed.x, q.y - seed.y) <= r) {
|
|
1856
|
+
taken[j] = 1;
|
|
1857
|
+
members.push(j);
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
members.sort((a, b) => a - b);
|
|
1864
|
+
let sx = 0;
|
|
1865
|
+
let sy = 0;
|
|
1866
|
+
for (const m of members) {
|
|
1867
|
+
sx += points[m].x;
|
|
1868
|
+
sy += points[m].y;
|
|
1869
|
+
}
|
|
1870
|
+
out.push({ indices: members, x: sx / members.length, y: sy / members.length });
|
|
1871
|
+
});
|
|
1872
|
+
return out;
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
/**
|
|
1876
|
+
* Rotas e direções sem framework: o modelo de uma rota já calculada (pontos da linha + passos com
|
|
1877
|
+
* manobra, distância e duração), totais, retângulo, trecho de cada passo e a formatação de distância e
|
|
1878
|
+
* duração por idioma. Nada aqui calcula rota nem chama provedor: o app recebe a rota pronta do serviço que
|
|
1879
|
+
* usar (OSRM, Google, Mapbox, HERE...) e a converte para este formato.
|
|
1880
|
+
*/
|
|
1881
|
+
/** Comprimento da linha, em metros (haversine entre pontos consecutivos). */
|
|
1882
|
+
function routeLength(points) {
|
|
1883
|
+
let total = 0;
|
|
1884
|
+
for (let i = 1; i < points.length; i++)
|
|
1885
|
+
total += distanceMeters(toLatLng(points[i - 1]), toLatLng(points[i]));
|
|
1886
|
+
return total;
|
|
1887
|
+
}
|
|
1888
|
+
/** Distância e duração totais: os valores da rota, ou a soma dos passos (distância: o comprimento da linha sem passos). */
|
|
1889
|
+
function routeTotals(route) {
|
|
1890
|
+
const stepDistance = route.steps.reduce((sum, step) => sum + (Number(step.distance) || 0), 0);
|
|
1891
|
+
const stepDuration = route.steps.reduce((sum, step) => sum + (Number(step.duration) || 0), 0);
|
|
1892
|
+
const distance = route.distance ?? (route.steps.length ? stepDistance : routeLength(route.points));
|
|
1893
|
+
return { distance: Math.max(0, distance), duration: Math.max(0, route.duration ?? stepDuration) };
|
|
1894
|
+
}
|
|
1895
|
+
/** Menor retângulo com as linhas e os locais dos passos de uma ou mais rotas. `null` sem pontos. */
|
|
1896
|
+
function routeBounds(routes) {
|
|
1897
|
+
const list = Array.isArray(routes) ? routes : [routes];
|
|
1898
|
+
const points = [];
|
|
1899
|
+
for (const route of list) {
|
|
1900
|
+
for (const p of route.points)
|
|
1901
|
+
points.push(toLatLng(p));
|
|
1902
|
+
for (const step of route.steps)
|
|
1903
|
+
if (step.location)
|
|
1904
|
+
points.push(toLatLng(step.location));
|
|
1905
|
+
}
|
|
1906
|
+
return boundsOf(points);
|
|
1907
|
+
}
|
|
1908
|
+
/** Índice do ponto da linha mais perto de `target` (a partir de `from`). */
|
|
1909
|
+
function nearestIndex(points, target, from = 0) {
|
|
1910
|
+
let best = from;
|
|
1911
|
+
let bestDistance = Infinity;
|
|
1912
|
+
for (let i = from; i < points.length; i++) {
|
|
1913
|
+
const d = distanceMeters(points[i], target);
|
|
1914
|
+
if (d < bestDistance) {
|
|
1915
|
+
bestDistance = d;
|
|
1916
|
+
best = i;
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
return best;
|
|
1920
|
+
}
|
|
1921
|
+
/** Local do passo: `location`, ou o 1º ponto da linha para o 1º passo e o último para o último. `null` se não há como saber. */
|
|
1922
|
+
function routeStepLocation(route, index) {
|
|
1923
|
+
const step = route.steps[index];
|
|
1924
|
+
if (!step)
|
|
1925
|
+
return null;
|
|
1926
|
+
if (step.location)
|
|
1927
|
+
return toLatLng(step.location);
|
|
1928
|
+
if (!route.points.length)
|
|
1929
|
+
return null;
|
|
1930
|
+
if (index === 0)
|
|
1931
|
+
return toLatLng(route.points[0]);
|
|
1932
|
+
if (index === route.steps.length - 1)
|
|
1933
|
+
return toLatLng(route.points[route.points.length - 1]);
|
|
1934
|
+
return null;
|
|
1935
|
+
}
|
|
1936
|
+
/**
|
|
1937
|
+
* Trecho da linha que o passo percorre: do ponto mais perto do local do passo até o ponto mais perto do
|
|
1938
|
+
* local do passo seguinte (ou o fim). Vazio quando o passo não tem local.
|
|
1939
|
+
*/
|
|
1940
|
+
function routeStepSegment(route, index) {
|
|
1941
|
+
const points = route.points.map(toLatLng);
|
|
1942
|
+
const start = routeStepLocation(route, index);
|
|
1943
|
+
if (!start || points.length < 2)
|
|
1944
|
+
return [];
|
|
1945
|
+
const from = nearestIndex(points, start);
|
|
1946
|
+
let next = null;
|
|
1947
|
+
for (let k = index + 1; k < route.steps.length && !next; k++)
|
|
1948
|
+
next = routeStepLocation(route, k);
|
|
1949
|
+
const to = next ? nearestIndex(points, next, from) : points.length - 1;
|
|
1950
|
+
if (to <= from)
|
|
1951
|
+
return from < points.length - 1 ? points.slice(from, from + 2) : [];
|
|
1952
|
+
return points.slice(from, to + 1);
|
|
1953
|
+
}
|
|
1954
|
+
const FORMATTERS = new Map();
|
|
1955
|
+
function unitFormat(locale, unit, maximumFractionDigits) {
|
|
1956
|
+
const key = `${locale}|${unit}|${maximumFractionDigits}`;
|
|
1957
|
+
let format = FORMATTERS.get(key);
|
|
1958
|
+
if (!format) {
|
|
1959
|
+
format = new Intl.NumberFormat(locale, { style: 'unit', unit, unitDisplay: 'short', maximumFractionDigits });
|
|
1960
|
+
FORMATTERS.set(key, format);
|
|
1961
|
+
}
|
|
1962
|
+
return format;
|
|
1963
|
+
}
|
|
1964
|
+
/**
|
|
1965
|
+
* Distância para ler numa lista de direções: métrico (`350 m`, `1,2 km`, `15 km`) ou imperial
|
|
1966
|
+
* (`500 ft`, `0.8 mi`, `12 mi`), com o separador e a unidade do idioma (`Intl.NumberFormat` com `unit`).
|
|
1967
|
+
* Arredonda como os aplicativos de navegação: abaixo de 1 km de 10 em 10 m (de 1 em 1 abaixo de 100 m),
|
|
1968
|
+
* uma casa decimal até 10 km.
|
|
1969
|
+
*/
|
|
1970
|
+
function formatRouteDistance(meters, locale = 'pt-BR', units = 'metric') {
|
|
1971
|
+
const value = Math.max(0, Number(meters) || 0);
|
|
1972
|
+
if (units === 'imperial') {
|
|
1973
|
+
const miles = value / 1609.344;
|
|
1974
|
+
if (miles < 0.1) {
|
|
1975
|
+
const feet = value / 0.3048;
|
|
1976
|
+
return unitFormat(locale, 'foot', 0).format(feet < 100 ? Math.round(feet) : Math.round(feet / 10) * 10);
|
|
1977
|
+
}
|
|
1978
|
+
return unitFormat(locale, 'mile', miles < 10 ? 1 : 0).format(miles);
|
|
1979
|
+
}
|
|
1980
|
+
if (value < 1000) {
|
|
1981
|
+
const rounded = value < 100 ? Math.round(value) : Math.round(value / 10) * 10;
|
|
1982
|
+
if (rounded < 1000)
|
|
1983
|
+
return unitFormat(locale, 'meter', 0).format(rounded);
|
|
1984
|
+
}
|
|
1985
|
+
const km = value / 1000;
|
|
1986
|
+
return unitFormat(locale, 'kilometer', km < 10 ? 1 : 0).format(km);
|
|
1987
|
+
}
|
|
1988
|
+
/**
|
|
1989
|
+
* Duração para ler numa lista de direções: `45 s`, `12 min`, `1 h 5 min` (unidades curtas do idioma).
|
|
1990
|
+
* Acima de um minuto arredonda para o minuto.
|
|
1991
|
+
*/
|
|
1992
|
+
function formatRouteDuration(seconds, locale = 'pt-BR') {
|
|
1993
|
+
const value = Math.max(0, Number(seconds) || 0);
|
|
1994
|
+
if (value < 60)
|
|
1995
|
+
return unitFormat(locale, 'second', 0).format(Math.round(value));
|
|
1996
|
+
const totalMinutes = Math.round(value / 60);
|
|
1997
|
+
const hours = Math.floor(totalMinutes / 60);
|
|
1998
|
+
const minutes = totalMinutes % 60;
|
|
1999
|
+
const min = unitFormat(locale, 'minute', 0);
|
|
2000
|
+
if (!hours)
|
|
2001
|
+
return min.format(minutes);
|
|
2002
|
+
const h = unitFormat(locale, 'hour', 0).format(hours);
|
|
2003
|
+
return minutes ? `${h} ${min.format(minutes)}` : h;
|
|
2004
|
+
}
|
|
2005
|
+
const MANEUVER_ICONS = {
|
|
2006
|
+
depart: { icon: 'map-marker', rotation: 0 },
|
|
2007
|
+
arrive: { icon: 'flag', rotation: 0 },
|
|
2008
|
+
straight: { icon: 'arrow', rotation: 0 },
|
|
2009
|
+
'turn-left': { icon: 'arrow', rotation: -90 },
|
|
2010
|
+
'turn-right': { icon: 'arrow', rotation: 90 },
|
|
2011
|
+
'slight-left': { icon: 'arrow', rotation: -45 },
|
|
2012
|
+
'slight-right': { icon: 'arrow', rotation: 45 },
|
|
2013
|
+
'sharp-left': { icon: 'arrow', rotation: -135 },
|
|
2014
|
+
'sharp-right': { icon: 'arrow', rotation: 135 },
|
|
2015
|
+
'u-turn': { icon: 'undo', rotation: 0 },
|
|
2016
|
+
roundabout: { icon: 'refresh', rotation: 0 },
|
|
2017
|
+
merge: { icon: 'arrow', rotation: 0 },
|
|
2018
|
+
'fork-left': { icon: 'arrow', rotation: -30 },
|
|
2019
|
+
'fork-right': { icon: 'arrow', rotation: 30 },
|
|
2020
|
+
ramp: { icon: 'arrow-forward', rotation: 0 },
|
|
2021
|
+
ferry: { icon: 'boat', rotation: 0 },
|
|
2022
|
+
};
|
|
2023
|
+
/** Ícone e rotação da manobra; manobra desconhecida vira "siga em frente". */
|
|
2024
|
+
function maneuverIcon(maneuver) {
|
|
2025
|
+
return MANEUVER_ICONS[maneuver] ?? MANEUVER_ICONS.straight;
|
|
2026
|
+
}
|
|
2027
|
+
/** Normaliza graus para [0, 360). */
|
|
2028
|
+
function normalizeHeading(degrees) {
|
|
2029
|
+
const value = Number(degrees) || 0;
|
|
2030
|
+
return ((value % 360) + 360) % 360;
|
|
2031
|
+
}
|
|
2032
|
+
/** Ponto cardeal/colateral mais perto do rumo (0 = norte, 90 = leste). */
|
|
2033
|
+
function headingCardinal(degrees) {
|
|
2034
|
+
const names = ['n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw'];
|
|
2035
|
+
return names[Math.round(normalizeHeading(degrees) / 45) % 8];
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
/**
|
|
2039
|
+
* Listas de localidades a partir dos mapas base embutidos (malhas do IBGE e Natural Earth): UFs,
|
|
2040
|
+
* municípios de uma UF e países do mundo, para alimentar seletores (`hm-location-select`, `hm-address-field`).
|
|
2041
|
+
* Lê só as propriedades da topologia — não decodifica nem projeta a geometria — e reaproveita o mesmo
|
|
2042
|
+
* carregamento sob demanda das camadas (`loadBasemapData`): um chunk por nível, uma vez só.
|
|
2043
|
+
*/
|
|
2044
|
+
function members(root) {
|
|
2045
|
+
if (!root)
|
|
2046
|
+
return [];
|
|
2047
|
+
return root.type === 'GeometryCollection' ? (root.geometries ?? []) : [root];
|
|
2048
|
+
}
|
|
2049
|
+
const text = (value) => (typeof value === 'string' ? value : value === undefined || value === null ? '' : String(value));
|
|
2050
|
+
function byName(locale) {
|
|
2051
|
+
const collator = new Intl.Collator(locale, { sensitivity: 'base' });
|
|
2052
|
+
return (a, b) => collator.compare(a.name, b.name);
|
|
2053
|
+
}
|
|
2054
|
+
/** As 27 UFs (IBGE), em ordem alfabética do nome. */
|
|
2055
|
+
async function loadBrazilStates(locale = 'pt-BR') {
|
|
2056
|
+
const data = await loadBasemapData('br');
|
|
2057
|
+
return members(data.topology.objects['ufs'])
|
|
2058
|
+
.map((g) => {
|
|
2059
|
+
const props = g.properties ?? {};
|
|
2060
|
+
return { code: text(g.id ?? props['id']), sigla: text(props['sigla']), name: text(props['name']), region: text(props['regiao']) };
|
|
2061
|
+
})
|
|
2062
|
+
.sort(byName(locale));
|
|
2063
|
+
}
|
|
2064
|
+
/** Municípios de uma UF (sigla ou código IBGE), em ordem alfabética. UF desconhecida: lista vazia. */
|
|
2065
|
+
async function loadBrazilMunicipalities(uf, locale = 'pt-BR') {
|
|
2066
|
+
const resolved = resolveBasemapLayerId(`br/municipios/${String(uf).trim()}`);
|
|
2067
|
+
if (!resolved)
|
|
2068
|
+
return [];
|
|
2069
|
+
const data = await loadBasemapData(resolved.entry);
|
|
2070
|
+
return members(data.topology.objects[resolved.object])
|
|
2071
|
+
.map((g) => {
|
|
2072
|
+
const props = g.properties ?? {};
|
|
2073
|
+
return { code: text(g.id ?? props['id']), name: text(props['name']), uf: text(props['uf']) };
|
|
2074
|
+
})
|
|
2075
|
+
.sort(byName(locale));
|
|
2076
|
+
}
|
|
2077
|
+
/**
|
|
2078
|
+
* Países do Natural Earth (escala 1:110m), com o nome no idioma (`name_en`/`name_es` para en/es; pt nos
|
|
2079
|
+
* demais), em ordem alfabética desse nome.
|
|
2080
|
+
*/
|
|
2081
|
+
async function loadWorldCountries(locale = 'pt-BR') {
|
|
2082
|
+
const data = await loadBasemapData('world');
|
|
2083
|
+
const lang = locale.toLowerCase().split(/[-_]/)[0];
|
|
2084
|
+
return members(data.topology.objects['paises'])
|
|
2085
|
+
.map((g) => {
|
|
2086
|
+
const props = g.properties ?? {};
|
|
2087
|
+
const localized = lang && lang !== 'pt' ? text(props[`name_${lang}`]) : '';
|
|
2088
|
+
const alpha2 = text(props['iso_a2']);
|
|
2089
|
+
const country = {
|
|
2090
|
+
code: text(g.id ?? props['id']),
|
|
2091
|
+
name: localized || text(props['name']),
|
|
2092
|
+
...(/^[A-Z]{2}$/.test(alpha2) ? { alpha2 } : {}),
|
|
2093
|
+
};
|
|
2094
|
+
return country;
|
|
2095
|
+
})
|
|
2096
|
+
.filter((country) => country.code && country.name)
|
|
2097
|
+
.sort(byName(locale));
|
|
2098
|
+
}
|
|
2099
|
+
|
|
1816
2100
|
// Núcleo sem framework do @trismegisto/maps: projeção, vista, tiles, vetores, GeoJSON, escala, gestos e motor.
|
|
1817
2101
|
|
|
1818
2102
|
const MAPS_MESSAGES_EN = {
|
|
@@ -1832,6 +2116,10 @@ const MAPS_MESSAGES_EN = {
|
|
|
1832
2116
|
marker: {
|
|
1833
2117
|
label: 'Marker',
|
|
1834
2118
|
},
|
|
2119
|
+
cluster: {
|
|
2120
|
+
zoom: 'Group of {count} markers. Activate to zoom in.',
|
|
2121
|
+
expand: 'Group of {count} markers. Activate to show them all.',
|
|
2122
|
+
},
|
|
1835
2123
|
popup: {
|
|
1836
2124
|
label: 'Place details',
|
|
1837
2125
|
close: 'Close',
|
|
@@ -1851,6 +2139,47 @@ const MAPS_MESSAGES_EN = {
|
|
|
1851
2139
|
value: 'Value',
|
|
1852
2140
|
loadError: 'The base map could not be loaded.',
|
|
1853
2141
|
},
|
|
2142
|
+
route: {
|
|
2143
|
+
startAt: 'Start: {label}',
|
|
2144
|
+
start: 'Start',
|
|
2145
|
+
endAt: 'Destination: {label}',
|
|
2146
|
+
end: 'Destination',
|
|
2147
|
+
directions: 'Directions',
|
|
2148
|
+
totals: '{distance} · {duration}',
|
|
2149
|
+
alternatives: 'Routes',
|
|
2150
|
+
routeN: 'Route {n}',
|
|
2151
|
+
option: '{label}: {distance}, {duration}',
|
|
2152
|
+
steps: 'Route steps',
|
|
2153
|
+
stepsInstructions: 'Up and down arrows move through the steps; the map centers on the focused step.',
|
|
2154
|
+
empty: 'This route has no steps.',
|
|
2155
|
+
},
|
|
2156
|
+
streetView: {
|
|
2157
|
+
label: 'Street view',
|
|
2158
|
+
roleDescription: 'street view',
|
|
2159
|
+
instructions: 'Left and right arrows turn the view; up and down move forward and back.',
|
|
2160
|
+
rotateLeft: 'Turn left',
|
|
2161
|
+
rotateRight: 'Turn right',
|
|
2162
|
+
forward: 'Move forward',
|
|
2163
|
+
backward: 'Move back',
|
|
2164
|
+
fullscreen: 'Full screen',
|
|
2165
|
+
controls: 'View controls',
|
|
2166
|
+
heading: 'View direction: {degrees}° ({direction})',
|
|
2167
|
+
north: 'N',
|
|
2168
|
+
cardinal: {
|
|
2169
|
+
n: 'north',
|
|
2170
|
+
ne: 'northeast',
|
|
2171
|
+
e: 'east',
|
|
2172
|
+
se: 'southeast',
|
|
2173
|
+
s: 'south',
|
|
2174
|
+
sw: 'southwest',
|
|
2175
|
+
w: 'west',
|
|
2176
|
+
nw: 'northwest',
|
|
2177
|
+
},
|
|
2178
|
+
loading: 'Loading the image for this place…',
|
|
2179
|
+
noImagery: 'No imagery for this place',
|
|
2180
|
+
noImageryHint: 'Try a nearby point on a road.',
|
|
2181
|
+
attribution: 'Imagery source',
|
|
2182
|
+
},
|
|
1854
2183
|
};
|
|
1855
2184
|
|
|
1856
2185
|
const MAPS_MESSAGES_ES = {
|
|
@@ -1870,6 +2199,10 @@ const MAPS_MESSAGES_ES = {
|
|
|
1870
2199
|
marker: {
|
|
1871
2200
|
label: 'Marcador',
|
|
1872
2201
|
},
|
|
2202
|
+
cluster: {
|
|
2203
|
+
zoom: 'Grupo de {count} marcadores. Actívalo para acercar.',
|
|
2204
|
+
expand: 'Grupo de {count} marcadores. Actívalo para mostrarlos todos.',
|
|
2205
|
+
},
|
|
1873
2206
|
popup: {
|
|
1874
2207
|
label: 'Detalles del lugar',
|
|
1875
2208
|
close: 'Cerrar',
|
|
@@ -1889,6 +2222,47 @@ const MAPS_MESSAGES_ES = {
|
|
|
1889
2222
|
value: 'Valor',
|
|
1890
2223
|
loadError: 'No se pudo cargar el mapa base.',
|
|
1891
2224
|
},
|
|
2225
|
+
route: {
|
|
2226
|
+
startAt: 'Salida: {label}',
|
|
2227
|
+
start: 'Salida',
|
|
2228
|
+
endAt: 'Llegada: {label}',
|
|
2229
|
+
end: 'Llegada',
|
|
2230
|
+
directions: 'Indicaciones',
|
|
2231
|
+
totals: '{distance} · {duration}',
|
|
2232
|
+
alternatives: 'Rutas',
|
|
2233
|
+
routeN: 'Ruta {n}',
|
|
2234
|
+
option: '{label}: {distance}, {duration}',
|
|
2235
|
+
steps: 'Pasos de la ruta',
|
|
2236
|
+
stepsInstructions: 'Las flechas arriba y abajo recorren los pasos; el mapa se centra en el paso con foco.',
|
|
2237
|
+
empty: 'Esta ruta no tiene pasos.',
|
|
2238
|
+
},
|
|
2239
|
+
streetView: {
|
|
2240
|
+
label: 'Vista de calle',
|
|
2241
|
+
roleDescription: 'vista de calle',
|
|
2242
|
+
instructions: 'Las flechas izquierda y derecha giran la vista; arriba y abajo avanzan y retroceden.',
|
|
2243
|
+
rotateLeft: 'Girar a la izquierda',
|
|
2244
|
+
rotateRight: 'Girar a la derecha',
|
|
2245
|
+
forward: 'Avanzar',
|
|
2246
|
+
backward: 'Retroceder',
|
|
2247
|
+
fullscreen: 'Pantalla completa',
|
|
2248
|
+
controls: 'Controles de la vista',
|
|
2249
|
+
heading: 'Dirección de la vista: {degrees}° ({direction})',
|
|
2250
|
+
north: 'N',
|
|
2251
|
+
cardinal: {
|
|
2252
|
+
n: 'norte',
|
|
2253
|
+
ne: 'noreste',
|
|
2254
|
+
e: 'este',
|
|
2255
|
+
se: 'sureste',
|
|
2256
|
+
s: 'sur',
|
|
2257
|
+
sw: 'suroeste',
|
|
2258
|
+
w: 'oeste',
|
|
2259
|
+
nw: 'noroeste',
|
|
2260
|
+
},
|
|
2261
|
+
loading: 'Cargando la imagen del lugar…',
|
|
2262
|
+
noImagery: 'No hay imágenes de este lugar',
|
|
2263
|
+
noImageryHint: 'Pruebe un punto cercano, en una vía.',
|
|
2264
|
+
attribution: 'Fuente de las imágenes',
|
|
2265
|
+
},
|
|
1892
2266
|
};
|
|
1893
2267
|
|
|
1894
2268
|
const MAPS_MESSAGES_PT_BR = {
|
|
@@ -1912,6 +2286,10 @@ const MAPS_MESSAGES_PT_BR = {
|
|
|
1912
2286
|
label: 'Detalhes do local',
|
|
1913
2287
|
close: 'Fechar',
|
|
1914
2288
|
},
|
|
2289
|
+
cluster: {
|
|
2290
|
+
zoom: 'Grupo de {count} marcadores. Acione para aproximar.',
|
|
2291
|
+
expand: 'Grupo de {count} marcadores. Acione para mostrar todos.',
|
|
2292
|
+
},
|
|
1915
2293
|
data: {
|
|
1916
2294
|
regions: 'Regiões: {label}',
|
|
1917
2295
|
regionsInstructions: 'Setas percorrem as regiões, Home e End vão à primeira e à última, Enter seleciona e Esc volta ao mapa.',
|
|
@@ -1927,6 +2305,47 @@ const MAPS_MESSAGES_PT_BR = {
|
|
|
1927
2305
|
value: 'Valor',
|
|
1928
2306
|
loadError: 'Não foi possível carregar o mapa base.',
|
|
1929
2307
|
},
|
|
2308
|
+
route: {
|
|
2309
|
+
startAt: 'Partida: {label}',
|
|
2310
|
+
start: 'Partida',
|
|
2311
|
+
endAt: 'Chegada: {label}',
|
|
2312
|
+
end: 'Chegada',
|
|
2313
|
+
directions: 'Direções',
|
|
2314
|
+
totals: '{distance} · {duration}',
|
|
2315
|
+
alternatives: 'Rotas',
|
|
2316
|
+
routeN: 'Rota {n}',
|
|
2317
|
+
option: '{label}: {distance}, {duration}',
|
|
2318
|
+
steps: 'Passos da rota',
|
|
2319
|
+
stepsInstructions: 'Setas para cima e para baixo percorrem os passos; o mapa centra no passo em foco.',
|
|
2320
|
+
empty: 'Esta rota não tem passos.',
|
|
2321
|
+
},
|
|
2322
|
+
streetView: {
|
|
2323
|
+
label: 'Vista da rua',
|
|
2324
|
+
roleDescription: 'vista da rua',
|
|
2325
|
+
instructions: 'Setas para a esquerda e para a direita giram a vista; para cima e para baixo avançam e voltam.',
|
|
2326
|
+
rotateLeft: 'Girar para a esquerda',
|
|
2327
|
+
rotateRight: 'Girar para a direita',
|
|
2328
|
+
forward: 'Avançar',
|
|
2329
|
+
backward: 'Voltar',
|
|
2330
|
+
fullscreen: 'Tela cheia',
|
|
2331
|
+
controls: 'Controles da vista',
|
|
2332
|
+
heading: 'Direção da vista: {degrees}° ({direction})',
|
|
2333
|
+
north: 'N',
|
|
2334
|
+
cardinal: {
|
|
2335
|
+
n: 'norte',
|
|
2336
|
+
ne: 'nordeste',
|
|
2337
|
+
e: 'leste',
|
|
2338
|
+
se: 'sudeste',
|
|
2339
|
+
s: 'sul',
|
|
2340
|
+
sw: 'sudoeste',
|
|
2341
|
+
w: 'oeste',
|
|
2342
|
+
nw: 'noroeste',
|
|
2343
|
+
},
|
|
2344
|
+
loading: 'Carregando a imagem do local…',
|
|
2345
|
+
noImagery: 'Sem imagem para este local',
|
|
2346
|
+
noImageryHint: 'Tente um ponto próximo, numa via.',
|
|
2347
|
+
attribution: 'Fonte das imagens',
|
|
2348
|
+
},
|
|
1930
2349
|
};
|
|
1931
2350
|
|
|
1932
2351
|
const MAPS_I18N_CONFIG = new InjectionToken('MAPS_I18N_CONFIG', {
|
|
@@ -1983,7 +2402,7 @@ function resolvePathStyle(style, kind) {
|
|
|
1983
2402
|
}
|
|
1984
2403
|
const HM_MAP_MARKER = new InjectionToken('HM_MAP_MARKER');
|
|
1985
2404
|
|
|
1986
|
-
let nextId$
|
|
2405
|
+
let nextId$6 = 0;
|
|
1987
2406
|
/**
|
|
1988
2407
|
* Mapa interativo com mapas base vetoriais embutidos, camadas vetoriais (SVG), marcadores e popups.
|
|
1989
2408
|
*
|
|
@@ -1993,7 +2412,7 @@ let nextId$4 = 0;
|
|
|
1993
2412
|
* crédito exigido por ele (HTML com links, sanitizado); as camadas de dados acrescentam o próprio crédito.
|
|
1994
2413
|
*
|
|
1995
2414
|
* Conteúdo: `<hm-map-basemap>`, `<hm-map-choropleth>`, `<hm-map-marker>`, `<hm-map-popup>`,
|
|
1996
|
-
* `<hm-map-polyline>`, `<hm-map-polygon>`, `<hm-map-circle>` e `<hm-map-
|
|
2415
|
+
* `<hm-map-polyline>`, `<hm-map-polygon>`, `<hm-map-circle>`, `<hm-map-geojson>` e `<hm-map-route>` como filhos diretos.
|
|
1997
2416
|
*
|
|
1998
2417
|
* Teclado: com o foco no mapa, setas movem e `+`/`−` aproximam/afastam (Shift amplia o passo). Os
|
|
1999
2418
|
* marcadores entram na ordem de Tab depois do mapa.
|
|
@@ -2037,7 +2456,7 @@ class MapComponent {
|
|
|
2037
2456
|
scrollWheelZoom = input(true, { ...(ngDevMode ? { debugName: "scrollWheelZoom" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2038
2457
|
/** Fim de cada mudança de vista feita pela pessoa ou pelos métodos públicos. */
|
|
2039
2458
|
viewChange = output();
|
|
2040
|
-
helpId = `hm-map-help-${++nextId$
|
|
2459
|
+
helpId = `hm-map-help-${++nextId$6}`;
|
|
2041
2460
|
viewportRef = viewChild.required('viewport');
|
|
2042
2461
|
paneRef = viewChild.required('pane');
|
|
2043
2462
|
tilesRef = viewChild.required('tiles');
|
|
@@ -2048,6 +2467,8 @@ class MapComponent {
|
|
|
2048
2467
|
frameState = signal({ zoom: 2, origin: { x: 0, y: 0 } }, ...(ngDevMode ? [{ debugName: "frameState" }] : /* istanbul ignore next */ []));
|
|
2049
2468
|
view = signal({ center: { lat: 0, lng: 0 }, zoom: 2 }, ...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
|
|
2050
2469
|
size = signal({ x: 0, y: 0 }, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
2470
|
+
/** A pessoa já mexeu na vista: mudança de tamanho não reenquadra `bounds` por cima dela. */
|
|
2471
|
+
userMoved = false;
|
|
2051
2472
|
status = signal('', ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
|
|
2052
2473
|
pathSources = signal([], ...(ngDevMode ? [{ debugName: "pathSources" }] : /* istanbul ignore next */ []));
|
|
2053
2474
|
attributionSources = signal([], ...(ngDevMode ? [{ debugName: "attributionSources" }] : /* istanbul ignore next */ []));
|
|
@@ -2120,6 +2541,8 @@ class MapComponent {
|
|
|
2120
2541
|
}, ...(ngDevMode ? [{ debugName: "limits" }] : /* istanbul ignore next */ []));
|
|
2121
2542
|
/** Zoom atual (o inteiro em vigor, não o input). */
|
|
2122
2543
|
currentZoom = computed(() => this.frameState().zoom, ...(ngDevMode ? [{ debugName: "currentZoom" }] : /* istanbul ignore next */ []));
|
|
2544
|
+
/** Zoom mínimo e máximo que a vista permite agora (camadas e `minZoom`/`maxZoom`). */
|
|
2545
|
+
zoomRange = computed(() => ({ minZoom: this.limits().minZoom, maxZoom: this.limits().maxZoom }), ...(ngDevMode ? [{ debugName: "zoomRange" }] : /* istanbul ignore next */ []));
|
|
2123
2546
|
scaleBars = computed(() => {
|
|
2124
2547
|
const { center, zoom } = this.view();
|
|
2125
2548
|
const units = this.scaleUnits();
|
|
@@ -2147,6 +2570,7 @@ class MapComponent {
|
|
|
2147
2570
|
const bounds = this.bounds();
|
|
2148
2571
|
const padding = this.boundsPadding();
|
|
2149
2572
|
if (bounds) {
|
|
2573
|
+
this.userMoved = false;
|
|
2150
2574
|
untracked(() => this.engine?.fitBounds(toLatLngBounds(bounds), { x: padding, y: padding }, { silent: true }));
|
|
2151
2575
|
return;
|
|
2152
2576
|
}
|
|
@@ -2160,6 +2584,20 @@ class MapComponent {
|
|
|
2160
2584
|
engine.setView(center, zoom, { silent: true });
|
|
2161
2585
|
});
|
|
2162
2586
|
});
|
|
2587
|
+
// O tamanho muda logo depois da criação (o layout da página ainda assentando) ou mais tarde: `bounds` continua
|
|
2588
|
+
// valendo. Sem isto, o zoom fica o do tamanho antigo e o retângulo sai da tela. Depois que a pessoa mexeu, a vista é dela.
|
|
2589
|
+
effect(() => {
|
|
2590
|
+
if (!this.ready())
|
|
2591
|
+
return;
|
|
2592
|
+
this.size();
|
|
2593
|
+
untracked(() => {
|
|
2594
|
+
const bounds = this.bounds();
|
|
2595
|
+
if (!bounds || this.userMoved)
|
|
2596
|
+
return;
|
|
2597
|
+
const padding = this.boundsPadding();
|
|
2598
|
+
this.engine?.fitBounds(toLatLngBounds(bounds), { x: padding, y: padding }, { silent: true });
|
|
2599
|
+
});
|
|
2600
|
+
});
|
|
2163
2601
|
effect(() => {
|
|
2164
2602
|
if (!this.ready())
|
|
2165
2603
|
return;
|
|
@@ -2364,6 +2802,8 @@ class MapComponent {
|
|
|
2364
2802
|
},
|
|
2365
2803
|
moveEnd: (view, user) => {
|
|
2366
2804
|
this.view.set(view);
|
|
2805
|
+
if (user)
|
|
2806
|
+
this.userMoved = true;
|
|
2367
2807
|
if (user && this.engine)
|
|
2368
2808
|
this.viewChange.emit({ center: view.center, zoom: view.zoom, bounds: this.engine.bounds });
|
|
2369
2809
|
},
|
|
@@ -2421,7 +2861,7 @@ class MapComponent {
|
|
|
2421
2861
|
/>
|
|
2422
2862
|
}
|
|
2423
2863
|
</svg>
|
|
2424
|
-
<div class="hm-map__markers"><ng-content select="hm-map-marker" /></div>
|
|
2864
|
+
<div class="hm-map__markers"><ng-content select="hm-map-marker, hm-map-cluster, hm-map-route" /></div>
|
|
2425
2865
|
<div class="hm-map__popups"><ng-content select="hm-map-popup" /></div>
|
|
2426
2866
|
@if (tooltip(); as tip) {
|
|
2427
2867
|
<div class="hm-map__tooltip" aria-hidden="true" [style.transform]="'translate3d(' + tip.at.x + 'px, ' + tip.at.y + 'px, 0)'">
|
|
@@ -2536,7 +2976,7 @@ class MapComponent {
|
|
|
2536
2976
|
}
|
|
2537
2977
|
}
|
|
2538
2978
|
<div class="hm-map__layers" hidden><ng-content /></div>
|
|
2539
|
-
`, isInline: true, styles: [".hm-map{--hm-map-water: color-mix(in srgb, var(--hm-accent) 16%, var(--hm-surface-raised));--hm-map-land: color-mix(in srgb, var(--hm-text) 5%, var(--hm-surface-raised));--hm-map-land-muted: color-mix(in srgb, var(--hm-map-land) 45%, var(--hm-map-water));--hm-map-border: var(--hm-border);--hm-map-border-weight: var(--hm-border-hairline);--hm-map-region-border: var(--hm-surface-raised);--hm-map-nodata: color-mix(in srgb, var(--hm-text) 14%, var(--hm-surface-raised));--hm-map-label: var(--hm-text);--hm-map-label-halo: var(--hm-surface-raised);--hm-map-bg: var(--hm-map-water);--hm-map-path-color: var(--hm-data-categorical-1);--hm-map-path-weight: var(--hm-border-thin);--hm-map-fill-opacity: .2;--hm-map-marker-size: var(--hm-icon-xl);--hm-map-marker-color: var(--hm-accent);--hm-map-control-size: var(--hm-control-height);--hm-map-gap: var(--hm-space-sm);position:relative;display:block;overflow:hidden;aspect-ratio:16/9;border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius);background:var(--hm-map-bg);color:var(--hm-text);font-family:var(--hm-font-family);font-size:var(--hm-font-size-sm);isolation:isolate;contain:layout paint}.hm-map__viewport{position:absolute;inset:0;overflow:hidden;cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.hm-map__viewport:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-map--dragging,.hm-map--dragging *{cursor:grabbing}.hm-map--static .hm-map__viewport{cursor:default;touch-action:auto}.hm-map__pane{position:absolute;top:0;left:0;will-change:transform}.hm-map__tiles,.hm-map__markers,.hm-map__popups{position:absolute;top:0;left:0}.hm-map__tiles{z-index:1}.hm-map__tile-level{position:absolute;top:0;left:0}.hm-map__tile{position:absolute;top:0;left:0;max-width:none;max-height:none;border:0;padding:0;margin:0;opacity:0;-webkit-user-select:none;user-select:none;pointer-events:none;image-rendering:auto;transition:opacity var(--hm-duration-standard) var(--hm-ease-standard)}.hm-map__tile--loaded{opacity:1}.hm-map__tile--error{visibility:hidden}.hm-map__overlay{position:absolute;top:0;left:0;z-index:2;overflow:visible;pointer-events:none}.hm-map__path{fill:none;stroke:var(--hm-map-path-color);stroke-width:var(--hm-map-path-weight);stroke-linecap:round;stroke-linejoin:round;fill-rule:evenodd}.hm-map__path--area,.hm-map__path--point{fill:var(--hm-map-path-color);fill-opacity:var(--hm-map-fill-opacity)}.hm-map__path--point{fill-opacity:1;stroke:var(--hm-surface-raised)}.hm-map__path--interactive{pointer-events:visiblePainted;cursor:pointer}.hm-map__markers{z-index:3}.hm-map__popups{z-index:4}.hm-map__controls{position:absolute;top:var(--hm-map-gap);left:var(--hm-map-gap);z-index:5;display:flex;flex-direction:column;border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-control);background:var(--hm-surface-overlay);box-shadow:var(--hm-shadow-overlay);overflow:hidden}.hm-map__control{display:inline-flex;align-items:center;justify-content:center;width:var(--hm-map-control-size);height:var(--hm-map-control-size);padding:0;border:0;background:transparent;color:var(--hm-text);font-size:var(--hm-icon-md);cursor:pointer}.hm-map__control+.hm-map__control{border-top:var(--hm-border-hairline) solid var(--hm-border)}.hm-map__control:hover:not(:disabled){background:var(--hm-accent-subtle)}.hm-map__control:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-map__control:disabled{color:var(--hm-disabled-text);cursor:not-allowed}.hm-map__footer{position:absolute;right:0;bottom:0;left:0;z-index:5;display:flex;align-items:flex-end;justify-content:space-between;gap:var(--hm-map-gap);padding:0 0 0 var(--hm-map-gap);pointer-events:none}.hm-map__footer>*{pointer-events:auto}.hm-map__scale{display:flex;flex-direction:column;gap:var(--hm-space-xxxs);margin-bottom:var(--hm-map-gap)}.hm-map__scale-bar{box-sizing:border-box;padding:0 var(--hm-space-xxxs);border:var(--hm-border-thin) solid var(--hm-text);border-top:0;background:color-mix(in srgb,var(--hm-surface-overlay) 80%,transparent);color:var(--hm-text);font-size:var(--hm-font-size-xs);line-height:var(--hm-line-height-snug);white-space:nowrap}.hm-map__attribution{margin-left:auto;max-width:100%;padding:var(--hm-space-xxxs) var(--hm-space-xs);border-top-left-radius:var(--hm-radius-micro);background:color-mix(in srgb,var(--hm-surface-overlay) 85%,transparent);color:var(--hm-text);font-size:var(--hm-font-size-xs);line-height:var(--hm-line-height-snug);overflow-wrap:anywhere}.hm-map__attribution a{color:var(--hm-accent-strong)}.hm-map__attribution a:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-map__sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.hm-map__layers{display:none}.hm-map-marker{position:absolute;top:0;left:0;width:0;height:0}.hm-map-marker__button{position:absolute;left:0;top:0;display:inline-flex;align-items:center;justify-content:center;min-width:var(--hm-map-marker-size);min-height:var(--hm-map-marker-size);padding:0;border:0;border-radius:var(--hm-radius-pill);background:transparent;color:var(--hm-map-marker-color);font-size:var(--hm-map-marker-size);line-height:1;cursor:pointer;transform:translate(-50%,-100%);filter:drop-shadow(0 0 var(--hm-border-hairline) var(--hm-surface-raised))}.hm-map-marker__button:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-map-marker--center .hm-map-marker__button{transform:translate(-50%,-50%)}.hm-map-marker__icon{pointer-events:none}.hm-map-marker--open{z-index:1}.hm-map-popup{position:absolute;top:0;left:0;width:0;height:0;z-index:2}.hm-map-popup--anchored{top:calc(-1 * var(--hm-map-marker-size))}.hm-map-popup__box{--hm-map-popup-tip: var(--hm-space-sm);position:absolute;bottom:var(--hm-map-popup-tip);left:0;box-sizing:border-box;width:max-content;min-width:calc(var(--hm-control-height) * 4);max-width:min(var(--hm-control-height) * 9,80vw);padding:var(--hm-space-sm) var(--hm-space-md);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius);background:var(--hm-surface-overlay);color:var(--hm-text);box-shadow:var(--hm-shadow-overlay);font-size:var(--hm-font-size-sm);line-height:var(--hm-line-height-normal);transform:translate(-50%);cursor:auto;-webkit-user-select:text;user-select:text}.hm-map-popup__box:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-map-popup__box:after{content:\"\";position:absolute;top:100%;left:50%;width:var(--hm-map-popup-tip);height:var(--hm-map-popup-tip);border-right:var(--hm-border-hairline) solid var(--hm-border);border-bottom:var(--hm-border-hairline) solid var(--hm-border);background:var(--hm-surface-overlay);transform:translate(-50%,-50%) rotate(45deg)}.hm-map-popup__close{float:right;display:inline-flex;align-items:center;justify-content:center;width:var(--hm-control-height-dense);height:var(--hm-control-height-dense);margin:calc(-1 * var(--hm-space-xs)) calc(-1 * var(--hm-space-sm)) 0 var(--hm-space-xs);padding:0;border:0;border-radius:var(--hm-radius-control);background:transparent;color:var(--hm-muted);font-size:var(--hm-icon-md);cursor:pointer}.hm-map-popup__close:hover{background:var(--hm-accent-subtle);color:var(--hm-text)}.hm-map-popup__close:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-map-popup__content{overflow-wrap:anywhere}.hm-map__regions{position:absolute;top:0;left:0;z-index:1}.hm-map-regions{position:absolute;top:0;left:0}.hm-map-regions__svg{position:absolute;top:0;left:0;overflow:visible;pointer-events:none}.hm-map-regions__label{fill:var(--hm-map-label);stroke:var(--hm-map-label-halo);stroke-width:calc(var(--hm-border-thin) * 1.5);stroke-linejoin:round;paint-order:stroke;font-family:var(--hm-font-family);font-size:var(--hm-font-size-xs);font-weight:var(--hm-font-weight-semibold);text-anchor:middle;dominant-baseline:central;pointer-events:none}.hm-map-basemap__region{fill:var(--hm-map-land);fill-rule:evenodd;stroke:var(--hm-map-border);stroke-width:var(--hm-map-border-weight);stroke-linejoin:round}.hm-map-basemap--muted .hm-map-basemap__region{fill:var(--hm-map-land-muted)}.hm-map-choropleth__region{fill:var(--hm-map-nodata);fill-rule:evenodd;stroke:var(--hm-map-region-border);stroke-width:var(--hm-map-border-weight);stroke-linejoin:round;pointer-events:visiblePainted;outline:none}.hm-map-choropleth__region--empty{stroke:var(--hm-map-border)}.hm-map-choropleth__highlight{fill:none;stroke:var(--hm-focus-color);stroke-width:var(--hm-border-thin);stroke-linejoin:round;pointer-events:none;filter:drop-shadow(0 0 var(--hm-border-hairline) var(--hm-surface-raised)) drop-shadow(0 0 var(--hm-border-hairline) var(--hm-surface-raised))}.hm-map__tooltip{position:absolute;top:0;left:0;z-index:5;width:0;height:0;pointer-events:none}.hm-map__tooltip-box{position:absolute;bottom:var(--hm-space-xs);left:0;display:flex;flex-direction:column;width:max-content;max-width:calc(var(--hm-control-height) * 8);padding:var(--hm-space-nano) var(--hm-space-xs);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-micro);background:var(--hm-surface-overlay);color:var(--hm-text);box-shadow:var(--hm-shadow-overlay);font-size:var(--hm-font-size-xs);line-height:var(--hm-line-height-snug);transform:translate(-50%)}.hm-map__tooltip-title{font-weight:var(--hm-font-weight-semibold)}.hm-map__tooltip-detail{font-variant-numeric:tabular-nums}.hm-map__panels{position:absolute;top:var(--hm-map-gap);right:var(--hm-map-gap);z-index:5;display:flex;flex-direction:column;gap:var(--hm-space-xs);max-inline-size:min(50%,var(--hm-control-height) * 7);max-block-size:calc(100% - var(--hm-map-gap) * 2 - var(--hm-control-height));overflow:auto}.hm-map__panel{display:flex;flex-direction:column;align-items:flex-start;gap:var(--hm-space-nano);padding:var(--hm-space-nano) var(--hm-space-xs);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-control);background:color-mix(in srgb,var(--hm-surface-overlay) 92%,transparent);color:var(--hm-text);box-shadow:var(--hm-shadow-overlay);cursor:auto}.hm-map__legend .hm-legend{gap:var(--hm-space-micro)}.hm-map__legend .hm-legend__text{font-size:var(--hm-font-size-xs);font-variant-numeric:tabular-nums}.hm-map__legend .hm-legend__marker{inline-size:var(--hm-space-sm);block-size:var(--hm-space-sm);margin-block-start:calc((1lh - var(--hm-space-sm)) / 2);box-shadow:inset 0 0 0 var(--hm-border-hairline) color-mix(in srgb,var(--hm-text) 25%,transparent)}.hm-map__table-toggle{display:inline-flex;align-items:center;min-block-size:var(--hm-control-height);padding:0 var(--hm-space-xs);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-control);background:var(--hm-surface-overlay);color:var(--hm-accent-strong);font:inherit;font-size:var(--hm-font-size-xs);font-weight:var(--hm-font-weight-semibold);cursor:pointer}.hm-map__table-toggle:hover{background:var(--hm-accent-subtle)}.hm-map__table-toggle:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-map__viewport{container-type:inline-size}@container (max-width: 480px){.hm-map__panels{top:var(--hm-space-xs);right:var(--hm-space-xs);gap:var(--hm-space-micro);max-inline-size:45%}.hm-map__panel{gap:var(--hm-space-micro);padding:var(--hm-space-micro) var(--hm-space-xs)}.hm-map__legend .hm-legend{gap:0}.hm-map__legend .hm-legend__text,.hm-map__table-toggle{font-size:var(--hm-font-size-2xs)}.hm-map__legend .hm-legend__marker{inline-size:var(--hm-space-xs);block-size:var(--hm-space-xs);margin-block-start:calc((1lh - var(--hm-space-xs)) / 2)}}.hm-map__table:not(.hm-map__sr-only){position:absolute;inset:0;z-index:6;display:flex;flex-direction:column;background:var(--hm-surface-raised);color:var(--hm-text)}.hm-map__table-bar{display:flex;justify-content:flex-end;padding:var(--hm-space-xs) var(--hm-map-gap);border-bottom:var(--hm-border-hairline) solid var(--hm-divider)}.hm-map__table:not(.hm-map__sr-only) .hm-map__table-scroll{overflow:auto}.hm-map__table-scroll{flex:1 1 auto;min-block-size:0;padding:0 var(--hm-map-gap) var(--hm-map-gap)}.hm-map__table-scroll:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-map__table-scroll table{inline-size:100%}.hm-map__table-scroll caption{padding-block:var(--hm-space-xs);color:var(--hm-muted);font-size:var(--hm-font-size-sm);text-align:start}.hm-map__table-num{text-align:end;font-variant-numeric:tabular-nums}@media(prefers-reduced-motion:reduce){.hm-map__tile{transition:none}}@media(forced-colors:active){.hm-map{border-color:CanvasText}.hm-map__viewport:focus-visible,.hm-map__control:focus-visible,.hm-map__table-toggle:focus-visible,.hm-map__table-scroll:focus-visible,.hm-map-marker__button:focus-visible,.hm-map-popup__box:focus-visible,.hm-map-popup__close:focus-visible{outline-color:Highlight}.hm-map__controls,.hm-map-popup__box,.hm-map__attribution,.hm-map__scale-bar{border:var(--hm-border-hairline) solid CanvasText;background:Canvas;color:CanvasText;forced-color-adjust:none}.hm-map__control{background:ButtonFace;color:ButtonText;forced-color-adjust:none}.hm-map__control:disabled{color:GrayText}.hm-map-marker__button{color:LinkText;forced-color-adjust:none}.hm-map__path{stroke:CanvasText!important;forced-color-adjust:none}.hm-map__path--area,.hm-map__path--point{fill:Highlight!important}.hm-map-basemap__region,.hm-map-basemap--muted .hm-map-basemap__region{fill:Canvas;stroke:CanvasText;forced-color-adjust:none}.hm-map-choropleth__region{stroke:CanvasText;forced-color-adjust:none}.hm-map-choropleth__highlight{stroke:Highlight;filter:none;forced-color-adjust:none}.hm-map-regions__label{fill:CanvasText;stroke:Canvas;forced-color-adjust:none}.hm-map__tooltip-box,.hm-map__panel,.hm-map__table-toggle{border-color:CanvasText;background:Canvas;color:CanvasText}.hm-map__legend .hm-legend__marker{forced-color-adjust:none;box-shadow:inset 0 0 0 var(--hm-border-hairline) CanvasText}}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "hm-icon", inputs: ["shape", "direction", "size", "solid", "badge", "status", "flip", "inverse", "label"] }, { kind: "component", type: LegendComponent, selector: "hm-legend", inputs: ["items", "orientation", "marker", "label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2979
|
+
`, isInline: true, styles: [".hm-map{--hm-map-water: color-mix(in srgb, var(--hm-accent) 16%, var(--hm-surface-raised));--hm-map-land: color-mix(in srgb, var(--hm-text) 5%, var(--hm-surface-raised));--hm-map-land-muted: color-mix(in srgb, var(--hm-map-land) 45%, var(--hm-map-water));--hm-map-border: var(--hm-border);--hm-map-border-weight: var(--hm-border-hairline);--hm-map-region-border: var(--hm-surface-raised);--hm-map-nodata: color-mix(in srgb, var(--hm-text) 14%, var(--hm-surface-raised));--hm-map-label: var(--hm-text);--hm-map-label-halo: var(--hm-surface-raised);--hm-map-bg: var(--hm-map-water);--hm-map-path-color: var(--hm-data-categorical-1);--hm-map-path-weight: var(--hm-border-thin);--hm-map-fill-opacity: .2;--hm-map-marker-size: var(--hm-icon-xl);--hm-map-marker-color: var(--hm-accent);--hm-map-control-size: var(--hm-control-height);--hm-map-gap: var(--hm-space-sm);position:relative;display:block;overflow:hidden;aspect-ratio:16/9;border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius);background:var(--hm-map-bg);color:var(--hm-text);font-family:var(--hm-font-family);font-size:var(--hm-font-size-sm);isolation:isolate;contain:layout paint}.hm-map__viewport{position:absolute;inset:0;overflow:hidden;cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.hm-map__viewport:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-map--dragging,.hm-map--dragging *{cursor:grabbing}.hm-map--static .hm-map__viewport{cursor:default;touch-action:auto}.hm-map__pane{position:absolute;top:0;left:0;will-change:transform}.hm-map__tiles,.hm-map__markers,.hm-map__popups{position:absolute;top:0;left:0}.hm-map__tiles{z-index:1}.hm-map__tile-level{position:absolute;top:0;left:0}.hm-map__tile{position:absolute;top:0;left:0;max-width:none;max-height:none;border:0;padding:0;margin:0;opacity:0;-webkit-user-select:none;user-select:none;pointer-events:none;image-rendering:auto;transition:opacity var(--hm-duration-standard) var(--hm-ease-standard)}.hm-map__tile--loaded{opacity:1}.hm-map__tile--error{visibility:hidden}.hm-map__overlay{position:absolute;top:0;left:0;z-index:2;overflow:visible;pointer-events:none}.hm-map__path{fill:none;stroke:var(--hm-map-path-color);stroke-width:var(--hm-map-path-weight);stroke-linecap:round;stroke-linejoin:round;fill-rule:evenodd}.hm-map__path--area,.hm-map__path--point{fill:var(--hm-map-path-color);fill-opacity:var(--hm-map-fill-opacity)}.hm-map__path--point{fill-opacity:1;stroke:var(--hm-surface-raised)}.hm-map__path--interactive{pointer-events:visiblePainted;cursor:pointer}.hm-map__markers{z-index:3}.hm-map__popups{z-index:4}.hm-map__controls{position:absolute;top:var(--hm-map-gap);left:var(--hm-map-gap);z-index:5;display:flex;flex-direction:column;border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-control);background:var(--hm-surface-overlay);box-shadow:var(--hm-shadow-overlay);overflow:hidden}.hm-map__control{display:inline-flex;align-items:center;justify-content:center;width:var(--hm-map-control-size);height:var(--hm-map-control-size);padding:0;border:0;background:transparent;color:var(--hm-text);font-size:var(--hm-icon-md);cursor:pointer}.hm-map__control+.hm-map__control{border-top:var(--hm-border-hairline) solid var(--hm-border)}.hm-map__control:hover:not(:disabled){background:var(--hm-accent-subtle)}.hm-map__control:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-map__control:disabled{color:var(--hm-disabled-text);cursor:not-allowed}.hm-map__footer{position:absolute;right:0;bottom:0;left:0;z-index:5;display:flex;align-items:flex-end;justify-content:space-between;gap:var(--hm-map-gap);padding:0 0 0 var(--hm-map-gap);pointer-events:none}.hm-map__footer>*{pointer-events:auto}.hm-map__scale{display:flex;flex-direction:column;gap:var(--hm-space-xxxs);margin-bottom:var(--hm-map-gap)}.hm-map__scale-bar{box-sizing:border-box;padding:0 var(--hm-space-xxxs);border:var(--hm-border-thin) solid var(--hm-text);border-top:0;background:color-mix(in srgb,var(--hm-surface-overlay) 80%,transparent);color:var(--hm-text);font-size:var(--hm-font-size-xs);line-height:var(--hm-line-height-snug);white-space:nowrap}.hm-map__attribution{margin-left:auto;max-width:100%;padding:var(--hm-space-xxxs) var(--hm-space-xs);border-top-left-radius:var(--hm-radius-micro);background:color-mix(in srgb,var(--hm-surface-overlay) 85%,transparent);color:var(--hm-text);font-size:var(--hm-font-size-xs);line-height:var(--hm-line-height-snug);overflow-wrap:anywhere}.hm-map__attribution a{color:var(--hm-accent-strong)}.hm-map__attribution a:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-map__sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.hm-map__layers{display:none}.hm-map-cluster{display:contents}.hm-map-marker--clustered{display:none}.hm-map-cluster__group{position:absolute;top:0;left:0;width:0;height:0}.hm-map-cluster__button{position:absolute;display:grid;place-items:center;min-width:var(--hm-control-height);min-height:var(--hm-control-height);padding:0 var(--hm-space-nano);border:var(--hm-border-thin) solid var(--hm-surface-raised);border-radius:var(--hm-radius-pill);background:var(--hm-action);color:var(--hm-on-action);font:inherit;font-size:var(--hm-font-size-sm);font-weight:var(--hm-font-weight-bold);font-variant-numeric:tabular-nums;line-height:1;cursor:pointer;transform:translate(-50%,-50%);box-shadow:0 0 0 var(--hm-space-micro) color-mix(in srgb,var(--hm-action) 28%,transparent)}.hm-map-cluster__button--large{min-width:calc(var(--hm-control-height) * 1.25);min-height:calc(var(--hm-control-height) * 1.25)}.hm-map-cluster__button:hover{box-shadow:0 0 0 var(--hm-space-nano) color-mix(in srgb,var(--hm-action) 34%,transparent)}.hm-map-cluster__button:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-space-micro)}@media(forced-colors:active){.hm-map-cluster__button{border-color:CanvasText;background:Canvas;color:LinkText;box-shadow:none;forced-color-adjust:none}.hm-map-cluster__button:focus-visible{outline-color:Highlight}}.hm-map-marker{position:absolute;top:0;left:0;width:0;height:0}.hm-map-marker__button{position:absolute;left:0;top:0;display:inline-flex;align-items:center;justify-content:center;min-width:var(--hm-map-marker-size);min-height:var(--hm-map-marker-size);padding:0;border:0;border-radius:var(--hm-radius-pill);background:transparent;color:var(--hm-map-marker-color);font-size:var(--hm-map-marker-size);line-height:1;cursor:pointer;transform:translate(-50%,-100%);filter:drop-shadow(0 0 var(--hm-border-hairline) var(--hm-surface-raised))}.hm-map-marker__button:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-map-marker--center .hm-map-marker__button{transform:translate(-50%,-50%)}.hm-map-marker__icon{pointer-events:none}.hm-map-marker--open{z-index:1}.hm-map-popup{position:absolute;top:0;left:0;width:0;height:0;z-index:2}.hm-map-popup--anchored{top:calc(-1 * var(--hm-map-marker-size))}.hm-map-popup__box{--hm-map-popup-tip: var(--hm-space-sm);position:absolute;bottom:var(--hm-map-popup-tip);left:0;box-sizing:border-box;width:max-content;min-width:calc(var(--hm-control-height) * 4);max-width:min(var(--hm-control-height) * 9,80vw);padding:var(--hm-space-sm) var(--hm-space-md);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius);background:var(--hm-surface-overlay);color:var(--hm-text);box-shadow:var(--hm-shadow-overlay);font-size:var(--hm-font-size-sm);line-height:var(--hm-line-height-normal);transform:translate(-50%);cursor:auto;-webkit-user-select:text;user-select:text}.hm-map-popup__box:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-map-popup__box:after{content:\"\";position:absolute;top:100%;left:50%;width:var(--hm-map-popup-tip);height:var(--hm-map-popup-tip);border-right:var(--hm-border-hairline) solid var(--hm-border);border-bottom:var(--hm-border-hairline) solid var(--hm-border);background:var(--hm-surface-overlay);transform:translate(-50%,-50%) rotate(45deg)}.hm-map-popup__close{float:right;display:inline-flex;align-items:center;justify-content:center;width:var(--hm-control-height-dense);height:var(--hm-control-height-dense);margin:calc(-1 * var(--hm-space-xs)) calc(-1 * var(--hm-space-sm)) 0 var(--hm-space-xs);padding:0;border:0;border-radius:var(--hm-radius-control);background:transparent;color:var(--hm-muted);font-size:var(--hm-icon-md);cursor:pointer}.hm-map-popup__close:hover{background:var(--hm-accent-subtle);color:var(--hm-text)}.hm-map-popup__close:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-map-popup__content{overflow-wrap:anywhere}.hm-map__regions{position:absolute;top:0;left:0;z-index:1}.hm-map-regions{position:absolute;top:0;left:0}.hm-map-regions__svg{position:absolute;top:0;left:0;overflow:visible;pointer-events:none}.hm-map-regions__label{fill:var(--hm-map-label);stroke:var(--hm-map-label-halo);stroke-width:calc(var(--hm-border-thin) * 1.5);stroke-linejoin:round;paint-order:stroke;font-family:var(--hm-font-family);font-size:var(--hm-font-size-xs);font-weight:var(--hm-font-weight-semibold);text-anchor:middle;dominant-baseline:central;pointer-events:none}.hm-map-basemap__region{fill:var(--hm-map-land);fill-rule:evenodd;stroke:var(--hm-map-border);stroke-width:var(--hm-map-border-weight);stroke-linejoin:round}.hm-map-basemap--muted .hm-map-basemap__region{fill:var(--hm-map-land-muted)}.hm-map-choropleth__region{fill:var(--hm-map-nodata);fill-rule:evenodd;stroke:var(--hm-map-region-border);stroke-width:var(--hm-map-border-weight);stroke-linejoin:round;pointer-events:visiblePainted;outline:none}.hm-map-choropleth__region--empty{stroke:var(--hm-map-border)}.hm-map-choropleth__highlight{fill:none;stroke:var(--hm-focus-color);stroke-width:var(--hm-border-thin);stroke-linejoin:round;pointer-events:none;filter:drop-shadow(0 0 var(--hm-border-hairline) var(--hm-surface-raised)) drop-shadow(0 0 var(--hm-border-hairline) var(--hm-surface-raised))}.hm-map__tooltip{position:absolute;top:0;left:0;z-index:5;width:0;height:0;pointer-events:none}.hm-map__tooltip-box{position:absolute;bottom:var(--hm-space-xs);left:0;display:flex;flex-direction:column;width:max-content;max-width:calc(var(--hm-control-height) * 8);padding:var(--hm-space-nano) var(--hm-space-xs);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-micro);background:var(--hm-surface-overlay);color:var(--hm-text);box-shadow:var(--hm-shadow-overlay);font-size:var(--hm-font-size-xs);line-height:var(--hm-line-height-snug);transform:translate(-50%)}.hm-map__tooltip-title{font-weight:var(--hm-font-weight-semibold)}.hm-map__tooltip-detail{font-variant-numeric:tabular-nums}.hm-map__panels{position:absolute;top:var(--hm-map-gap);right:var(--hm-map-gap);z-index:5;display:flex;flex-direction:column;gap:var(--hm-space-xs);max-inline-size:min(50%,var(--hm-control-height) * 7);max-block-size:calc(100% - var(--hm-map-gap) * 2 - var(--hm-control-height));overflow:auto}.hm-map__panel{display:flex;flex-direction:column;align-items:flex-start;gap:var(--hm-space-nano);padding:var(--hm-space-nano) var(--hm-space-xs);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-control);background:color-mix(in srgb,var(--hm-surface-overlay) 92%,transparent);color:var(--hm-text);box-shadow:var(--hm-shadow-overlay);cursor:auto}.hm-map__legend .hm-legend{gap:var(--hm-space-micro)}.hm-map__legend .hm-legend__text{font-size:var(--hm-font-size-xs);font-variant-numeric:tabular-nums}.hm-map__legend .hm-legend__marker{inline-size:var(--hm-space-sm);block-size:var(--hm-space-sm);margin-block-start:calc((1lh - var(--hm-space-sm)) / 2);box-shadow:inset 0 0 0 var(--hm-border-hairline) color-mix(in srgb,var(--hm-text) 25%,transparent)}.hm-map__table-toggle{display:inline-flex;align-items:center;min-block-size:var(--hm-control-height);padding:0 var(--hm-space-xs);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-control);background:var(--hm-surface-overlay);color:var(--hm-accent-strong);font:inherit;font-size:var(--hm-font-size-xs);font-weight:var(--hm-font-weight-semibold);cursor:pointer}.hm-map__table-toggle:hover{background:var(--hm-accent-subtle)}.hm-map__table-toggle:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-map__viewport{container-type:inline-size}@container (max-width: 480px){.hm-map__panels{top:var(--hm-space-xs);right:var(--hm-space-xs);gap:var(--hm-space-micro);max-inline-size:45%}.hm-map__panel{gap:var(--hm-space-micro);padding:var(--hm-space-micro) var(--hm-space-xs)}.hm-map__legend .hm-legend{gap:0}.hm-map__legend .hm-legend__text,.hm-map__table-toggle{font-size:var(--hm-font-size-2xs)}.hm-map__legend .hm-legend__marker{inline-size:var(--hm-space-xs);block-size:var(--hm-space-xs);margin-block-start:calc((1lh - var(--hm-space-xs)) / 2)}}.hm-map__table:not(.hm-map__sr-only){position:absolute;inset:0;z-index:6;display:flex;flex-direction:column;background:var(--hm-surface-raised);color:var(--hm-text)}.hm-map__table-bar{display:flex;justify-content:flex-end;padding:var(--hm-space-xs) var(--hm-map-gap);border-bottom:var(--hm-border-hairline) solid var(--hm-divider)}.hm-map__table:not(.hm-map__sr-only) .hm-map__table-scroll{overflow:auto}.hm-map__table-scroll{flex:1 1 auto;min-block-size:0;padding:0 var(--hm-map-gap) var(--hm-map-gap)}.hm-map__table-scroll:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-map__table-scroll table{inline-size:100%}.hm-map__table-scroll caption{padding-block:var(--hm-space-xs);color:var(--hm-muted);font-size:var(--hm-font-size-sm);text-align:start}.hm-map__table-num{text-align:end;font-variant-numeric:tabular-nums}@media(prefers-reduced-motion:reduce){.hm-map__tile{transition:none}}@media(forced-colors:active){.hm-map{border-color:CanvasText}.hm-map__viewport:focus-visible,.hm-map__control:focus-visible,.hm-map__table-toggle:focus-visible,.hm-map__table-scroll:focus-visible,.hm-map-marker__button:focus-visible,.hm-map-popup__box:focus-visible,.hm-map-popup__close:focus-visible{outline-color:Highlight}.hm-map__controls,.hm-map-popup__box,.hm-map__attribution,.hm-map__scale-bar{border:var(--hm-border-hairline) solid CanvasText;background:Canvas;color:CanvasText;forced-color-adjust:none}.hm-map__control{background:ButtonFace;color:ButtonText;forced-color-adjust:none}.hm-map__control:disabled{color:GrayText}.hm-map-marker__button{color:LinkText;forced-color-adjust:none}.hm-map__path{stroke:CanvasText!important;forced-color-adjust:none}.hm-map__path--area,.hm-map__path--point{fill:Highlight!important}.hm-map-basemap__region,.hm-map-basemap--muted .hm-map-basemap__region{fill:Canvas;stroke:CanvasText;forced-color-adjust:none}.hm-map-choropleth__region{stroke:CanvasText;forced-color-adjust:none}.hm-map-choropleth__highlight{stroke:Highlight;filter:none;forced-color-adjust:none}.hm-map-regions__label{fill:CanvasText;stroke:Canvas;forced-color-adjust:none}.hm-map__tooltip-box,.hm-map__panel,.hm-map__table-toggle{border-color:CanvasText;background:Canvas;color:CanvasText}.hm-map__legend .hm-legend__marker{forced-color-adjust:none;box-shadow:inset 0 0 0 var(--hm-border-hairline) CanvasText}}.hm-map{--hm-map-route-color: var(--hm-accent);--hm-map-route-casing: var(--hm-surface-raised);--hm-map-route-alt: var(--hm-muted);--hm-map-route-active: var(--hm-accent-strong);--hm-map-route-weight: calc(var(--hm-border-thin) * 3)}.hm-map-route{position:absolute;top:0;left:0;width:0;height:0}.hm-map-route__start{--hm-map-marker-color: var(--hm-success)}.hm-map-route__end{--hm-map-marker-color: var(--hm-danger)}.hm-map__path.hm-map-route__casing{stroke:var(--hm-map-route-casing);stroke-width:calc(var(--hm-map-route-weight) + var(--hm-border-thin) * 2)}.hm-map__path.hm-map-route__line{stroke:var(--hm-map-route-color);stroke-width:var(--hm-map-route-weight)}.hm-map__path.hm-map-route__alt{stroke:var(--hm-map-route-alt);stroke-width:var(--hm-map-route-weight);stroke-opacity:.6}.hm-map__path.hm-map-route__alt.hm-map__path--interactive:hover{stroke-opacity:.9}.hm-map__path.hm-map-route__active{stroke:var(--hm-map-route-active);stroke-width:calc(var(--hm-map-route-weight) + var(--hm-border-thin))}.hm-map__path.hm-map-route__step-point{fill:var(--hm-map-route-active);stroke:var(--hm-surface-raised);stroke-width:var(--hm-border-thin)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "hm-icon", inputs: ["shape", "direction", "size", "solid", "badge", "status", "flip", "inverse", "label"] }, { kind: "component", type: LegendComponent, selector: "hm-legend", inputs: ["items", "orientation", "marker", "label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2540
2980
|
}
|
|
2541
2981
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: MapComponent, decorators: [{
|
|
2542
2982
|
type: Component,
|
|
@@ -2577,7 +3017,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImpo
|
|
|
2577
3017
|
/>
|
|
2578
3018
|
}
|
|
2579
3019
|
</svg>
|
|
2580
|
-
<div class="hm-map__markers"><ng-content select="hm-map-marker" /></div>
|
|
3020
|
+
<div class="hm-map__markers"><ng-content select="hm-map-marker, hm-map-cluster, hm-map-route" /></div>
|
|
2581
3021
|
<div class="hm-map__popups"><ng-content select="hm-map-popup" /></div>
|
|
2582
3022
|
@if (tooltip(); as tip) {
|
|
2583
3023
|
<div class="hm-map__tooltip" aria-hidden="true" [style.transform]="'translate3d(' + tip.at.x + 'px, ' + tip.at.y + 'px, 0)'">
|
|
@@ -2692,7 +3132,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImpo
|
|
|
2692
3132
|
}
|
|
2693
3133
|
}
|
|
2694
3134
|
<div class="hm-map__layers" hidden><ng-content /></div>
|
|
2695
|
-
`, styles: [".hm-map{--hm-map-water: color-mix(in srgb, var(--hm-accent) 16%, var(--hm-surface-raised));--hm-map-land: color-mix(in srgb, var(--hm-text) 5%, var(--hm-surface-raised));--hm-map-land-muted: color-mix(in srgb, var(--hm-map-land) 45%, var(--hm-map-water));--hm-map-border: var(--hm-border);--hm-map-border-weight: var(--hm-border-hairline);--hm-map-region-border: var(--hm-surface-raised);--hm-map-nodata: color-mix(in srgb, var(--hm-text) 14%, var(--hm-surface-raised));--hm-map-label: var(--hm-text);--hm-map-label-halo: var(--hm-surface-raised);--hm-map-bg: var(--hm-map-water);--hm-map-path-color: var(--hm-data-categorical-1);--hm-map-path-weight: var(--hm-border-thin);--hm-map-fill-opacity: .2;--hm-map-marker-size: var(--hm-icon-xl);--hm-map-marker-color: var(--hm-accent);--hm-map-control-size: var(--hm-control-height);--hm-map-gap: var(--hm-space-sm);position:relative;display:block;overflow:hidden;aspect-ratio:16/9;border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius);background:var(--hm-map-bg);color:var(--hm-text);font-family:var(--hm-font-family);font-size:var(--hm-font-size-sm);isolation:isolate;contain:layout paint}.hm-map__viewport{position:absolute;inset:0;overflow:hidden;cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.hm-map__viewport:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-map--dragging,.hm-map--dragging *{cursor:grabbing}.hm-map--static .hm-map__viewport{cursor:default;touch-action:auto}.hm-map__pane{position:absolute;top:0;left:0;will-change:transform}.hm-map__tiles,.hm-map__markers,.hm-map__popups{position:absolute;top:0;left:0}.hm-map__tiles{z-index:1}.hm-map__tile-level{position:absolute;top:0;left:0}.hm-map__tile{position:absolute;top:0;left:0;max-width:none;max-height:none;border:0;padding:0;margin:0;opacity:0;-webkit-user-select:none;user-select:none;pointer-events:none;image-rendering:auto;transition:opacity var(--hm-duration-standard) var(--hm-ease-standard)}.hm-map__tile--loaded{opacity:1}.hm-map__tile--error{visibility:hidden}.hm-map__overlay{position:absolute;top:0;left:0;z-index:2;overflow:visible;pointer-events:none}.hm-map__path{fill:none;stroke:var(--hm-map-path-color);stroke-width:var(--hm-map-path-weight);stroke-linecap:round;stroke-linejoin:round;fill-rule:evenodd}.hm-map__path--area,.hm-map__path--point{fill:var(--hm-map-path-color);fill-opacity:var(--hm-map-fill-opacity)}.hm-map__path--point{fill-opacity:1;stroke:var(--hm-surface-raised)}.hm-map__path--interactive{pointer-events:visiblePainted;cursor:pointer}.hm-map__markers{z-index:3}.hm-map__popups{z-index:4}.hm-map__controls{position:absolute;top:var(--hm-map-gap);left:var(--hm-map-gap);z-index:5;display:flex;flex-direction:column;border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-control);background:var(--hm-surface-overlay);box-shadow:var(--hm-shadow-overlay);overflow:hidden}.hm-map__control{display:inline-flex;align-items:center;justify-content:center;width:var(--hm-map-control-size);height:var(--hm-map-control-size);padding:0;border:0;background:transparent;color:var(--hm-text);font-size:var(--hm-icon-md);cursor:pointer}.hm-map__control+.hm-map__control{border-top:var(--hm-border-hairline) solid var(--hm-border)}.hm-map__control:hover:not(:disabled){background:var(--hm-accent-subtle)}.hm-map__control:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-map__control:disabled{color:var(--hm-disabled-text);cursor:not-allowed}.hm-map__footer{position:absolute;right:0;bottom:0;left:0;z-index:5;display:flex;align-items:flex-end;justify-content:space-between;gap:var(--hm-map-gap);padding:0 0 0 var(--hm-map-gap);pointer-events:none}.hm-map__footer>*{pointer-events:auto}.hm-map__scale{display:flex;flex-direction:column;gap:var(--hm-space-xxxs);margin-bottom:var(--hm-map-gap)}.hm-map__scale-bar{box-sizing:border-box;padding:0 var(--hm-space-xxxs);border:var(--hm-border-thin) solid var(--hm-text);border-top:0;background:color-mix(in srgb,var(--hm-surface-overlay) 80%,transparent);color:var(--hm-text);font-size:var(--hm-font-size-xs);line-height:var(--hm-line-height-snug);white-space:nowrap}.hm-map__attribution{margin-left:auto;max-width:100%;padding:var(--hm-space-xxxs) var(--hm-space-xs);border-top-left-radius:var(--hm-radius-micro);background:color-mix(in srgb,var(--hm-surface-overlay) 85%,transparent);color:var(--hm-text);font-size:var(--hm-font-size-xs);line-height:var(--hm-line-height-snug);overflow-wrap:anywhere}.hm-map__attribution a{color:var(--hm-accent-strong)}.hm-map__attribution a:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-map__sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.hm-map__layers{display:none}.hm-map-marker{position:absolute;top:0;left:0;width:0;height:0}.hm-map-marker__button{position:absolute;left:0;top:0;display:inline-flex;align-items:center;justify-content:center;min-width:var(--hm-map-marker-size);min-height:var(--hm-map-marker-size);padding:0;border:0;border-radius:var(--hm-radius-pill);background:transparent;color:var(--hm-map-marker-color);font-size:var(--hm-map-marker-size);line-height:1;cursor:pointer;transform:translate(-50%,-100%);filter:drop-shadow(0 0 var(--hm-border-hairline) var(--hm-surface-raised))}.hm-map-marker__button:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-map-marker--center .hm-map-marker__button{transform:translate(-50%,-50%)}.hm-map-marker__icon{pointer-events:none}.hm-map-marker--open{z-index:1}.hm-map-popup{position:absolute;top:0;left:0;width:0;height:0;z-index:2}.hm-map-popup--anchored{top:calc(-1 * var(--hm-map-marker-size))}.hm-map-popup__box{--hm-map-popup-tip: var(--hm-space-sm);position:absolute;bottom:var(--hm-map-popup-tip);left:0;box-sizing:border-box;width:max-content;min-width:calc(var(--hm-control-height) * 4);max-width:min(var(--hm-control-height) * 9,80vw);padding:var(--hm-space-sm) var(--hm-space-md);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius);background:var(--hm-surface-overlay);color:var(--hm-text);box-shadow:var(--hm-shadow-overlay);font-size:var(--hm-font-size-sm);line-height:var(--hm-line-height-normal);transform:translate(-50%);cursor:auto;-webkit-user-select:text;user-select:text}.hm-map-popup__box:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-map-popup__box:after{content:\"\";position:absolute;top:100%;left:50%;width:var(--hm-map-popup-tip);height:var(--hm-map-popup-tip);border-right:var(--hm-border-hairline) solid var(--hm-border);border-bottom:var(--hm-border-hairline) solid var(--hm-border);background:var(--hm-surface-overlay);transform:translate(-50%,-50%) rotate(45deg)}.hm-map-popup__close{float:right;display:inline-flex;align-items:center;justify-content:center;width:var(--hm-control-height-dense);height:var(--hm-control-height-dense);margin:calc(-1 * var(--hm-space-xs)) calc(-1 * var(--hm-space-sm)) 0 var(--hm-space-xs);padding:0;border:0;border-radius:var(--hm-radius-control);background:transparent;color:var(--hm-muted);font-size:var(--hm-icon-md);cursor:pointer}.hm-map-popup__close:hover{background:var(--hm-accent-subtle);color:var(--hm-text)}.hm-map-popup__close:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-map-popup__content{overflow-wrap:anywhere}.hm-map__regions{position:absolute;top:0;left:0;z-index:1}.hm-map-regions{position:absolute;top:0;left:0}.hm-map-regions__svg{position:absolute;top:0;left:0;overflow:visible;pointer-events:none}.hm-map-regions__label{fill:var(--hm-map-label);stroke:var(--hm-map-label-halo);stroke-width:calc(var(--hm-border-thin) * 1.5);stroke-linejoin:round;paint-order:stroke;font-family:var(--hm-font-family);font-size:var(--hm-font-size-xs);font-weight:var(--hm-font-weight-semibold);text-anchor:middle;dominant-baseline:central;pointer-events:none}.hm-map-basemap__region{fill:var(--hm-map-land);fill-rule:evenodd;stroke:var(--hm-map-border);stroke-width:var(--hm-map-border-weight);stroke-linejoin:round}.hm-map-basemap--muted .hm-map-basemap__region{fill:var(--hm-map-land-muted)}.hm-map-choropleth__region{fill:var(--hm-map-nodata);fill-rule:evenodd;stroke:var(--hm-map-region-border);stroke-width:var(--hm-map-border-weight);stroke-linejoin:round;pointer-events:visiblePainted;outline:none}.hm-map-choropleth__region--empty{stroke:var(--hm-map-border)}.hm-map-choropleth__highlight{fill:none;stroke:var(--hm-focus-color);stroke-width:var(--hm-border-thin);stroke-linejoin:round;pointer-events:none;filter:drop-shadow(0 0 var(--hm-border-hairline) var(--hm-surface-raised)) drop-shadow(0 0 var(--hm-border-hairline) var(--hm-surface-raised))}.hm-map__tooltip{position:absolute;top:0;left:0;z-index:5;width:0;height:0;pointer-events:none}.hm-map__tooltip-box{position:absolute;bottom:var(--hm-space-xs);left:0;display:flex;flex-direction:column;width:max-content;max-width:calc(var(--hm-control-height) * 8);padding:var(--hm-space-nano) var(--hm-space-xs);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-micro);background:var(--hm-surface-overlay);color:var(--hm-text);box-shadow:var(--hm-shadow-overlay);font-size:var(--hm-font-size-xs);line-height:var(--hm-line-height-snug);transform:translate(-50%)}.hm-map__tooltip-title{font-weight:var(--hm-font-weight-semibold)}.hm-map__tooltip-detail{font-variant-numeric:tabular-nums}.hm-map__panels{position:absolute;top:var(--hm-map-gap);right:var(--hm-map-gap);z-index:5;display:flex;flex-direction:column;gap:var(--hm-space-xs);max-inline-size:min(50%,var(--hm-control-height) * 7);max-block-size:calc(100% - var(--hm-map-gap) * 2 - var(--hm-control-height));overflow:auto}.hm-map__panel{display:flex;flex-direction:column;align-items:flex-start;gap:var(--hm-space-nano);padding:var(--hm-space-nano) var(--hm-space-xs);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-control);background:color-mix(in srgb,var(--hm-surface-overlay) 92%,transparent);color:var(--hm-text);box-shadow:var(--hm-shadow-overlay);cursor:auto}.hm-map__legend .hm-legend{gap:var(--hm-space-micro)}.hm-map__legend .hm-legend__text{font-size:var(--hm-font-size-xs);font-variant-numeric:tabular-nums}.hm-map__legend .hm-legend__marker{inline-size:var(--hm-space-sm);block-size:var(--hm-space-sm);margin-block-start:calc((1lh - var(--hm-space-sm)) / 2);box-shadow:inset 0 0 0 var(--hm-border-hairline) color-mix(in srgb,var(--hm-text) 25%,transparent)}.hm-map__table-toggle{display:inline-flex;align-items:center;min-block-size:var(--hm-control-height);padding:0 var(--hm-space-xs);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-control);background:var(--hm-surface-overlay);color:var(--hm-accent-strong);font:inherit;font-size:var(--hm-font-size-xs);font-weight:var(--hm-font-weight-semibold);cursor:pointer}.hm-map__table-toggle:hover{background:var(--hm-accent-subtle)}.hm-map__table-toggle:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-map__viewport{container-type:inline-size}@container (max-width: 480px){.hm-map__panels{top:var(--hm-space-xs);right:var(--hm-space-xs);gap:var(--hm-space-micro);max-inline-size:45%}.hm-map__panel{gap:var(--hm-space-micro);padding:var(--hm-space-micro) var(--hm-space-xs)}.hm-map__legend .hm-legend{gap:0}.hm-map__legend .hm-legend__text,.hm-map__table-toggle{font-size:var(--hm-font-size-2xs)}.hm-map__legend .hm-legend__marker{inline-size:var(--hm-space-xs);block-size:var(--hm-space-xs);margin-block-start:calc((1lh - var(--hm-space-xs)) / 2)}}.hm-map__table:not(.hm-map__sr-only){position:absolute;inset:0;z-index:6;display:flex;flex-direction:column;background:var(--hm-surface-raised);color:var(--hm-text)}.hm-map__table-bar{display:flex;justify-content:flex-end;padding:var(--hm-space-xs) var(--hm-map-gap);border-bottom:var(--hm-border-hairline) solid var(--hm-divider)}.hm-map__table:not(.hm-map__sr-only) .hm-map__table-scroll{overflow:auto}.hm-map__table-scroll{flex:1 1 auto;min-block-size:0;padding:0 var(--hm-map-gap) var(--hm-map-gap)}.hm-map__table-scroll:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-map__table-scroll table{inline-size:100%}.hm-map__table-scroll caption{padding-block:var(--hm-space-xs);color:var(--hm-muted);font-size:var(--hm-font-size-sm);text-align:start}.hm-map__table-num{text-align:end;font-variant-numeric:tabular-nums}@media(prefers-reduced-motion:reduce){.hm-map__tile{transition:none}}@media(forced-colors:active){.hm-map{border-color:CanvasText}.hm-map__viewport:focus-visible,.hm-map__control:focus-visible,.hm-map__table-toggle:focus-visible,.hm-map__table-scroll:focus-visible,.hm-map-marker__button:focus-visible,.hm-map-popup__box:focus-visible,.hm-map-popup__close:focus-visible{outline-color:Highlight}.hm-map__controls,.hm-map-popup__box,.hm-map__attribution,.hm-map__scale-bar{border:var(--hm-border-hairline) solid CanvasText;background:Canvas;color:CanvasText;forced-color-adjust:none}.hm-map__control{background:ButtonFace;color:ButtonText;forced-color-adjust:none}.hm-map__control:disabled{color:GrayText}.hm-map-marker__button{color:LinkText;forced-color-adjust:none}.hm-map__path{stroke:CanvasText!important;forced-color-adjust:none}.hm-map__path--area,.hm-map__path--point{fill:Highlight!important}.hm-map-basemap__region,.hm-map-basemap--muted .hm-map-basemap__region{fill:Canvas;stroke:CanvasText;forced-color-adjust:none}.hm-map-choropleth__region{stroke:CanvasText;forced-color-adjust:none}.hm-map-choropleth__highlight{stroke:Highlight;filter:none;forced-color-adjust:none}.hm-map-regions__label{fill:CanvasText;stroke:Canvas;forced-color-adjust:none}.hm-map__tooltip-box,.hm-map__panel,.hm-map__table-toggle{border-color:CanvasText;background:Canvas;color:CanvasText}.hm-map__legend .hm-legend__marker{forced-color-adjust:none;box-shadow:inset 0 0 0 var(--hm-border-hairline) CanvasText}}\n"] }]
|
|
3135
|
+
`, styles: [".hm-map{--hm-map-water: color-mix(in srgb, var(--hm-accent) 16%, var(--hm-surface-raised));--hm-map-land: color-mix(in srgb, var(--hm-text) 5%, var(--hm-surface-raised));--hm-map-land-muted: color-mix(in srgb, var(--hm-map-land) 45%, var(--hm-map-water));--hm-map-border: var(--hm-border);--hm-map-border-weight: var(--hm-border-hairline);--hm-map-region-border: var(--hm-surface-raised);--hm-map-nodata: color-mix(in srgb, var(--hm-text) 14%, var(--hm-surface-raised));--hm-map-label: var(--hm-text);--hm-map-label-halo: var(--hm-surface-raised);--hm-map-bg: var(--hm-map-water);--hm-map-path-color: var(--hm-data-categorical-1);--hm-map-path-weight: var(--hm-border-thin);--hm-map-fill-opacity: .2;--hm-map-marker-size: var(--hm-icon-xl);--hm-map-marker-color: var(--hm-accent);--hm-map-control-size: var(--hm-control-height);--hm-map-gap: var(--hm-space-sm);position:relative;display:block;overflow:hidden;aspect-ratio:16/9;border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius);background:var(--hm-map-bg);color:var(--hm-text);font-family:var(--hm-font-family);font-size:var(--hm-font-size-sm);isolation:isolate;contain:layout paint}.hm-map__viewport{position:absolute;inset:0;overflow:hidden;cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.hm-map__viewport:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-map--dragging,.hm-map--dragging *{cursor:grabbing}.hm-map--static .hm-map__viewport{cursor:default;touch-action:auto}.hm-map__pane{position:absolute;top:0;left:0;will-change:transform}.hm-map__tiles,.hm-map__markers,.hm-map__popups{position:absolute;top:0;left:0}.hm-map__tiles{z-index:1}.hm-map__tile-level{position:absolute;top:0;left:0}.hm-map__tile{position:absolute;top:0;left:0;max-width:none;max-height:none;border:0;padding:0;margin:0;opacity:0;-webkit-user-select:none;user-select:none;pointer-events:none;image-rendering:auto;transition:opacity var(--hm-duration-standard) var(--hm-ease-standard)}.hm-map__tile--loaded{opacity:1}.hm-map__tile--error{visibility:hidden}.hm-map__overlay{position:absolute;top:0;left:0;z-index:2;overflow:visible;pointer-events:none}.hm-map__path{fill:none;stroke:var(--hm-map-path-color);stroke-width:var(--hm-map-path-weight);stroke-linecap:round;stroke-linejoin:round;fill-rule:evenodd}.hm-map__path--area,.hm-map__path--point{fill:var(--hm-map-path-color);fill-opacity:var(--hm-map-fill-opacity)}.hm-map__path--point{fill-opacity:1;stroke:var(--hm-surface-raised)}.hm-map__path--interactive{pointer-events:visiblePainted;cursor:pointer}.hm-map__markers{z-index:3}.hm-map__popups{z-index:4}.hm-map__controls{position:absolute;top:var(--hm-map-gap);left:var(--hm-map-gap);z-index:5;display:flex;flex-direction:column;border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-control);background:var(--hm-surface-overlay);box-shadow:var(--hm-shadow-overlay);overflow:hidden}.hm-map__control{display:inline-flex;align-items:center;justify-content:center;width:var(--hm-map-control-size);height:var(--hm-map-control-size);padding:0;border:0;background:transparent;color:var(--hm-text);font-size:var(--hm-icon-md);cursor:pointer}.hm-map__control+.hm-map__control{border-top:var(--hm-border-hairline) solid var(--hm-border)}.hm-map__control:hover:not(:disabled){background:var(--hm-accent-subtle)}.hm-map__control:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-map__control:disabled{color:var(--hm-disabled-text);cursor:not-allowed}.hm-map__footer{position:absolute;right:0;bottom:0;left:0;z-index:5;display:flex;align-items:flex-end;justify-content:space-between;gap:var(--hm-map-gap);padding:0 0 0 var(--hm-map-gap);pointer-events:none}.hm-map__footer>*{pointer-events:auto}.hm-map__scale{display:flex;flex-direction:column;gap:var(--hm-space-xxxs);margin-bottom:var(--hm-map-gap)}.hm-map__scale-bar{box-sizing:border-box;padding:0 var(--hm-space-xxxs);border:var(--hm-border-thin) solid var(--hm-text);border-top:0;background:color-mix(in srgb,var(--hm-surface-overlay) 80%,transparent);color:var(--hm-text);font-size:var(--hm-font-size-xs);line-height:var(--hm-line-height-snug);white-space:nowrap}.hm-map__attribution{margin-left:auto;max-width:100%;padding:var(--hm-space-xxxs) var(--hm-space-xs);border-top-left-radius:var(--hm-radius-micro);background:color-mix(in srgb,var(--hm-surface-overlay) 85%,transparent);color:var(--hm-text);font-size:var(--hm-font-size-xs);line-height:var(--hm-line-height-snug);overflow-wrap:anywhere}.hm-map__attribution a{color:var(--hm-accent-strong)}.hm-map__attribution a:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-map__sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.hm-map__layers{display:none}.hm-map-cluster{display:contents}.hm-map-marker--clustered{display:none}.hm-map-cluster__group{position:absolute;top:0;left:0;width:0;height:0}.hm-map-cluster__button{position:absolute;display:grid;place-items:center;min-width:var(--hm-control-height);min-height:var(--hm-control-height);padding:0 var(--hm-space-nano);border:var(--hm-border-thin) solid var(--hm-surface-raised);border-radius:var(--hm-radius-pill);background:var(--hm-action);color:var(--hm-on-action);font:inherit;font-size:var(--hm-font-size-sm);font-weight:var(--hm-font-weight-bold);font-variant-numeric:tabular-nums;line-height:1;cursor:pointer;transform:translate(-50%,-50%);box-shadow:0 0 0 var(--hm-space-micro) color-mix(in srgb,var(--hm-action) 28%,transparent)}.hm-map-cluster__button--large{min-width:calc(var(--hm-control-height) * 1.25);min-height:calc(var(--hm-control-height) * 1.25)}.hm-map-cluster__button:hover{box-shadow:0 0 0 var(--hm-space-nano) color-mix(in srgb,var(--hm-action) 34%,transparent)}.hm-map-cluster__button:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-space-micro)}@media(forced-colors:active){.hm-map-cluster__button{border-color:CanvasText;background:Canvas;color:LinkText;box-shadow:none;forced-color-adjust:none}.hm-map-cluster__button:focus-visible{outline-color:Highlight}}.hm-map-marker{position:absolute;top:0;left:0;width:0;height:0}.hm-map-marker__button{position:absolute;left:0;top:0;display:inline-flex;align-items:center;justify-content:center;min-width:var(--hm-map-marker-size);min-height:var(--hm-map-marker-size);padding:0;border:0;border-radius:var(--hm-radius-pill);background:transparent;color:var(--hm-map-marker-color);font-size:var(--hm-map-marker-size);line-height:1;cursor:pointer;transform:translate(-50%,-100%);filter:drop-shadow(0 0 var(--hm-border-hairline) var(--hm-surface-raised))}.hm-map-marker__button:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-map-marker--center .hm-map-marker__button{transform:translate(-50%,-50%)}.hm-map-marker__icon{pointer-events:none}.hm-map-marker--open{z-index:1}.hm-map-popup{position:absolute;top:0;left:0;width:0;height:0;z-index:2}.hm-map-popup--anchored{top:calc(-1 * var(--hm-map-marker-size))}.hm-map-popup__box{--hm-map-popup-tip: var(--hm-space-sm);position:absolute;bottom:var(--hm-map-popup-tip);left:0;box-sizing:border-box;width:max-content;min-width:calc(var(--hm-control-height) * 4);max-width:min(var(--hm-control-height) * 9,80vw);padding:var(--hm-space-sm) var(--hm-space-md);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius);background:var(--hm-surface-overlay);color:var(--hm-text);box-shadow:var(--hm-shadow-overlay);font-size:var(--hm-font-size-sm);line-height:var(--hm-line-height-normal);transform:translate(-50%);cursor:auto;-webkit-user-select:text;user-select:text}.hm-map-popup__box:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-map-popup__box:after{content:\"\";position:absolute;top:100%;left:50%;width:var(--hm-map-popup-tip);height:var(--hm-map-popup-tip);border-right:var(--hm-border-hairline) solid var(--hm-border);border-bottom:var(--hm-border-hairline) solid var(--hm-border);background:var(--hm-surface-overlay);transform:translate(-50%,-50%) rotate(45deg)}.hm-map-popup__close{float:right;display:inline-flex;align-items:center;justify-content:center;width:var(--hm-control-height-dense);height:var(--hm-control-height-dense);margin:calc(-1 * var(--hm-space-xs)) calc(-1 * var(--hm-space-sm)) 0 var(--hm-space-xs);padding:0;border:0;border-radius:var(--hm-radius-control);background:transparent;color:var(--hm-muted);font-size:var(--hm-icon-md);cursor:pointer}.hm-map-popup__close:hover{background:var(--hm-accent-subtle);color:var(--hm-text)}.hm-map-popup__close:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-map-popup__content{overflow-wrap:anywhere}.hm-map__regions{position:absolute;top:0;left:0;z-index:1}.hm-map-regions{position:absolute;top:0;left:0}.hm-map-regions__svg{position:absolute;top:0;left:0;overflow:visible;pointer-events:none}.hm-map-regions__label{fill:var(--hm-map-label);stroke:var(--hm-map-label-halo);stroke-width:calc(var(--hm-border-thin) * 1.5);stroke-linejoin:round;paint-order:stroke;font-family:var(--hm-font-family);font-size:var(--hm-font-size-xs);font-weight:var(--hm-font-weight-semibold);text-anchor:middle;dominant-baseline:central;pointer-events:none}.hm-map-basemap__region{fill:var(--hm-map-land);fill-rule:evenodd;stroke:var(--hm-map-border);stroke-width:var(--hm-map-border-weight);stroke-linejoin:round}.hm-map-basemap--muted .hm-map-basemap__region{fill:var(--hm-map-land-muted)}.hm-map-choropleth__region{fill:var(--hm-map-nodata);fill-rule:evenodd;stroke:var(--hm-map-region-border);stroke-width:var(--hm-map-border-weight);stroke-linejoin:round;pointer-events:visiblePainted;outline:none}.hm-map-choropleth__region--empty{stroke:var(--hm-map-border)}.hm-map-choropleth__highlight{fill:none;stroke:var(--hm-focus-color);stroke-width:var(--hm-border-thin);stroke-linejoin:round;pointer-events:none;filter:drop-shadow(0 0 var(--hm-border-hairline) var(--hm-surface-raised)) drop-shadow(0 0 var(--hm-border-hairline) var(--hm-surface-raised))}.hm-map__tooltip{position:absolute;top:0;left:0;z-index:5;width:0;height:0;pointer-events:none}.hm-map__tooltip-box{position:absolute;bottom:var(--hm-space-xs);left:0;display:flex;flex-direction:column;width:max-content;max-width:calc(var(--hm-control-height) * 8);padding:var(--hm-space-nano) var(--hm-space-xs);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-micro);background:var(--hm-surface-overlay);color:var(--hm-text);box-shadow:var(--hm-shadow-overlay);font-size:var(--hm-font-size-xs);line-height:var(--hm-line-height-snug);transform:translate(-50%)}.hm-map__tooltip-title{font-weight:var(--hm-font-weight-semibold)}.hm-map__tooltip-detail{font-variant-numeric:tabular-nums}.hm-map__panels{position:absolute;top:var(--hm-map-gap);right:var(--hm-map-gap);z-index:5;display:flex;flex-direction:column;gap:var(--hm-space-xs);max-inline-size:min(50%,var(--hm-control-height) * 7);max-block-size:calc(100% - var(--hm-map-gap) * 2 - var(--hm-control-height));overflow:auto}.hm-map__panel{display:flex;flex-direction:column;align-items:flex-start;gap:var(--hm-space-nano);padding:var(--hm-space-nano) var(--hm-space-xs);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-control);background:color-mix(in srgb,var(--hm-surface-overlay) 92%,transparent);color:var(--hm-text);box-shadow:var(--hm-shadow-overlay);cursor:auto}.hm-map__legend .hm-legend{gap:var(--hm-space-micro)}.hm-map__legend .hm-legend__text{font-size:var(--hm-font-size-xs);font-variant-numeric:tabular-nums}.hm-map__legend .hm-legend__marker{inline-size:var(--hm-space-sm);block-size:var(--hm-space-sm);margin-block-start:calc((1lh - var(--hm-space-sm)) / 2);box-shadow:inset 0 0 0 var(--hm-border-hairline) color-mix(in srgb,var(--hm-text) 25%,transparent)}.hm-map__table-toggle{display:inline-flex;align-items:center;min-block-size:var(--hm-control-height);padding:0 var(--hm-space-xs);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-control);background:var(--hm-surface-overlay);color:var(--hm-accent-strong);font:inherit;font-size:var(--hm-font-size-xs);font-weight:var(--hm-font-weight-semibold);cursor:pointer}.hm-map__table-toggle:hover{background:var(--hm-accent-subtle)}.hm-map__table-toggle:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-map__viewport{container-type:inline-size}@container (max-width: 480px){.hm-map__panels{top:var(--hm-space-xs);right:var(--hm-space-xs);gap:var(--hm-space-micro);max-inline-size:45%}.hm-map__panel{gap:var(--hm-space-micro);padding:var(--hm-space-micro) var(--hm-space-xs)}.hm-map__legend .hm-legend{gap:0}.hm-map__legend .hm-legend__text,.hm-map__table-toggle{font-size:var(--hm-font-size-2xs)}.hm-map__legend .hm-legend__marker{inline-size:var(--hm-space-xs);block-size:var(--hm-space-xs);margin-block-start:calc((1lh - var(--hm-space-xs)) / 2)}}.hm-map__table:not(.hm-map__sr-only){position:absolute;inset:0;z-index:6;display:flex;flex-direction:column;background:var(--hm-surface-raised);color:var(--hm-text)}.hm-map__table-bar{display:flex;justify-content:flex-end;padding:var(--hm-space-xs) var(--hm-map-gap);border-bottom:var(--hm-border-hairline) solid var(--hm-divider)}.hm-map__table:not(.hm-map__sr-only) .hm-map__table-scroll{overflow:auto}.hm-map__table-scroll{flex:1 1 auto;min-block-size:0;padding:0 var(--hm-map-gap) var(--hm-map-gap)}.hm-map__table-scroll:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-map__table-scroll table{inline-size:100%}.hm-map__table-scroll caption{padding-block:var(--hm-space-xs);color:var(--hm-muted);font-size:var(--hm-font-size-sm);text-align:start}.hm-map__table-num{text-align:end;font-variant-numeric:tabular-nums}@media(prefers-reduced-motion:reduce){.hm-map__tile{transition:none}}@media(forced-colors:active){.hm-map{border-color:CanvasText}.hm-map__viewport:focus-visible,.hm-map__control:focus-visible,.hm-map__table-toggle:focus-visible,.hm-map__table-scroll:focus-visible,.hm-map-marker__button:focus-visible,.hm-map-popup__box:focus-visible,.hm-map-popup__close:focus-visible{outline-color:Highlight}.hm-map__controls,.hm-map-popup__box,.hm-map__attribution,.hm-map__scale-bar{border:var(--hm-border-hairline) solid CanvasText;background:Canvas;color:CanvasText;forced-color-adjust:none}.hm-map__control{background:ButtonFace;color:ButtonText;forced-color-adjust:none}.hm-map__control:disabled{color:GrayText}.hm-map-marker__button{color:LinkText;forced-color-adjust:none}.hm-map__path{stroke:CanvasText!important;forced-color-adjust:none}.hm-map__path--area,.hm-map__path--point{fill:Highlight!important}.hm-map-basemap__region,.hm-map-basemap--muted .hm-map-basemap__region{fill:Canvas;stroke:CanvasText;forced-color-adjust:none}.hm-map-choropleth__region{stroke:CanvasText;forced-color-adjust:none}.hm-map-choropleth__highlight{stroke:Highlight;filter:none;forced-color-adjust:none}.hm-map-regions__label{fill:CanvasText;stroke:Canvas;forced-color-adjust:none}.hm-map__tooltip-box,.hm-map__panel,.hm-map__table-toggle{border-color:CanvasText;background:Canvas;color:CanvasText}.hm-map__legend .hm-legend__marker{forced-color-adjust:none;box-shadow:inset 0 0 0 var(--hm-border-hairline) CanvasText}}.hm-map{--hm-map-route-color: var(--hm-accent);--hm-map-route-casing: var(--hm-surface-raised);--hm-map-route-alt: var(--hm-muted);--hm-map-route-active: var(--hm-accent-strong);--hm-map-route-weight: calc(var(--hm-border-thin) * 3)}.hm-map-route{position:absolute;top:0;left:0;width:0;height:0}.hm-map-route__start{--hm-map-marker-color: var(--hm-success)}.hm-map-route__end{--hm-map-marker-color: var(--hm-danger)}.hm-map__path.hm-map-route__casing{stroke:var(--hm-map-route-casing);stroke-width:calc(var(--hm-map-route-weight) + var(--hm-border-thin) * 2)}.hm-map__path.hm-map-route__line{stroke:var(--hm-map-route-color);stroke-width:var(--hm-map-route-weight)}.hm-map__path.hm-map-route__alt{stroke:var(--hm-map-route-alt);stroke-width:var(--hm-map-route-weight);stroke-opacity:.6}.hm-map__path.hm-map-route__alt.hm-map__path--interactive:hover{stroke-opacity:.9}.hm-map__path.hm-map-route__active{stroke:var(--hm-map-route-active);stroke-width:calc(var(--hm-map-route-weight) + var(--hm-border-thin))}.hm-map__path.hm-map-route__step-point{fill:var(--hm-map-route-active);stroke:var(--hm-surface-raised);stroke-width:var(--hm-border-thin)}\n"] }]
|
|
2696
3136
|
}], ctorParameters: () => [], propDecorators: { center: [{ type: i0.Input, args: [{ isSignal: true, alias: "center", required: false }] }], zoom: [{ type: i0.Input, args: [{ isSignal: true, alias: "zoom", required: false }] }], minZoom: [{ type: i0.Input, args: [{ isSignal: true, alias: "minZoom", required: false }] }], maxZoom: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxZoom", required: false }] }], maxBounds: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxBounds", required: false }] }], bounds: [{ type: i0.Input, args: [{ isSignal: true, alias: "bounds", required: false }] }], boundsPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "boundsPadding", required: false }] }], tileUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "tileUrl", required: false }] }], subdomains: [{ type: i0.Input, args: [{ isSignal: true, alias: "subdomains", required: false }] }], maxNativeZoom: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxNativeZoom", required: false }] }], attribution: [{ type: i0.Input, args: [{ isSignal: true, alias: "attribution", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], zoomControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "zoomControl", required: false }] }], scale: [{ type: i0.Input, args: [{ isSignal: true, alias: "scale", required: false }] }], scaleUnits: [{ type: i0.Input, args: [{ isSignal: true, alias: "scaleUnits", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], scrollWheelZoom: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollWheelZoom", required: false }] }], viewChange: [{ type: i0.Output, args: ["viewChange"] }], viewportRef: [{ type: i0.ViewChild, args: ['viewport', { isSignal: true }] }], paneRef: [{ type: i0.ViewChild, args: ['pane', { isSignal: true }] }], tilesRef: [{ type: i0.ViewChild, args: ['tiles', { isSignal: true }] }] } });
|
|
2697
3137
|
/** Retângulo ampliado em `fraction` da altura/largura de cada lado, sem passar dos polos do Mercator nem de ±180°. */
|
|
2698
3138
|
function padBounds(b, fraction) {
|
|
@@ -2716,8 +3156,31 @@ const ICON_MAP_MARKER = {
|
|
|
2716
3156
|
solid: true,
|
|
2717
3157
|
categories: ['travel'],
|
|
2718
3158
|
};
|
|
3159
|
+
// Ícones das rotas (manobras) e da moldura de street view, copiados do catálogo `@trismegisto/icons` (mesma regra).
|
|
3160
|
+
const icon = (name, body, solid = false) => ({ name, body, ...(solid ? { solid } : {}) });
|
|
3161
|
+
const ICON_ROUTE_ARROW = icon('arrow', '<path d="M12 19V5M8.1 8.9L12 5l3.9 3.9"/>');
|
|
3162
|
+
const ICON_ROUTE_FLAG = icon('flag', '<path d="M5.5 4.5h12l-2.5 4 2.5 4h-12z"/><path d="M5.5 4.5L5.5 20.5"/>', true);
|
|
3163
|
+
const ICON_ROUTE_UNDO = icon('undo', '<path d="M8.5 5L4.5 9l4 4"/><path d="M4.5 9h9a5.5 5.5 0 0 1 0 11H10"/>');
|
|
3164
|
+
const ICON_ROUTE_REDO = icon('redo', '<path d="M20 9H10a5.5 5.5 0 0 0 0 11h3"/><path d="M16 5.5L19.5 9 16 12.5"/>');
|
|
3165
|
+
const ICON_ROUTE_REFRESH = icon('refresh', '<path d="M18.5 8.25A7.5 7.5 0 1 1 10.06 4.76"/><path d="M7.54 7.86L10.06 4.76L6.32 3.32"/>');
|
|
3166
|
+
const ICON_ROUTE_ARROW_FORWARD = icon('arrow-forward', '<path d="M4 18v-3a6 6 0 0 1 6-6h9M15 4l5 5-5 5"/>');
|
|
3167
|
+
const ICON_ROUTE_BOAT = icon('boat', '<path d="M3 14h18l-2.5 5h-13z"/><path d="M12 3.5V14M12 4.5l6 8h-6M10 7.5l-4 5h4"/>', true);
|
|
3168
|
+
const ICON_STREET_WINDOW_MAX = icon('window-max', '<rect x="3.5" y="3.5" width="17" height="17" rx="2.5"/><path d="M13 11l4-4M13.5 7H17v3.5M11 13l-4 4M10.5 17H7v-3.5"/>');
|
|
3169
|
+
const ICON_STREET_IMAGE = icon('image', '<rect x="3.5" y="4.5" width="17" height="15" rx="2.5"/><circle cx="9" cy="10" r="1.8"/><path d="M3.5 17.5l5.5-5 4 3.5 2.5-2 5 4"/>', true);
|
|
3170
|
+
/** Ícones das manobras (lista de direções). */
|
|
3171
|
+
const ROUTE_ICONS = [
|
|
3172
|
+
ICON_MAP_MARKER,
|
|
3173
|
+
ICON_ROUTE_ARROW,
|
|
3174
|
+
ICON_ROUTE_FLAG,
|
|
3175
|
+
ICON_ROUTE_UNDO,
|
|
3176
|
+
ICON_ROUTE_REFRESH,
|
|
3177
|
+
ICON_ROUTE_ARROW_FORWARD,
|
|
3178
|
+
ICON_ROUTE_BOAT,
|
|
3179
|
+
];
|
|
3180
|
+
/** Ícones da moldura de street view. */
|
|
3181
|
+
const STREET_VIEW_ICONS = [ICON_ROUTE_ARROW, ICON_ROUTE_UNDO, ICON_ROUTE_REDO, ICON_STREET_WINDOW_MAX, ICON_STREET_IMAGE];
|
|
2719
3182
|
|
|
2720
|
-
let nextId$
|
|
3183
|
+
let nextId$5 = 0;
|
|
2721
3184
|
/**
|
|
2722
3185
|
* Balão ancorado num ponto do mapa. Dentro de um `<hm-map-marker>` ancora no marcador e abre/fecha com
|
|
2723
3186
|
* ele; solto no `<hm-map>`, ancora em `position`. É um diálogo não modal: ao abrir pela pessoa, recebe
|
|
@@ -2737,7 +3200,7 @@ class MapPopupComponent {
|
|
|
2737
3200
|
/** Nome acessível do diálogo. Padrão: "Detalhes do local". */
|
|
2738
3201
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
2739
3202
|
closeButton = input(true, { ...(ngDevMode ? { debugName: "closeButton" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2740
|
-
boxId = `hm-map-popup-${++nextId$
|
|
3203
|
+
boxId = `hm-map-popup-${++nextId$5}`;
|
|
2741
3204
|
anchored = !!this.marker;
|
|
2742
3205
|
constructor() {
|
|
2743
3206
|
// Aberto por qualquer caminho (input, marcador, `show`): o mapa se move para o balão caber na tela.
|
|
@@ -2846,7 +3309,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImpo
|
|
|
2846
3309
|
}]
|
|
2847
3310
|
}], ctorParameters: () => [], propDecorators: { position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], closeButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeButton", required: false }] }] } });
|
|
2848
3311
|
|
|
2849
|
-
let nextId$
|
|
3312
|
+
let nextId$4 = 0;
|
|
2850
3313
|
/**
|
|
2851
3314
|
* Marcador num ponto do mapa: um botão focável com nome acessível (`label`). O desenho padrão é o ícone
|
|
2852
3315
|
* `map-marker`; conteúdo projetado substitui o desenho (um `hm-icon` com outro `shape`, um avatar...).
|
|
@@ -2867,7 +3330,9 @@ class MapMarkerComponent {
|
|
|
2867
3330
|
color = input('', ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
2868
3331
|
markerClick = output();
|
|
2869
3332
|
popup = contentChild(MapPopupComponent, ...(ngDevMode ? [{ debugName: "popup" }] : /* istanbul ignore next */ []));
|
|
2870
|
-
buttonId = `hm-map-marker-${++nextId$
|
|
3333
|
+
buttonId = `hm-map-marker-${++nextId$4}`;
|
|
3334
|
+
/** Escondido dentro de um grupo do `hm-map-cluster` (quem liga e desliga é o grupo). */
|
|
3335
|
+
clustered = signal(false, ...(ngDevMode ? [{ debugName: "clustered" }] : /* istanbul ignore next */ []));
|
|
2871
3336
|
transform = computed(() => {
|
|
2872
3337
|
const p = this.map.layerPoint(toLatLng(this.position()));
|
|
2873
3338
|
return `translate3d(${p.x}px, ${p.y}px, 0)`;
|
|
@@ -2883,7 +3348,7 @@ class MapMarkerComponent {
|
|
|
2883
3348
|
this.host.nativeElement.querySelector('.hm-map-marker__button')?.focus();
|
|
2884
3349
|
}
|
|
2885
3350
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: MapMarkerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2886
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.24", type: MapMarkerComponent, isStandalone: true, selector: "hm-map-marker", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, anchor: { classPropertyName: "anchor", publicName: "anchor", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { markerClick: "markerClick" }, host: { properties: { "class.hm-map-marker--center": "anchor() === 'center'", "class.hm-map-marker--open": "popup()?.open()", "style.transform": "transform()", "style.--hm-map-marker-color": "color() || null" }, classAttribute: "hm-map-marker" }, providers: [{ provide: HM_MAP_MARKER, useExisting: MapMarkerComponent }], queries: [{ propertyName: "popup", first: true, predicate: MapPopupComponent, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
3351
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.24", type: MapMarkerComponent, isStandalone: true, selector: "hm-map-marker", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, anchor: { classPropertyName: "anchor", publicName: "anchor", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { markerClick: "markerClick" }, host: { properties: { "class.hm-map-marker--center": "anchor() === 'center'", "class.hm-map-marker--open": "popup()?.open()", "style.transform": "transform()", "style.--hm-map-marker-color": "color() || null", "class.hm-map-marker--clustered": "clustered()", "attr.hidden": "clustered() || null" }, classAttribute: "hm-map-marker" }, providers: [{ provide: HM_MAP_MARKER, useExisting: MapMarkerComponent }], queries: [{ propertyName: "popup", first: true, predicate: MapPopupComponent, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
2887
3352
|
<button
|
|
2888
3353
|
type="button"
|
|
2889
3354
|
class="hm-map-marker__button"
|
|
@@ -2912,6 +3377,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImpo
|
|
|
2912
3377
|
'[class.hm-map-marker--open]': 'popup()?.open()',
|
|
2913
3378
|
'[style.transform]': 'transform()',
|
|
2914
3379
|
'[style.--hm-map-marker-color]': 'color() || null',
|
|
3380
|
+
'[class.hm-map-marker--clustered]': 'clustered()',
|
|
3381
|
+
'[attr.hidden]': 'clustered() || null',
|
|
2915
3382
|
},
|
|
2916
3383
|
template: `
|
|
2917
3384
|
<button
|
|
@@ -2930,11 +3397,154 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImpo
|
|
|
2930
3397
|
}]
|
|
2931
3398
|
}], propDecorators: { position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], anchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "anchor", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], markerClick: [{ type: i0.Output, args: ["markerClick"] }], popup: [{ type: i0.ContentChild, args: [i0.forwardRef(() => MapPopupComponent), { isSignal: true }] }] } });
|
|
2932
3399
|
|
|
2933
|
-
|
|
3400
|
+
/**
|
|
3401
|
+
* Agrupa os `<hm-map-marker>` filhos que ficam próximos na tela (opt-in: só os marcadores dentro dele).
|
|
3402
|
+
* Cada grupo vira um botão com a contagem; acionar (clique, Enter ou Espaço) aproxima até o grupo se
|
|
3403
|
+
* separar; no zoom máximo, mostra os marcadores do grupo. Os grupos se refazem a cada zoom.
|
|
3404
|
+
*/
|
|
3405
|
+
class MapClusterComponent {
|
|
3406
|
+
map = inject(HM_MAP);
|
|
3407
|
+
host = inject(ElementRef);
|
|
3408
|
+
text = inject(MAPS_MESSAGES);
|
|
3409
|
+
/** Distância (px na tela) até a qual marcadores entram no mesmo grupo. */
|
|
3410
|
+
radius = input(56, { ...(ngDevMode ? { debugName: "radius" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
3411
|
+
/** Desliga o agrupamento (os marcadores aparecem todos), sem tirar o componente. */
|
|
3412
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3413
|
+
/** A partir deste zoom não agrupa mais; padrão: agrupa até o zoom máximo. */
|
|
3414
|
+
disableAtZoom = input(null, ...(ngDevMode ? [{ debugName: "disableAtZoom" }] : /* istanbul ignore next */ []));
|
|
3415
|
+
/** Emite ao acionar um grupo (antes de aproximar ou expandir). */
|
|
3416
|
+
clusterClick = output();
|
|
3417
|
+
markers = contentChildren(MapMarkerComponent, ...(ngDevMode ? [{ debugName: "markers" }] : /* istanbul ignore next */ []));
|
|
3418
|
+
/** Grupos abertos no zoom máximo (chave = ids dos marcadores); fecham quando o zoom muda. */
|
|
3419
|
+
expanded = signal(new Set(), ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
3420
|
+
expandedAtZoom = null;
|
|
3421
|
+
groups = computed(() => {
|
|
3422
|
+
const markers = this.markers();
|
|
3423
|
+
const frame = this.map.frame();
|
|
3424
|
+
const stop = this.disableAtZoom();
|
|
3425
|
+
if (this.disabled() || !this.map.ready() || (stop !== null && frame.zoom >= stop))
|
|
3426
|
+
return [];
|
|
3427
|
+
const points = markers.map((m) => this.map.layerPoint(toLatLng(m.position())));
|
|
3428
|
+
const atMax = frame.zoom >= this.map.zoomRange().maxZoom;
|
|
3429
|
+
const expanded = this.expanded();
|
|
3430
|
+
return clusterPoints(points, this.radius())
|
|
3431
|
+
.filter((c) => c.indices.length > 1)
|
|
3432
|
+
.map((c) => {
|
|
3433
|
+
const members = c.indices.map((i) => markers[i]);
|
|
3434
|
+
const key = members.map((m) => m.buttonId).join('|');
|
|
3435
|
+
return { key, markers: members, x: c.x, y: c.y, count: members.length, atMax };
|
|
3436
|
+
})
|
|
3437
|
+
.filter((g) => !expanded.has(g.key));
|
|
3438
|
+
}, ...(ngDevMode ? [{ debugName: "groups" }] : /* istanbul ignore next */ []));
|
|
3439
|
+
constructor() {
|
|
3440
|
+
// Esconde os marcadores que estão dentro de um grupo; mostra os demais.
|
|
3441
|
+
effect(() => {
|
|
3442
|
+
const hidden = new Set(this.groups().flatMap((g) => g.markers));
|
|
3443
|
+
const markers = this.markers();
|
|
3444
|
+
untracked(() => markers.forEach((m) => m.clustered.set(hidden.has(m))));
|
|
3445
|
+
});
|
|
3446
|
+
// Grupos abertos valem só para o zoom em que foram abertos.
|
|
3447
|
+
effect(() => {
|
|
3448
|
+
const zoom = this.map.frame().zoom;
|
|
3449
|
+
untracked(() => {
|
|
3450
|
+
if (this.expandedAtZoom !== null && zoom !== this.expandedAtZoom) {
|
|
3451
|
+
this.expandedAtZoom = null;
|
|
3452
|
+
this.expanded.set(new Set());
|
|
3453
|
+
}
|
|
3454
|
+
});
|
|
3455
|
+
});
|
|
3456
|
+
}
|
|
3457
|
+
labelFor(group) {
|
|
3458
|
+
return formatMessage(group.atMax ? this.text.cluster.expand : this.text.cluster.zoom, { count: group.count });
|
|
3459
|
+
}
|
|
3460
|
+
activate(group) {
|
|
3461
|
+
const positions = group.markers.map((m) => toLatLng(m.position()));
|
|
3462
|
+
this.clusterClick.emit({ markers: group.markers, positions });
|
|
3463
|
+
if (group.atMax) {
|
|
3464
|
+
// Sem como aproximar mais: abre o grupo e leva o foco ao primeiro marcador dele.
|
|
3465
|
+
this.expandedAtZoom = this.map.frame().zoom;
|
|
3466
|
+
this.expanded.set(new Set([...this.expanded(), group.key]));
|
|
3467
|
+
queueMicrotask(() => group.markers[0]?.focus());
|
|
3468
|
+
return;
|
|
3469
|
+
}
|
|
3470
|
+
const before = this.map.frame().zoom;
|
|
3471
|
+
const bounds = boundsOf(positions);
|
|
3472
|
+
if (bounds)
|
|
3473
|
+
this.map.fitBounds(bounds, this.radius());
|
|
3474
|
+
// Área pequena demais para enquadrar (ou vista sem tamanho): aproxima dois níveis no centro do grupo.
|
|
3475
|
+
if (this.map.frame().zoom <= before && bounds) {
|
|
3476
|
+
const center = { lat: (bounds.south + bounds.north) / 2, lng: (bounds.west + bounds.east) / 2 };
|
|
3477
|
+
this.map.setView(center, Math.min(this.map.zoomRange().maxZoom, before + 2));
|
|
3478
|
+
}
|
|
3479
|
+
this.refocus(group.markers[0]);
|
|
3480
|
+
}
|
|
3481
|
+
/**
|
|
3482
|
+
* O botão acionado some ao aproximar (os grupos se refazem): o foco vai para o grupo que ainda
|
|
3483
|
+
* contém o primeiro marcador ou, se ele ficou sozinho, para o próprio marcador.
|
|
3484
|
+
*/
|
|
3485
|
+
refocus(marker) {
|
|
3486
|
+
if (!marker)
|
|
3487
|
+
return;
|
|
3488
|
+
setTimeout(() => {
|
|
3489
|
+
const buttons = this.host.nativeElement.querySelectorAll('[data-hm-cluster-members]');
|
|
3490
|
+
const holder = [...buttons].find((b) => (b.dataset['hmClusterMembers'] ?? '').split('|').includes(marker.buttonId));
|
|
3491
|
+
if (holder)
|
|
3492
|
+
holder.focus();
|
|
3493
|
+
else
|
|
3494
|
+
marker.focus();
|
|
3495
|
+
});
|
|
3496
|
+
}
|
|
3497
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: MapClusterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3498
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: MapClusterComponent, isStandalone: true, selector: "hm-map-cluster", inputs: { radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, disableAtZoom: { classPropertyName: "disableAtZoom", publicName: "disableAtZoom", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clusterClick: "clusterClick" }, host: { classAttribute: "hm-map-cluster" }, queries: [{ propertyName: "markers", predicate: MapMarkerComponent, isSignal: true }], ngImport: i0, template: `
|
|
3499
|
+
<ng-content select="hm-map-marker" />
|
|
3500
|
+
@for (group of groups(); track group.key) {
|
|
3501
|
+
<div class="hm-map-cluster__group" [style.transform]="'translate3d(' + group.x + 'px, ' + group.y + 'px, 0)'">
|
|
3502
|
+
<button
|
|
3503
|
+
type="button"
|
|
3504
|
+
class="hm-map-cluster__button"
|
|
3505
|
+
[class.hm-map-cluster__button--large]="group.count >= 10"
|
|
3506
|
+
[attr.aria-label]="labelFor(group)"
|
|
3507
|
+
[attr.data-hm-cluster-members]="group.key"
|
|
3508
|
+
(click)="activate(group)"
|
|
3509
|
+
>
|
|
3510
|
+
<span aria-hidden="true">{{ group.count }}</span>
|
|
3511
|
+
</button>
|
|
3512
|
+
</div>
|
|
3513
|
+
}
|
|
3514
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
3515
|
+
}
|
|
3516
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: MapClusterComponent, decorators: [{
|
|
3517
|
+
type: Component,
|
|
3518
|
+
args: [{
|
|
3519
|
+
selector: 'hm-map-cluster',
|
|
3520
|
+
encapsulation: ViewEncapsulation.None,
|
|
3521
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3522
|
+
host: { class: 'hm-map-cluster' },
|
|
3523
|
+
template: `
|
|
3524
|
+
<ng-content select="hm-map-marker" />
|
|
3525
|
+
@for (group of groups(); track group.key) {
|
|
3526
|
+
<div class="hm-map-cluster__group" [style.transform]="'translate3d(' + group.x + 'px, ' + group.y + 'px, 0)'">
|
|
3527
|
+
<button
|
|
3528
|
+
type="button"
|
|
3529
|
+
class="hm-map-cluster__button"
|
|
3530
|
+
[class.hm-map-cluster__button--large]="group.count >= 10"
|
|
3531
|
+
[attr.aria-label]="labelFor(group)"
|
|
3532
|
+
[attr.data-hm-cluster-members]="group.key"
|
|
3533
|
+
(click)="activate(group)"
|
|
3534
|
+
>
|
|
3535
|
+
<span aria-hidden="true">{{ group.count }}</span>
|
|
3536
|
+
</button>
|
|
3537
|
+
</div>
|
|
3538
|
+
}
|
|
3539
|
+
`,
|
|
3540
|
+
}]
|
|
3541
|
+
}], ctorParameters: () => [], propDecorators: { radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], disableAtZoom: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableAtZoom", required: false }] }], clusterClick: [{ type: i0.Output, args: ["clusterClick"] }], markers: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => MapMarkerComponent), { isSignal: true }] }] } });
|
|
3542
|
+
|
|
3543
|
+
let nextId$3 = 0;
|
|
2934
3544
|
/** Base das formas vetoriais: inputs de estilo e registro dos caminhos no SVG do `hm-map`. */
|
|
2935
3545
|
class MapPathBase {
|
|
2936
3546
|
map = inject(HM_MAP);
|
|
2937
|
-
id = `hm-map-path-${++nextId$
|
|
3547
|
+
id = `hm-map-path-${++nextId$3}`;
|
|
2938
3548
|
/** Cor do traço (qualquer valor CSS). Padrão: `--hm-data-categorical-1`. */
|
|
2939
3549
|
color = input(undefined, ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
2940
3550
|
/** Série da paleta de dados (1–8), usada quando `color` não vem. */
|
|
@@ -3172,6 +3782,575 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImpo
|
|
|
3172
3782
|
}]
|
|
3173
3783
|
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], colorProperty: [{ type: i0.Input, args: [{ isSignal: true, alias: "colorProperty", required: false }] }], featureStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "featureStyle", required: false }] }], fillColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillColor", required: false }] }], fillOpacity: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillOpacity", required: false }] }], pointRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "pointRadius", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], featureClick: [{ type: i0.Output, args: ["featureClick"] }] } });
|
|
3174
3784
|
|
|
3785
|
+
let nextId$2 = 0;
|
|
3786
|
+
/** Raio, em px, do ponto que marca o passo ativo na linha. */
|
|
3787
|
+
const ACTIVE_POINT_RADIUS = 6;
|
|
3788
|
+
/**
|
|
3789
|
+
* Camada de rota dentro do `hm-map`: a linha da rota escolhida (com contorno, para ler sobre qualquer
|
|
3790
|
+
* fundo), as alternativas mais apagadas por baixo, marcadores de partida e chegada com nome acessível e o
|
|
3791
|
+
* destaque do trecho do passo ativo (`activeStep`). Clicar numa alternativa emite `(routeSelect)` com o
|
|
3792
|
+
* `id` dela — o app troca a rota escolhida; quem usa teclado escolhe pela lista do `hm-route-directions`,
|
|
3793
|
+
* que é o equivalente acessível da linha (o SVG é decorativo).
|
|
3794
|
+
*
|
|
3795
|
+
* Não calcula rota: recebe a rota pronta (`MapRoute`) do serviço que o app usar. Para enquadrar, passe
|
|
3796
|
+
* `routeBounds(route)` ao `[bounds]` do `hm-map`.
|
|
3797
|
+
*
|
|
3798
|
+
* ```html
|
|
3799
|
+
* <hm-map label="Rota até o escritório" [bounds]="bounds" [boundsPadding]="32">
|
|
3800
|
+
* <hm-map-route [route]="route" [alternatives]="others" [activeStep]="step()" (routeSelect)="choose($event)" />
|
|
3801
|
+
* </hm-map>
|
|
3802
|
+
* ```
|
|
3803
|
+
*/
|
|
3804
|
+
class MapRouteComponent {
|
|
3805
|
+
#icons = registerIcons(ROUTE_ICONS);
|
|
3806
|
+
text = inject(MAPS_MESSAGES);
|
|
3807
|
+
map = inject(HM_MAP);
|
|
3808
|
+
id = `hm-map-route-${++nextId$2}`;
|
|
3809
|
+
/** Rota escolhida. */
|
|
3810
|
+
route = input.required(...(ngDevMode ? [{ debugName: "route" }] : /* istanbul ignore next */ []));
|
|
3811
|
+
/** Outras rotas possíveis, desenhadas por baixo e mais apagadas. */
|
|
3812
|
+
alternatives = input([], ...(ngDevMode ? [{ debugName: "alternatives" }] : /* istanbul ignore next */ []));
|
|
3813
|
+
/** Passo destacado (índice em `route.steps`); `-1` = nenhum. O mapa se move para mostrá-lo. */
|
|
3814
|
+
activeStep = input(-1, ...(ngDevMode ? [{ debugName: "activeStep" }] : /* istanbul ignore next */ []));
|
|
3815
|
+
/** Nome do lugar de partida ("Av. Paulista, 1000"), para o marcador. */
|
|
3816
|
+
startLabel = input('', ...(ngDevMode ? [{ debugName: "startLabel" }] : /* istanbul ignore next */ []));
|
|
3817
|
+
/** Nome do lugar de chegada, para o marcador. */
|
|
3818
|
+
endLabel = input('', ...(ngDevMode ? [{ debugName: "endLabel" }] : /* istanbul ignore next */ []));
|
|
3819
|
+
/** Marcadores de partida e chegada. */
|
|
3820
|
+
markers = input(true, { ...(ngDevMode ? { debugName: "markers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3821
|
+
/** Clique numa alternativa: `id` da rota. */
|
|
3822
|
+
routeSelect = output();
|
|
3823
|
+
startPoint = computed(() => {
|
|
3824
|
+
const points = this.route().points;
|
|
3825
|
+
return points.length ? toLatLng(points[0]) : null;
|
|
3826
|
+
}, ...(ngDevMode ? [{ debugName: "startPoint" }] : /* istanbul ignore next */ []));
|
|
3827
|
+
endPoint = computed(() => {
|
|
3828
|
+
const points = this.route().points;
|
|
3829
|
+
return points.length > 1 ? toLatLng(points[points.length - 1]) : null;
|
|
3830
|
+
}, ...(ngDevMode ? [{ debugName: "endPoint" }] : /* istanbul ignore next */ []));
|
|
3831
|
+
startName = computed(() => this.startLabel() ? formatMessage(this.text.route.startAt, { label: this.startLabel() }) : this.text.route.start, ...(ngDevMode ? [{ debugName: "startName" }] : /* istanbul ignore next */ []));
|
|
3832
|
+
endName = computed(() => this.endLabel() ? formatMessage(this.text.route.endAt, { label: this.endLabel() }) : this.text.route.end, ...(ngDevMode ? [{ debugName: "endName" }] : /* istanbul ignore next */ []));
|
|
3833
|
+
items = computed(() => {
|
|
3834
|
+
const frame = this.map.frame();
|
|
3835
|
+
const tile = this.map.tileSize;
|
|
3836
|
+
const line = (key, points, className, onClick) => {
|
|
3837
|
+
const d = linesPath([points], frame, false, tile);
|
|
3838
|
+
return d ? { key, d, kind: 'line', ...resolvePathStyle({ className }, 'line'), onClick } : null;
|
|
3839
|
+
};
|
|
3840
|
+
const out = [];
|
|
3841
|
+
for (const alt of this.alternatives()) {
|
|
3842
|
+
const points = alt.points.map(toLatLng);
|
|
3843
|
+
out.push(line(`${this.id}-alt-${alt.id}`, points, 'hm-map-route__alt', () => this.routeSelect.emit(alt.id)));
|
|
3844
|
+
}
|
|
3845
|
+
const route = this.route();
|
|
3846
|
+
const points = route.points.map(toLatLng);
|
|
3847
|
+
out.push(line(`${this.id}-casing`, points, 'hm-map-route__casing'));
|
|
3848
|
+
out.push(line(`${this.id}-line`, points, 'hm-map-route__line'));
|
|
3849
|
+
const step = this.activeStep();
|
|
3850
|
+
if (step >= 0) {
|
|
3851
|
+
out.push(line(`${this.id}-active`, routeStepSegment(route, step), 'hm-map-route__active'));
|
|
3852
|
+
const location = routeStepLocation(route, step);
|
|
3853
|
+
if (location) {
|
|
3854
|
+
const p = this.map.layerPoint(location);
|
|
3855
|
+
out.push({
|
|
3856
|
+
key: `${this.id}-active-point`,
|
|
3857
|
+
d: circlePathPx(p, ACTIVE_POINT_RADIUS),
|
|
3858
|
+
kind: 'point',
|
|
3859
|
+
...resolvePathStyle({ className: 'hm-map-route__step-point' }, 'point'),
|
|
3860
|
+
});
|
|
3861
|
+
}
|
|
3862
|
+
}
|
|
3863
|
+
return out.filter((item) => !!item);
|
|
3864
|
+
}, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
3865
|
+
constructor() {
|
|
3866
|
+
inject(DestroyRef).onDestroy(this.map.registerPaths(this.items));
|
|
3867
|
+
// Passo ativo novo: leva o local dele para dentro da área visível.
|
|
3868
|
+
effect(() => {
|
|
3869
|
+
const step = this.activeStep();
|
|
3870
|
+
const route = this.route();
|
|
3871
|
+
if (!this.map.ready() || step < 0)
|
|
3872
|
+
return;
|
|
3873
|
+
const location = routeStepLocation(route, step);
|
|
3874
|
+
if (location)
|
|
3875
|
+
untracked(() => this.map.revealLayerPoint(this.map.layerPoint(location)));
|
|
3876
|
+
});
|
|
3877
|
+
}
|
|
3878
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: MapRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3879
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: MapRouteComponent, isStandalone: true, selector: "hm-map-route", inputs: { route: { classPropertyName: "route", publicName: "route", isSignal: true, isRequired: true, transformFunction: null }, alternatives: { classPropertyName: "alternatives", publicName: "alternatives", isSignal: true, isRequired: false, transformFunction: null }, activeStep: { classPropertyName: "activeStep", publicName: "activeStep", isSignal: true, isRequired: false, transformFunction: null }, startLabel: { classPropertyName: "startLabel", publicName: "startLabel", isSignal: true, isRequired: false, transformFunction: null }, endLabel: { classPropertyName: "endLabel", publicName: "endLabel", isSignal: true, isRequired: false, transformFunction: null }, markers: { classPropertyName: "markers", publicName: "markers", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { routeSelect: "routeSelect" }, host: { classAttribute: "hm-map-route" }, ngImport: i0, template: `
|
|
3880
|
+
@if (markers()) {
|
|
3881
|
+
@if (startPoint(); as p) {
|
|
3882
|
+
<hm-map-marker class="hm-map-route__start" [position]="p" [label]="startName()" />
|
|
3883
|
+
}
|
|
3884
|
+
@if (endPoint(); as p) {
|
|
3885
|
+
<hm-map-marker class="hm-map-route__end" [position]="p" [label]="endName()">
|
|
3886
|
+
<hm-icon class="hm-map-marker__icon" shape="flag" solid />
|
|
3887
|
+
</hm-map-marker>
|
|
3888
|
+
}
|
|
3889
|
+
}
|
|
3890
|
+
`, isInline: true, dependencies: [{ kind: "component", type: MapMarkerComponent, selector: "hm-map-marker", inputs: ["position", "label", "anchor", "color"], outputs: ["markerClick"] }, { kind: "component", type: IconComponent, selector: "hm-icon", inputs: ["shape", "direction", "size", "solid", "badge", "status", "flip", "inverse", "label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
3891
|
+
}
|
|
3892
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: MapRouteComponent, decorators: [{
|
|
3893
|
+
type: Component,
|
|
3894
|
+
args: [{
|
|
3895
|
+
selector: 'hm-map-route',
|
|
3896
|
+
imports: [MapMarkerComponent, IconComponent],
|
|
3897
|
+
encapsulation: ViewEncapsulation.None,
|
|
3898
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3899
|
+
host: { class: 'hm-map-route' },
|
|
3900
|
+
template: `
|
|
3901
|
+
@if (markers()) {
|
|
3902
|
+
@if (startPoint(); as p) {
|
|
3903
|
+
<hm-map-marker class="hm-map-route__start" [position]="p" [label]="startName()" />
|
|
3904
|
+
}
|
|
3905
|
+
@if (endPoint(); as p) {
|
|
3906
|
+
<hm-map-marker class="hm-map-route__end" [position]="p" [label]="endName()">
|
|
3907
|
+
<hm-icon class="hm-map-marker__icon" shape="flag" solid />
|
|
3908
|
+
</hm-map-marker>
|
|
3909
|
+
}
|
|
3910
|
+
}
|
|
3911
|
+
`,
|
|
3912
|
+
}]
|
|
3913
|
+
}], ctorParameters: () => [], propDecorators: { route: [{ type: i0.Input, args: [{ isSignal: true, alias: "route", required: true }] }], alternatives: [{ type: i0.Input, args: [{ isSignal: true, alias: "alternatives", required: false }] }], activeStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeStep", required: false }] }], startLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "startLabel", required: false }] }], endLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "endLabel", required: false }] }], markers: [{ type: i0.Input, args: [{ isSignal: true, alias: "markers", required: false }] }], routeSelect: [{ type: i0.Output, args: ["routeSelect"] }] } });
|
|
3914
|
+
/**
|
|
3915
|
+
* Lista de direções de uma rota: totais no topo, rotas alternativas como opções (botões com
|
|
3916
|
+
* `aria-pressed`) e os passos numa lista ordenada (`<ol>`), cada um com o ícone da manobra (decorativo),
|
|
3917
|
+
* a instrução e a distância. `[(activeStep)]` liga a lista ao `hm-map-route`: focar ou clicar num passo o
|
|
3918
|
+
* torna ativo, e o mapa vai até ele. Setas para cima/baixo, Home e End percorrem os passos.
|
|
3919
|
+
*
|
|
3920
|
+
* ```html
|
|
3921
|
+
* <hm-route-directions [route]="route" [alternatives]="others" [(activeStep)]="step" (routeSelect)="choose($event)" />
|
|
3922
|
+
* ```
|
|
3923
|
+
*/
|
|
3924
|
+
class RouteDirectionsComponent {
|
|
3925
|
+
#icons = registerIcons(ROUTE_ICONS);
|
|
3926
|
+
text = inject(MAPS_MESSAGES);
|
|
3927
|
+
i18n = inject(HermesI18nService);
|
|
3928
|
+
host = inject(ElementRef);
|
|
3929
|
+
uid = `hm-route-directions-${++nextId$2}`;
|
|
3930
|
+
titleId = `${this.uid}-title`;
|
|
3931
|
+
helpId = `${this.uid}-help`;
|
|
3932
|
+
route = input.required(...(ngDevMode ? [{ debugName: "route" }] : /* istanbul ignore next */ []));
|
|
3933
|
+
alternatives = input([], ...(ngDevMode ? [{ debugName: "alternatives" }] : /* istanbul ignore next */ []));
|
|
3934
|
+
/** Passo ativo (`-1` = nenhum). */
|
|
3935
|
+
activeStep = model(-1, ...(ngDevMode ? [{ debugName: "activeStep" }] : /* istanbul ignore next */ []));
|
|
3936
|
+
/** Sistema de unidades das distâncias. */
|
|
3937
|
+
units = input('metric', ...(ngDevMode ? [{ debugName: "units" }] : /* istanbul ignore next */ []));
|
|
3938
|
+
/** Título da lista. Padrão: o `label` da rota ou "Direções". */
|
|
3939
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
3940
|
+
/** Escolha de outra rota: `id` dela. */
|
|
3941
|
+
routeSelect = output();
|
|
3942
|
+
distance(meters) {
|
|
3943
|
+
return formatRouteDistance(meters, this.i18n.locale(), this.units());
|
|
3944
|
+
}
|
|
3945
|
+
totalsText = computed(() => {
|
|
3946
|
+
const totals = routeTotals(this.route());
|
|
3947
|
+
return formatMessage(this.text.route.totals, {
|
|
3948
|
+
distance: this.distance(totals.distance),
|
|
3949
|
+
duration: formatRouteDuration(totals.duration, this.i18n.locale()),
|
|
3950
|
+
});
|
|
3951
|
+
}, ...(ngDevMode ? [{ debugName: "totalsText" }] : /* istanbul ignore next */ []));
|
|
3952
|
+
options = computed(() => {
|
|
3953
|
+
const all = [this.route(), ...this.alternatives()];
|
|
3954
|
+
return all.map((route, index) => {
|
|
3955
|
+
const totals = routeTotals(route);
|
|
3956
|
+
const label = route.label || formatMessage(this.text.route.routeN, { n: index + 1 });
|
|
3957
|
+
const distance = this.distance(totals.distance);
|
|
3958
|
+
const duration = formatRouteDuration(totals.duration, this.i18n.locale());
|
|
3959
|
+
return { id: route.id, label, distance, duration, name: formatMessage(this.text.route.option, { label, distance, duration }), selected: index === 0 };
|
|
3960
|
+
});
|
|
3961
|
+
}, ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
3962
|
+
steps = computed(() => this.route().steps.map((step) => {
|
|
3963
|
+
const icon = maneuverIcon(step.maneuver);
|
|
3964
|
+
return {
|
|
3965
|
+
instruction: step.instruction,
|
|
3966
|
+
icon: icon.icon,
|
|
3967
|
+
solid: icon.icon === 'map-marker' || icon.icon === 'flag',
|
|
3968
|
+
rotation: icon.rotation,
|
|
3969
|
+
distance: step.distance > 0 ? this.distance(step.distance) : '',
|
|
3970
|
+
};
|
|
3971
|
+
}), ...(ngDevMode ? [{ debugName: "steps" }] : /* istanbul ignore next */ []));
|
|
3972
|
+
select(index) {
|
|
3973
|
+
if (this.activeStep() !== index)
|
|
3974
|
+
this.activeStep.set(index);
|
|
3975
|
+
}
|
|
3976
|
+
chooseRoute(option) {
|
|
3977
|
+
if (!option.selected)
|
|
3978
|
+
this.routeSelect.emit(option.id);
|
|
3979
|
+
}
|
|
3980
|
+
onKeydown(event) {
|
|
3981
|
+
const total = this.steps().length;
|
|
3982
|
+
if (!total)
|
|
3983
|
+
return;
|
|
3984
|
+
const current = Math.max(0, this.activeStep());
|
|
3985
|
+
let next;
|
|
3986
|
+
switch (event.key) {
|
|
3987
|
+
case 'ArrowDown':
|
|
3988
|
+
next = Math.min(total - 1, current + 1);
|
|
3989
|
+
break;
|
|
3990
|
+
case 'ArrowUp':
|
|
3991
|
+
next = Math.max(0, current - 1);
|
|
3992
|
+
break;
|
|
3993
|
+
case 'Home':
|
|
3994
|
+
next = 0;
|
|
3995
|
+
break;
|
|
3996
|
+
case 'End':
|
|
3997
|
+
next = total - 1;
|
|
3998
|
+
break;
|
|
3999
|
+
default:
|
|
4000
|
+
return;
|
|
4001
|
+
}
|
|
4002
|
+
event.preventDefault();
|
|
4003
|
+
this.host.nativeElement.querySelectorAll('.hm-route-directions__step')[next]?.focus();
|
|
4004
|
+
this.select(next);
|
|
4005
|
+
}
|
|
4006
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: RouteDirectionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4007
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: RouteDirectionsComponent, isStandalone: true, selector: "hm-route-directions", inputs: { route: { classPropertyName: "route", publicName: "route", isSignal: true, isRequired: true, transformFunction: null }, alternatives: { classPropertyName: "alternatives", publicName: "alternatives", isSignal: true, isRequired: false, transformFunction: null }, activeStep: { classPropertyName: "activeStep", publicName: "activeStep", isSignal: true, isRequired: false, transformFunction: null }, units: { classPropertyName: "units", publicName: "units", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeStep: "activeStepChange", routeSelect: "routeSelect" }, host: { classAttribute: "hm-route-directions" }, ngImport: i0, template: `
|
|
4008
|
+
<div class="hm-route-directions__header">
|
|
4009
|
+
<p class="hm-route-directions__title" [id]="titleId">{{ label() || route().label || text.route.directions }}</p>
|
|
4010
|
+
<p class="hm-route-directions__totals">{{ totalsText() }}</p>
|
|
4011
|
+
</div>
|
|
4012
|
+
|
|
4013
|
+
@if (options().length > 1) {
|
|
4014
|
+
<div class="hm-route-directions__options" role="group" [attr.aria-label]="text.route.alternatives">
|
|
4015
|
+
@for (option of options(); track option.id) {
|
|
4016
|
+
<button
|
|
4017
|
+
type="button"
|
|
4018
|
+
class="hm-route-directions__option"
|
|
4019
|
+
[class.hm-route-directions__option--selected]="option.selected"
|
|
4020
|
+
[attr.aria-pressed]="option.selected"
|
|
4021
|
+
[attr.aria-label]="option.name"
|
|
4022
|
+
(click)="chooseRoute(option)"
|
|
4023
|
+
>
|
|
4024
|
+
<span class="hm-route-directions__option-label">{{ option.label }}</span>
|
|
4025
|
+
<span class="hm-route-directions__option-meta" aria-hidden="true">{{ option.distance }} · {{ option.duration }}</span>
|
|
4026
|
+
</button>
|
|
4027
|
+
}
|
|
4028
|
+
</div>
|
|
4029
|
+
}
|
|
4030
|
+
|
|
4031
|
+
@if (steps().length) {
|
|
4032
|
+
<p class="hm-route-directions__sr-only" [id]="helpId">{{ text.route.stepsInstructions }}</p>
|
|
4033
|
+
<ol class="hm-route-directions__steps" [attr.aria-labelledby]="titleId" [attr.aria-describedby]="helpId" (keydown)="onKeydown($event)">
|
|
4034
|
+
@for (step of steps(); track $index) {
|
|
4035
|
+
<li class="hm-route-directions__item">
|
|
4036
|
+
<button
|
|
4037
|
+
type="button"
|
|
4038
|
+
class="hm-route-directions__step"
|
|
4039
|
+
[class.hm-route-directions__step--active]="activeStep() === $index"
|
|
4040
|
+
[attr.aria-current]="activeStep() === $index ? 'step' : null"
|
|
4041
|
+
(click)="select($index)"
|
|
4042
|
+
(focus)="select($index)"
|
|
4043
|
+
>
|
|
4044
|
+
<span class="hm-route-directions__maneuver" aria-hidden="true">
|
|
4045
|
+
<hm-icon [shape]="step.icon" [solid]="step.solid" [style.transform]="step.rotation ? 'rotate(' + step.rotation + 'deg)' : null" />
|
|
4046
|
+
</span>
|
|
4047
|
+
<span class="hm-route-directions__instruction">{{ step.instruction }}</span>
|
|
4048
|
+
@if (step.distance) {
|
|
4049
|
+
<span class="hm-route-directions__distance">{{ step.distance }}</span>
|
|
4050
|
+
}
|
|
4051
|
+
</button>
|
|
4052
|
+
</li>
|
|
4053
|
+
}
|
|
4054
|
+
</ol>
|
|
4055
|
+
} @else {
|
|
4056
|
+
<p class="hm-route-directions__empty">{{ text.route.empty }}</p>
|
|
4057
|
+
}
|
|
4058
|
+
`, isInline: true, styles: [".hm-route-directions{display:flex;flex-direction:column;gap:var(--hm-space-sm);min-inline-size:0;color:var(--hm-text);font-family:var(--hm-font-family);font-size:var(--hm-font-size-sm)}.hm-route-directions__header{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:var(--hm-space-xs)}.hm-route-directions__title{margin:0;font-size:var(--hm-font-size-md);font-weight:var(--hm-font-weight-semibold);overflow-wrap:anywhere}.hm-route-directions__totals{margin:0;color:var(--hm-muted);font-variant-numeric:tabular-nums}.hm-route-directions__options{display:flex;flex-wrap:wrap;gap:var(--hm-space-xs)}.hm-route-directions__option{display:flex;flex-direction:column;align-items:flex-start;gap:var(--hm-space-nano);min-inline-size:0;min-block-size:var(--hm-control-height);padding:var(--hm-space-xs) var(--hm-space-sm);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-control);background:var(--hm-surface-raised);color:var(--hm-text);font:inherit;text-align:start;cursor:pointer}.hm-route-directions__option:hover{background:var(--hm-hover)}.hm-route-directions__option:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-route-directions__option--selected{border-color:var(--hm-accent);box-shadow:inset 0 0 0 var(--hm-border-hairline) var(--hm-accent)}.hm-route-directions__option-label{font-weight:var(--hm-font-weight-semibold)}.hm-route-directions__option-meta{color:var(--hm-muted);font-variant-numeric:tabular-nums}.hm-route-directions__steps{display:flex;flex-direction:column;margin:0;padding:0;list-style:none;border-block-start:var(--hm-border-hairline) solid var(--hm-border)}.hm-route-directions__item{min-inline-size:0;border-block-end:var(--hm-border-hairline) solid var(--hm-border)}.hm-route-directions__step{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:var(--hm-space-sm);inline-size:100%;min-block-size:var(--hm-control-height);padding:var(--hm-space-xs) var(--hm-space-sm);border:0;background:transparent;color:var(--hm-text);font:inherit;text-align:start;cursor:pointer}.hm-route-directions__step:hover{background:var(--hm-hover)}.hm-route-directions__step:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-route-directions__step--active{background:color-mix(in srgb,var(--hm-accent) 12%,transparent);box-shadow:inset var(--hm-border-thin) 0 0 var(--hm-accent)}.hm-route-directions__maneuver{display:inline-flex;align-items:center;justify-content:center;inline-size:var(--hm-icon-xl);block-size:var(--hm-icon-xl);border-radius:var(--hm-radius-pill);background:var(--hm-hover);color:var(--hm-accent-strong)}.hm-route-directions__maneuver hm-icon{--color: currentcolor;width:var(--hm-icon-md);height:var(--hm-icon-md)}.hm-route-directions__instruction{overflow-wrap:anywhere}.hm-route-directions__distance{color:var(--hm-muted);font-variant-numeric:tabular-nums;white-space:nowrap}.hm-route-directions__empty{margin:0;color:var(--hm-muted)}.hm-route-directions__sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "hm-icon", inputs: ["shape", "direction", "size", "solid", "badge", "status", "flip", "inverse", "label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
4059
|
+
}
|
|
4060
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: RouteDirectionsComponent, decorators: [{
|
|
4061
|
+
type: Component,
|
|
4062
|
+
args: [{ selector: 'hm-route-directions', imports: [IconComponent], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'hm-route-directions' }, template: `
|
|
4063
|
+
<div class="hm-route-directions__header">
|
|
4064
|
+
<p class="hm-route-directions__title" [id]="titleId">{{ label() || route().label || text.route.directions }}</p>
|
|
4065
|
+
<p class="hm-route-directions__totals">{{ totalsText() }}</p>
|
|
4066
|
+
</div>
|
|
4067
|
+
|
|
4068
|
+
@if (options().length > 1) {
|
|
4069
|
+
<div class="hm-route-directions__options" role="group" [attr.aria-label]="text.route.alternatives">
|
|
4070
|
+
@for (option of options(); track option.id) {
|
|
4071
|
+
<button
|
|
4072
|
+
type="button"
|
|
4073
|
+
class="hm-route-directions__option"
|
|
4074
|
+
[class.hm-route-directions__option--selected]="option.selected"
|
|
4075
|
+
[attr.aria-pressed]="option.selected"
|
|
4076
|
+
[attr.aria-label]="option.name"
|
|
4077
|
+
(click)="chooseRoute(option)"
|
|
4078
|
+
>
|
|
4079
|
+
<span class="hm-route-directions__option-label">{{ option.label }}</span>
|
|
4080
|
+
<span class="hm-route-directions__option-meta" aria-hidden="true">{{ option.distance }} · {{ option.duration }}</span>
|
|
4081
|
+
</button>
|
|
4082
|
+
}
|
|
4083
|
+
</div>
|
|
4084
|
+
}
|
|
4085
|
+
|
|
4086
|
+
@if (steps().length) {
|
|
4087
|
+
<p class="hm-route-directions__sr-only" [id]="helpId">{{ text.route.stepsInstructions }}</p>
|
|
4088
|
+
<ol class="hm-route-directions__steps" [attr.aria-labelledby]="titleId" [attr.aria-describedby]="helpId" (keydown)="onKeydown($event)">
|
|
4089
|
+
@for (step of steps(); track $index) {
|
|
4090
|
+
<li class="hm-route-directions__item">
|
|
4091
|
+
<button
|
|
4092
|
+
type="button"
|
|
4093
|
+
class="hm-route-directions__step"
|
|
4094
|
+
[class.hm-route-directions__step--active]="activeStep() === $index"
|
|
4095
|
+
[attr.aria-current]="activeStep() === $index ? 'step' : null"
|
|
4096
|
+
(click)="select($index)"
|
|
4097
|
+
(focus)="select($index)"
|
|
4098
|
+
>
|
|
4099
|
+
<span class="hm-route-directions__maneuver" aria-hidden="true">
|
|
4100
|
+
<hm-icon [shape]="step.icon" [solid]="step.solid" [style.transform]="step.rotation ? 'rotate(' + step.rotation + 'deg)' : null" />
|
|
4101
|
+
</span>
|
|
4102
|
+
<span class="hm-route-directions__instruction">{{ step.instruction }}</span>
|
|
4103
|
+
@if (step.distance) {
|
|
4104
|
+
<span class="hm-route-directions__distance">{{ step.distance }}</span>
|
|
4105
|
+
}
|
|
4106
|
+
</button>
|
|
4107
|
+
</li>
|
|
4108
|
+
}
|
|
4109
|
+
</ol>
|
|
4110
|
+
} @else {
|
|
4111
|
+
<p class="hm-route-directions__empty">{{ text.route.empty }}</p>
|
|
4112
|
+
}
|
|
4113
|
+
`, styles: [".hm-route-directions{display:flex;flex-direction:column;gap:var(--hm-space-sm);min-inline-size:0;color:var(--hm-text);font-family:var(--hm-font-family);font-size:var(--hm-font-size-sm)}.hm-route-directions__header{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:var(--hm-space-xs)}.hm-route-directions__title{margin:0;font-size:var(--hm-font-size-md);font-weight:var(--hm-font-weight-semibold);overflow-wrap:anywhere}.hm-route-directions__totals{margin:0;color:var(--hm-muted);font-variant-numeric:tabular-nums}.hm-route-directions__options{display:flex;flex-wrap:wrap;gap:var(--hm-space-xs)}.hm-route-directions__option{display:flex;flex-direction:column;align-items:flex-start;gap:var(--hm-space-nano);min-inline-size:0;min-block-size:var(--hm-control-height);padding:var(--hm-space-xs) var(--hm-space-sm);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-control);background:var(--hm-surface-raised);color:var(--hm-text);font:inherit;text-align:start;cursor:pointer}.hm-route-directions__option:hover{background:var(--hm-hover)}.hm-route-directions__option:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-route-directions__option--selected{border-color:var(--hm-accent);box-shadow:inset 0 0 0 var(--hm-border-hairline) var(--hm-accent)}.hm-route-directions__option-label{font-weight:var(--hm-font-weight-semibold)}.hm-route-directions__option-meta{color:var(--hm-muted);font-variant-numeric:tabular-nums}.hm-route-directions__steps{display:flex;flex-direction:column;margin:0;padding:0;list-style:none;border-block-start:var(--hm-border-hairline) solid var(--hm-border)}.hm-route-directions__item{min-inline-size:0;border-block-end:var(--hm-border-hairline) solid var(--hm-border)}.hm-route-directions__step{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:var(--hm-space-sm);inline-size:100%;min-block-size:var(--hm-control-height);padding:var(--hm-space-xs) var(--hm-space-sm);border:0;background:transparent;color:var(--hm-text);font:inherit;text-align:start;cursor:pointer}.hm-route-directions__step:hover{background:var(--hm-hover)}.hm-route-directions__step:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-route-directions__step--active{background:color-mix(in srgb,var(--hm-accent) 12%,transparent);box-shadow:inset var(--hm-border-thin) 0 0 var(--hm-accent)}.hm-route-directions__maneuver{display:inline-flex;align-items:center;justify-content:center;inline-size:var(--hm-icon-xl);block-size:var(--hm-icon-xl);border-radius:var(--hm-radius-pill);background:var(--hm-hover);color:var(--hm-accent-strong)}.hm-route-directions__maneuver hm-icon{--color: currentcolor;width:var(--hm-icon-md);height:var(--hm-icon-md)}.hm-route-directions__instruction{overflow-wrap:anywhere}.hm-route-directions__distance{color:var(--hm-muted);font-variant-numeric:tabular-nums;white-space:nowrap}.hm-route-directions__empty{margin:0;color:var(--hm-muted)}.hm-route-directions__sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}\n"] }]
|
|
4114
|
+
}], propDecorators: { route: [{ type: i0.Input, args: [{ isSignal: true, alias: "route", required: true }] }], alternatives: [{ type: i0.Input, args: [{ isSignal: true, alias: "alternatives", required: false }] }], activeStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeStep", required: false }] }, { type: i0.Output, args: ["activeStepChange"] }], units: [{ type: i0.Input, args: [{ isSignal: true, alias: "units", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], routeSelect: [{ type: i0.Output, args: ["routeSelect"] }] } });
|
|
4115
|
+
|
|
4116
|
+
let nextId$1 = 0;
|
|
4117
|
+
/**
|
|
4118
|
+
* Moldura de street view: o app projeta a imagem ou o visualizador do provedor que usa (panorama,
|
|
4119
|
+
* `<img>`, `<canvas>`) e a moldura dá o resto — cabeçalho com endereço e legenda, bússola com a direção da
|
|
4120
|
+
* vista (`heading`, graus: 0 = norte, 90 = leste), botões de girar e de avançar/voltar, tela cheia
|
|
4121
|
+
* opcional, a atribuição exigida pelo provedor e os estados "carregando" e "sem imagem para este local".
|
|
4122
|
+
*
|
|
4123
|
+
* Não fala com provedor nenhum: girar muda `[(heading)]` (o app repassa ao visualizador), avançar/voltar
|
|
4124
|
+
* emitem `(move)` e tela cheia emite `(fullscreenRequest)` — o app decide o que fazer com cada intenção.
|
|
4125
|
+
* Teclado na área da imagem: ←/→ giram (`rotateStep` graus), ↑/↓ avançam e voltam.
|
|
4126
|
+
*
|
|
4127
|
+
* ```html
|
|
4128
|
+
* <hm-street-view address="Av. Paulista, 1578" attribution="Imagens: Exemplo" [(heading)]="heading" (move)="walk($event)">
|
|
4129
|
+
* <img [src]="frame()" alt="" />
|
|
4130
|
+
* </hm-street-view>
|
|
4131
|
+
* ```
|
|
4132
|
+
*/
|
|
4133
|
+
class StreetViewComponent {
|
|
4134
|
+
#icons = registerIcons(STREET_VIEW_ICONS);
|
|
4135
|
+
text = inject(MAPS_MESSAGES);
|
|
4136
|
+
helpId = `hm-street-view-help-${++nextId$1}`;
|
|
4137
|
+
/** Endereço do ponto (cabeçalho). Também nomeia a área da imagem quando não há `label`. */
|
|
4138
|
+
address = input('', ...(ngDevMode ? [{ debugName: "address" }] : /* istanbul ignore next */ []));
|
|
4139
|
+
/** Legenda curta (data da captura, "Vista a partir da calçada"...). */
|
|
4140
|
+
caption = input('', ...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
|
|
4141
|
+
/** Nome acessível da área da imagem. */
|
|
4142
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
4143
|
+
/** Direção da vista, em graus (0 = norte, 90 = leste). */
|
|
4144
|
+
heading = model(0, ...(ngDevMode ? [{ debugName: "heading" }] : /* istanbul ignore next */ []));
|
|
4145
|
+
/** Quantos graus cada giro anda. */
|
|
4146
|
+
rotateStep = input(45, { ...(ngDevMode ? { debugName: "rotateStep" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
4147
|
+
/** Crédito exigido pelo provedor das imagens (HTML com links, sanitizado). Obrigatório. */
|
|
4148
|
+
attribution = input.required(...(ngDevMode ? [{ debugName: "attribution" }] : /* istanbul ignore next */ []));
|
|
4149
|
+
status = input('ready', ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
|
|
4150
|
+
/** Mostra o botão de tela cheia (emite `fullscreenRequest`). */
|
|
4151
|
+
fullscreen = input(false, { ...(ngDevMode ? { debugName: "fullscreen" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4152
|
+
canMoveForward = input(true, { ...(ngDevMode ? { debugName: "canMoveForward" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4153
|
+
canMoveBackward = input(true, { ...(ngDevMode ? { debugName: "canMoveBackward" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4154
|
+
/** Avançar ou voltar ao ponto vizinho. */
|
|
4155
|
+
move = output();
|
|
4156
|
+
/** Pedido de tela cheia: o app chama `requestFullscreen()` no elemento que quiser. */
|
|
4157
|
+
fullscreenRequest = output();
|
|
4158
|
+
normalized = computed(() => normalizeHeading(this.heading()), ...(ngDevMode ? [{ debugName: "normalized" }] : /* istanbul ignore next */ []));
|
|
4159
|
+
headingText = computed(() => formatMessage(this.text.streetView.heading, {
|
|
4160
|
+
degrees: Math.round(this.normalized()),
|
|
4161
|
+
direction: this.text.streetView.cardinal[headingCardinal(this.normalized())],
|
|
4162
|
+
}), ...(ngDevMode ? [{ debugName: "headingText" }] : /* istanbul ignore next */ []));
|
|
4163
|
+
/** Anuncia a direção só depois de um giro pedido pela pessoa (não na 1ª pintura). */
|
|
4164
|
+
rotated = false;
|
|
4165
|
+
announcement = computed(() => {
|
|
4166
|
+
const text = this.headingText();
|
|
4167
|
+
return this.rotated ? text : '';
|
|
4168
|
+
}, ...(ngDevMode ? [{ debugName: "announcement" }] : /* istanbul ignore next */ []));
|
|
4169
|
+
rotate(direction) {
|
|
4170
|
+
this.rotated = true;
|
|
4171
|
+
this.heading.set(normalizeHeading(this.heading() + direction * this.rotateStep()));
|
|
4172
|
+
}
|
|
4173
|
+
go(direction) {
|
|
4174
|
+
if (direction === 'forward' ? this.canMoveForward() : this.canMoveBackward())
|
|
4175
|
+
this.move.emit(direction);
|
|
4176
|
+
}
|
|
4177
|
+
onKeydown(event) {
|
|
4178
|
+
if (event.target !== event.currentTarget || this.status() !== 'ready')
|
|
4179
|
+
return;
|
|
4180
|
+
const actions = {
|
|
4181
|
+
ArrowLeft: () => this.rotate(-1),
|
|
4182
|
+
ArrowRight: () => this.rotate(1),
|
|
4183
|
+
ArrowUp: () => this.go('forward'),
|
|
4184
|
+
ArrowDown: () => this.go('backward'),
|
|
4185
|
+
};
|
|
4186
|
+
const action = actions[event.key];
|
|
4187
|
+
if (!action)
|
|
4188
|
+
return;
|
|
4189
|
+
event.preventDefault();
|
|
4190
|
+
action();
|
|
4191
|
+
}
|
|
4192
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: StreetViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4193
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: StreetViewComponent, isStandalone: true, selector: "hm-street-view", inputs: { address: { classPropertyName: "address", publicName: "address", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: false, transformFunction: null }, rotateStep: { classPropertyName: "rotateStep", publicName: "rotateStep", isSignal: true, isRequired: false, transformFunction: null }, attribution: { classPropertyName: "attribution", publicName: "attribution", isSignal: true, isRequired: true, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, fullscreen: { classPropertyName: "fullscreen", publicName: "fullscreen", isSignal: true, isRequired: false, transformFunction: null }, canMoveForward: { classPropertyName: "canMoveForward", publicName: "canMoveForward", isSignal: true, isRequired: false, transformFunction: null }, canMoveBackward: { classPropertyName: "canMoveBackward", publicName: "canMoveBackward", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { heading: "headingChange", move: "move", fullscreenRequest: "fullscreenRequest" }, host: { classAttribute: "hm-street-view" }, ngImport: i0, template: `
|
|
4194
|
+
@if (address() || caption()) {
|
|
4195
|
+
<div class="hm-street-view__header">
|
|
4196
|
+
@if (address()) {
|
|
4197
|
+
<p class="hm-street-view__address">{{ address() }}</p>
|
|
4198
|
+
}
|
|
4199
|
+
@if (caption()) {
|
|
4200
|
+
<p class="hm-street-view__caption">{{ caption() }}</p>
|
|
4201
|
+
}
|
|
4202
|
+
</div>
|
|
4203
|
+
}
|
|
4204
|
+
|
|
4205
|
+
<div
|
|
4206
|
+
class="hm-street-view__stage"
|
|
4207
|
+
role="region"
|
|
4208
|
+
tabindex="0"
|
|
4209
|
+
[attr.aria-roledescription]="text.streetView.roleDescription"
|
|
4210
|
+
[attr.aria-label]="label() || address() || text.streetView.label"
|
|
4211
|
+
[attr.aria-describedby]="helpId"
|
|
4212
|
+
[attr.aria-busy]="status() === 'loading' ? 'true' : null"
|
|
4213
|
+
(keydown)="onKeydown($event)"
|
|
4214
|
+
>
|
|
4215
|
+
@switch (status()) {
|
|
4216
|
+
@case ('loading') {
|
|
4217
|
+
<div class="hm-street-view__state" role="status">
|
|
4218
|
+
<hm-spinner decorative />
|
|
4219
|
+
<span>{{ text.streetView.loading }}</span>
|
|
4220
|
+
</div>
|
|
4221
|
+
}
|
|
4222
|
+
@case ('empty') {
|
|
4223
|
+
<div class="hm-street-view__state" role="status">
|
|
4224
|
+
<hm-icon class="hm-street-view__state-icon" shape="image" />
|
|
4225
|
+
<span class="hm-street-view__state-title">{{ text.streetView.noImagery }}</span>
|
|
4226
|
+
<span class="hm-street-view__state-hint">{{ text.streetView.noImageryHint }}</span>
|
|
4227
|
+
</div>
|
|
4228
|
+
}
|
|
4229
|
+
@default {
|
|
4230
|
+
<div class="hm-street-view__media"><ng-content /></div>
|
|
4231
|
+
}
|
|
4232
|
+
}
|
|
4233
|
+
|
|
4234
|
+
@if (status() === 'ready') {
|
|
4235
|
+
<div class="hm-street-view__compass" role="img" [attr.aria-label]="headingText()">
|
|
4236
|
+
<span class="hm-street-view__needle" [style.transform]="'rotate(' + -normalized() + 'deg)'" aria-hidden="true">
|
|
4237
|
+
<span class="hm-street-view__north">{{ text.streetView.north }}</span>
|
|
4238
|
+
<hm-icon shape="arrow" />
|
|
4239
|
+
</span>
|
|
4240
|
+
</div>
|
|
4241
|
+
|
|
4242
|
+
<div class="hm-street-view__controls" role="group" [attr.aria-label]="text.streetView.controls">
|
|
4243
|
+
<button type="button" class="hm-street-view__control" [attr.aria-label]="text.streetView.rotateLeft" (click)="rotate(-1)">
|
|
4244
|
+
<hm-icon shape="undo" />
|
|
4245
|
+
</button>
|
|
4246
|
+
<button type="button" class="hm-street-view__control" [attr.aria-label]="text.streetView.forward" [disabled]="!canMoveForward()" (click)="go('forward')">
|
|
4247
|
+
<hm-icon shape="arrow" />
|
|
4248
|
+
</button>
|
|
4249
|
+
<button type="button" class="hm-street-view__control" [attr.aria-label]="text.streetView.backward" [disabled]="!canMoveBackward()" (click)="go('backward')">
|
|
4250
|
+
<hm-icon shape="arrow" direction="down" />
|
|
4251
|
+
</button>
|
|
4252
|
+
<button type="button" class="hm-street-view__control" [attr.aria-label]="text.streetView.rotateRight" (click)="rotate(1)">
|
|
4253
|
+
<hm-icon shape="redo" />
|
|
4254
|
+
</button>
|
|
4255
|
+
@if (fullscreen()) {
|
|
4256
|
+
<button type="button" class="hm-street-view__control" [attr.aria-label]="text.streetView.fullscreen" (click)="fullscreenRequest.emit()">
|
|
4257
|
+
<hm-icon shape="window-max" />
|
|
4258
|
+
</button>
|
|
4259
|
+
}
|
|
4260
|
+
</div>
|
|
4261
|
+
}
|
|
4262
|
+
|
|
4263
|
+
<p class="hm-street-view__sr-only" [id]="helpId">{{ text.streetView.instructions }}</p>
|
|
4264
|
+
<div class="hm-street-view__sr-only" aria-live="polite" aria-atomic="true">{{ announcement() }}</div>
|
|
4265
|
+
</div>
|
|
4266
|
+
|
|
4267
|
+
@if (attribution()) {
|
|
4268
|
+
<div class="hm-street-view__attribution" role="note" [attr.aria-label]="text.streetView.attribution" [innerHTML]="attribution()"></div>
|
|
4269
|
+
}
|
|
4270
|
+
`, isInline: true, styles: [".hm-street-view{display:flex;flex-direction:column;min-inline-size:0;overflow:hidden;border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius);background:var(--hm-surface-raised);color:var(--hm-text);font-family:var(--hm-font-family);font-size:var(--hm-font-size-sm)}.hm-street-view__header{display:flex;flex-direction:column;gap:var(--hm-space-nano);padding:var(--hm-space-sm) var(--hm-space-md);border-block-end:var(--hm-border-hairline) solid var(--hm-border)}.hm-street-view__address{margin:0;font-size:var(--hm-font-size-md);font-weight:var(--hm-font-weight-semibold);overflow-wrap:anywhere}.hm-street-view__caption{margin:0;color:var(--hm-muted)}.hm-street-view__stage{position:relative;aspect-ratio:16/9;min-block-size:0;background:color-mix(in srgb,var(--hm-text) 8%,var(--hm-surface-raised))}.hm-street-view__stage:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-street-view__media{position:absolute;inset:0}.hm-street-view__media>img,.hm-street-view__media>svg,.hm-street-view__media>canvas,.hm-street-view__media>video,.hm-street-view__media>iframe{display:block;inline-size:100%;block-size:100%;object-fit:cover;border:0}.hm-street-view__state{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--hm-space-xs);padding:var(--hm-space-md);color:var(--hm-muted);text-align:center}.hm-street-view__state-icon{--color: currentcolor;width:var(--hm-icon-xl);height:var(--hm-icon-xl)}.hm-street-view__state-title{color:var(--hm-text);font-weight:var(--hm-font-weight-semibold)}.hm-street-view__compass{position:absolute;top:var(--hm-space-sm);right:var(--hm-space-sm);display:flex;align-items:center;justify-content:center;inline-size:var(--hm-control-height-large);block-size:var(--hm-control-height-large);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-pill);background:var(--hm-surface-raised);box-shadow:var(--hm-shadow-lg)}.hm-street-view__needle{position:relative;display:flex;flex-direction:column;align-items:center;color:var(--hm-danger);line-height:1;transition:transform var(--hm-duration-standard) var(--hm-ease-standard)}.hm-street-view__needle hm-icon{--color: currentcolor;width:var(--hm-icon-md);height:var(--hm-icon-md)}.hm-street-view__north{font-size:var(--hm-font-size-2xs);font-weight:var(--hm-font-weight-bold);color:var(--hm-text)}.hm-street-view__controls{position:absolute;bottom:var(--hm-space-sm);left:50%;display:flex;gap:var(--hm-space-xxxs);padding:var(--hm-space-xxxs);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-pill);background:var(--hm-surface-raised);box-shadow:var(--hm-shadow-lg);transform:translate(-50%)}.hm-street-view__control{display:inline-flex;align-items:center;justify-content:center;inline-size:var(--hm-control-height);block-size:var(--hm-control-height);padding:0;border:0;border-radius:var(--hm-radius-pill);background:transparent;color:var(--hm-text);cursor:pointer}.hm-street-view__control:hover:not(:disabled){background:var(--hm-hover)}.hm-street-view__control:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-street-view__control:disabled{color:var(--hm-muted);cursor:not-allowed}.hm-street-view__control hm-icon{--color: currentcolor;width:var(--hm-icon-md);height:var(--hm-icon-md)}.hm-street-view__attribution{padding:var(--hm-space-xxxs) var(--hm-space-sm);border-block-start:var(--hm-border-hairline) solid var(--hm-border);color:var(--hm-muted);font-size:var(--hm-font-size-xs);text-align:end}.hm-street-view__attribution a{color:var(--hm-accent-strong)}.hm-street-view__attribution a:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-street-view__sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}@media(prefers-reduced-motion:reduce){.hm-street-view__needle{transition:none}}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "hm-icon", inputs: ["shape", "direction", "size", "solid", "badge", "status", "flip", "inverse", "label"] }, { kind: "component", type: SpinnerComponent, selector: "hm-spinner", inputs: ["size", "inverse", "label", "labelVisible", "decorative", "done", "doneLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
4271
|
+
}
|
|
4272
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: StreetViewComponent, decorators: [{
|
|
4273
|
+
type: Component,
|
|
4274
|
+
args: [{ selector: 'hm-street-view', imports: [IconComponent, SpinnerComponent], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'hm-street-view' }, template: `
|
|
4275
|
+
@if (address() || caption()) {
|
|
4276
|
+
<div class="hm-street-view__header">
|
|
4277
|
+
@if (address()) {
|
|
4278
|
+
<p class="hm-street-view__address">{{ address() }}</p>
|
|
4279
|
+
}
|
|
4280
|
+
@if (caption()) {
|
|
4281
|
+
<p class="hm-street-view__caption">{{ caption() }}</p>
|
|
4282
|
+
}
|
|
4283
|
+
</div>
|
|
4284
|
+
}
|
|
4285
|
+
|
|
4286
|
+
<div
|
|
4287
|
+
class="hm-street-view__stage"
|
|
4288
|
+
role="region"
|
|
4289
|
+
tabindex="0"
|
|
4290
|
+
[attr.aria-roledescription]="text.streetView.roleDescription"
|
|
4291
|
+
[attr.aria-label]="label() || address() || text.streetView.label"
|
|
4292
|
+
[attr.aria-describedby]="helpId"
|
|
4293
|
+
[attr.aria-busy]="status() === 'loading' ? 'true' : null"
|
|
4294
|
+
(keydown)="onKeydown($event)"
|
|
4295
|
+
>
|
|
4296
|
+
@switch (status()) {
|
|
4297
|
+
@case ('loading') {
|
|
4298
|
+
<div class="hm-street-view__state" role="status">
|
|
4299
|
+
<hm-spinner decorative />
|
|
4300
|
+
<span>{{ text.streetView.loading }}</span>
|
|
4301
|
+
</div>
|
|
4302
|
+
}
|
|
4303
|
+
@case ('empty') {
|
|
4304
|
+
<div class="hm-street-view__state" role="status">
|
|
4305
|
+
<hm-icon class="hm-street-view__state-icon" shape="image" />
|
|
4306
|
+
<span class="hm-street-view__state-title">{{ text.streetView.noImagery }}</span>
|
|
4307
|
+
<span class="hm-street-view__state-hint">{{ text.streetView.noImageryHint }}</span>
|
|
4308
|
+
</div>
|
|
4309
|
+
}
|
|
4310
|
+
@default {
|
|
4311
|
+
<div class="hm-street-view__media"><ng-content /></div>
|
|
4312
|
+
}
|
|
4313
|
+
}
|
|
4314
|
+
|
|
4315
|
+
@if (status() === 'ready') {
|
|
4316
|
+
<div class="hm-street-view__compass" role="img" [attr.aria-label]="headingText()">
|
|
4317
|
+
<span class="hm-street-view__needle" [style.transform]="'rotate(' + -normalized() + 'deg)'" aria-hidden="true">
|
|
4318
|
+
<span class="hm-street-view__north">{{ text.streetView.north }}</span>
|
|
4319
|
+
<hm-icon shape="arrow" />
|
|
4320
|
+
</span>
|
|
4321
|
+
</div>
|
|
4322
|
+
|
|
4323
|
+
<div class="hm-street-view__controls" role="group" [attr.aria-label]="text.streetView.controls">
|
|
4324
|
+
<button type="button" class="hm-street-view__control" [attr.aria-label]="text.streetView.rotateLeft" (click)="rotate(-1)">
|
|
4325
|
+
<hm-icon shape="undo" />
|
|
4326
|
+
</button>
|
|
4327
|
+
<button type="button" class="hm-street-view__control" [attr.aria-label]="text.streetView.forward" [disabled]="!canMoveForward()" (click)="go('forward')">
|
|
4328
|
+
<hm-icon shape="arrow" />
|
|
4329
|
+
</button>
|
|
4330
|
+
<button type="button" class="hm-street-view__control" [attr.aria-label]="text.streetView.backward" [disabled]="!canMoveBackward()" (click)="go('backward')">
|
|
4331
|
+
<hm-icon shape="arrow" direction="down" />
|
|
4332
|
+
</button>
|
|
4333
|
+
<button type="button" class="hm-street-view__control" [attr.aria-label]="text.streetView.rotateRight" (click)="rotate(1)">
|
|
4334
|
+
<hm-icon shape="redo" />
|
|
4335
|
+
</button>
|
|
4336
|
+
@if (fullscreen()) {
|
|
4337
|
+
<button type="button" class="hm-street-view__control" [attr.aria-label]="text.streetView.fullscreen" (click)="fullscreenRequest.emit()">
|
|
4338
|
+
<hm-icon shape="window-max" />
|
|
4339
|
+
</button>
|
|
4340
|
+
}
|
|
4341
|
+
</div>
|
|
4342
|
+
}
|
|
4343
|
+
|
|
4344
|
+
<p class="hm-street-view__sr-only" [id]="helpId">{{ text.streetView.instructions }}</p>
|
|
4345
|
+
<div class="hm-street-view__sr-only" aria-live="polite" aria-atomic="true">{{ announcement() }}</div>
|
|
4346
|
+
</div>
|
|
4347
|
+
|
|
4348
|
+
@if (attribution()) {
|
|
4349
|
+
<div class="hm-street-view__attribution" role="note" [attr.aria-label]="text.streetView.attribution" [innerHTML]="attribution()"></div>
|
|
4350
|
+
}
|
|
4351
|
+
`, styles: [".hm-street-view{display:flex;flex-direction:column;min-inline-size:0;overflow:hidden;border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius);background:var(--hm-surface-raised);color:var(--hm-text);font-family:var(--hm-font-family);font-size:var(--hm-font-size-sm)}.hm-street-view__header{display:flex;flex-direction:column;gap:var(--hm-space-nano);padding:var(--hm-space-sm) var(--hm-space-md);border-block-end:var(--hm-border-hairline) solid var(--hm-border)}.hm-street-view__address{margin:0;font-size:var(--hm-font-size-md);font-weight:var(--hm-font-weight-semibold);overflow-wrap:anywhere}.hm-street-view__caption{margin:0;color:var(--hm-muted)}.hm-street-view__stage{position:relative;aspect-ratio:16/9;min-block-size:0;background:color-mix(in srgb,var(--hm-text) 8%,var(--hm-surface-raised))}.hm-street-view__stage:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:calc(-1 * var(--hm-border-thin))}.hm-street-view__media{position:absolute;inset:0}.hm-street-view__media>img,.hm-street-view__media>svg,.hm-street-view__media>canvas,.hm-street-view__media>video,.hm-street-view__media>iframe{display:block;inline-size:100%;block-size:100%;object-fit:cover;border:0}.hm-street-view__state{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--hm-space-xs);padding:var(--hm-space-md);color:var(--hm-muted);text-align:center}.hm-street-view__state-icon{--color: currentcolor;width:var(--hm-icon-xl);height:var(--hm-icon-xl)}.hm-street-view__state-title{color:var(--hm-text);font-weight:var(--hm-font-weight-semibold)}.hm-street-view__compass{position:absolute;top:var(--hm-space-sm);right:var(--hm-space-sm);display:flex;align-items:center;justify-content:center;inline-size:var(--hm-control-height-large);block-size:var(--hm-control-height-large);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-pill);background:var(--hm-surface-raised);box-shadow:var(--hm-shadow-lg)}.hm-street-view__needle{position:relative;display:flex;flex-direction:column;align-items:center;color:var(--hm-danger);line-height:1;transition:transform var(--hm-duration-standard) var(--hm-ease-standard)}.hm-street-view__needle hm-icon{--color: currentcolor;width:var(--hm-icon-md);height:var(--hm-icon-md)}.hm-street-view__north{font-size:var(--hm-font-size-2xs);font-weight:var(--hm-font-weight-bold);color:var(--hm-text)}.hm-street-view__controls{position:absolute;bottom:var(--hm-space-sm);left:50%;display:flex;gap:var(--hm-space-xxxs);padding:var(--hm-space-xxxs);border:var(--hm-border-hairline) solid var(--hm-border);border-radius:var(--hm-radius-pill);background:var(--hm-surface-raised);box-shadow:var(--hm-shadow-lg);transform:translate(-50%)}.hm-street-view__control{display:inline-flex;align-items:center;justify-content:center;inline-size:var(--hm-control-height);block-size:var(--hm-control-height);padding:0;border:0;border-radius:var(--hm-radius-pill);background:transparent;color:var(--hm-text);cursor:pointer}.hm-street-view__control:hover:not(:disabled){background:var(--hm-hover)}.hm-street-view__control:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-street-view__control:disabled{color:var(--hm-muted);cursor:not-allowed}.hm-street-view__control hm-icon{--color: currentcolor;width:var(--hm-icon-md);height:var(--hm-icon-md)}.hm-street-view__attribution{padding:var(--hm-space-xxxs) var(--hm-space-sm);border-block-start:var(--hm-border-hairline) solid var(--hm-border);color:var(--hm-muted);font-size:var(--hm-font-size-xs);text-align:end}.hm-street-view__attribution a{color:var(--hm-accent-strong)}.hm-street-view__attribution a:focus-visible{outline:var(--hm-border-thin) solid var(--hm-focus-color);outline-offset:var(--hm-border-hairline)}.hm-street-view__sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}@media(prefers-reduced-motion:reduce){.hm-street-view__needle{transition:none}}\n"] }]
|
|
4352
|
+
}], propDecorators: { address: [{ type: i0.Input, args: [{ isSignal: true, alias: "address", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], heading: [{ type: i0.Input, args: [{ isSignal: true, alias: "heading", required: false }] }, { type: i0.Output, args: ["headingChange"] }], rotateStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "rotateStep", required: false }] }], attribution: [{ type: i0.Input, args: [{ isSignal: true, alias: "attribution", required: true }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], fullscreen: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullscreen", required: false }] }], canMoveForward: [{ type: i0.Input, args: [{ isSignal: true, alias: "canMoveForward", required: false }] }], canMoveBackward: [{ type: i0.Input, args: [{ isSignal: true, alias: "canMoveBackward", required: false }] }], move: [{ type: i0.Output, args: ["move"] }], fullscreenRequest: [{ type: i0.Output, args: ["fullscreenRequest"] }] } });
|
|
4353
|
+
|
|
3175
4354
|
let nextId = 0;
|
|
3176
4355
|
/** Tamanho estimado do rótulo, em px, para evitar sobreposição (o desenho usa `--hm-font-size-xs`). */
|
|
3177
4356
|
const LABEL_FONT_PX = 12;
|
|
@@ -3705,11 +4884,15 @@ const HM_MAP_COMPONENTS = [
|
|
|
3705
4884
|
MapPolygonComponent,
|
|
3706
4885
|
MapCircleComponent,
|
|
3707
4886
|
MapGeoJsonComponent,
|
|
4887
|
+
MapClusterComponent,
|
|
4888
|
+
MapRouteComponent,
|
|
4889
|
+
RouteDirectionsComponent,
|
|
4890
|
+
StreetViewComponent,
|
|
3708
4891
|
];
|
|
3709
4892
|
|
|
3710
4893
|
/**
|
|
3711
4894
|
* Generated bundle index. Do not edit.
|
|
3712
4895
|
*/
|
|
3713
4896
|
|
|
3714
|
-
export { DEFAULT_INTERACTIONS, DEFAULT_LIMITS, DEFAULT_TILE_SIZE, EARTH_RADIUS, HM_MAP, HM_MAP_COMPONENTS, HM_MAP_MARKER, ICON_MAP_MARKER, MAPS_I18N_CONFIG, MAPS_MESSAGES, MAPS_MESSAGES_EN, MAPS_MESSAGES_ES, MAPS_MESSAGES_PT_BR, MAX_LATITUDE, MapBasemapComponent, MapChoroplethComponent, MapCircleComponent, MapComponent, MapEngine, MapGeoJsonComponent, MapInteractions, MapMarkerComponent, MapPathBase, MapPolygonComponent, MapPolylineComponent, MapPopupComponent, MapRegionsBase, TileLayer, addPoints, basemapLayer, boundsCenter, boundsOf, boundsOffset, boundsZoom, brUfSiglas, choroplethClasses, circlePath, circlePathPx, clampLatitude, clampZoom, classify, containsLatLng, decodeArcs, distanceMeters, fitBoundsView, formatScale, fractionToLayer, geoJsonBounds, geoJsonFeatures, geoJsonShapes, imperialScale, isLatLngBounds, joinChoropleth, keyboardAction, latLng, latLngToPixel, latLngToTile, limitCenter, linesPath, loadBasemapData, loadBasemapLayer, maxClasses, metersPerPixel, metersToPixels, metricScale, pathData, pixelToLatLng, placeLabels, point$1 as point, positionToLatLng, project, projectBounds, projectFraction, provideMapsMessages, regionKey, regionName, regionPath, resolveBasemapLayerId, resolvePathStyle, roundPoint, roundScaleNumber, sameLatLng, scaleColor, scalePoint, seriesColor, subtractPoints, tileKey, tileRange, tileToLatLng, tileUrl, tilesInRange, toLatLng, toLatLngBounds, toLayerPoint, toParts, topologyFeatures, topologyObjects, ufSigla, unpackArcs, unpackTopology, unproject, viewBounds, worldSize, wrapLng, wrapTile, zoomAroundView, zoomForWorldSize };
|
|
4897
|
+
export { DEFAULT_INTERACTIONS, DEFAULT_LIMITS, DEFAULT_TILE_SIZE, EARTH_RADIUS, HM_MAP, HM_MAP_COMPONENTS, HM_MAP_MARKER, ICON_MAP_MARKER, MAPS_I18N_CONFIG, MAPS_MESSAGES, MAPS_MESSAGES_EN, MAPS_MESSAGES_ES, MAPS_MESSAGES_PT_BR, MAX_LATITUDE, MapBasemapComponent, MapChoroplethComponent, MapCircleComponent, MapClusterComponent, MapComponent, MapEngine, MapGeoJsonComponent, MapInteractions, MapMarkerComponent, MapPathBase, MapPolygonComponent, MapPolylineComponent, MapPopupComponent, MapRegionsBase, MapRouteComponent, ROUTE_ICONS, RouteDirectionsComponent, STREET_VIEW_ICONS, StreetViewComponent, TileLayer, addPoints, basemapLayer, boundsCenter, boundsOf, boundsOffset, boundsZoom, brUfSiglas, choroplethClasses, circlePath, circlePathPx, clampLatitude, clampZoom, classify, clusterPoints, containsLatLng, decodeArcs, distanceMeters, fitBoundsView, formatRouteDistance, formatRouteDuration, formatScale, fractionToLayer, geoJsonBounds, geoJsonFeatures, geoJsonShapes, headingCardinal, imperialScale, isLatLngBounds, joinChoropleth, keyboardAction, latLng, latLngToPixel, latLngToTile, limitCenter, linesPath, loadBasemapData, loadBasemapLayer, loadBrazilMunicipalities, loadBrazilStates, loadWorldCountries, maneuverIcon, maxClasses, metersPerPixel, metersToPixels, metricScale, normalizeHeading, pathData, pixelToLatLng, placeLabels, point$1 as point, positionToLatLng, project, projectBounds, projectFraction, provideMapsMessages, regionKey, regionName, regionPath, resolveBasemapLayerId, resolvePathStyle, roundPoint, roundScaleNumber, routeBounds, routeLength, routeStepLocation, routeStepSegment, routeTotals, sameLatLng, scaleColor, scalePoint, seriesColor, subtractPoints, tileKey, tileRange, tileToLatLng, tileUrl, tilesInRange, toLatLng, toLatLngBounds, toLayerPoint, toParts, topologyFeatures, topologyObjects, ufSigla, unpackArcs, unpackTopology, unproject, viewBounds, worldSize, wrapLng, wrapTile, zoomAroundView, zoomForWorldSize };
|
|
3715
4898
|
//# sourceMappingURL=trismegisto-maps.mjs.map
|