@trismegisto/maps 3.4.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +56 -56
- package/MIGRATION.md +831 -0
- package/NOTICE +29 -62
- package/README.md +19 -5
- package/dist/src/core/basemap.d.ts +5 -5
- package/dist/src/core/basemap.js +1 -1
- package/dist/src/core/basemap.js.map +1 -1
- package/dist/src/core/cluster-groups.d.ts +3 -3
- package/dist/src/core/cluster-groups.js.map +1 -1
- package/dist/src/core/engine.d.ts +22 -18
- package/dist/src/core/engine.js +36 -32
- package/dist/src/core/engine.js.map +1 -1
- package/dist/src/core/geo.d.ts +17 -17
- package/dist/src/core/geo.js +12 -12
- package/dist/src/core/geo.js.map +1 -1
- package/dist/src/core/geojson.d.ts +5 -5
- package/dist/src/core/geojson.js +7 -7
- package/dist/src/core/geojson.js.map +1 -1
- package/dist/src/core/interactions.d.ts +13 -36
- package/dist/src/core/interactions.js +64 -249
- package/dist/src/core/interactions.js.map +1 -1
- package/dist/src/core/map-layers.d.ts +13 -13
- package/dist/src/core/map-layers.js +7 -7
- package/dist/src/core/map-layers.js.map +1 -1
- package/dist/src/core/projection.d.ts +8 -8
- package/dist/src/core/projection.js +7 -7
- package/dist/src/core/projection.js.map +1 -1
- package/dist/src/core/route-view.d.ts +4 -4
- package/dist/src/core/route-view.js +5 -5
- package/dist/src/core/route-view.js.map +1 -1
- package/dist/src/core/route.d.ts +8 -8
- package/dist/src/core/route.js +11 -11
- package/dist/src/core/route.js.map +1 -1
- package/dist/src/core/shapes.d.ts +6 -6
- package/dist/src/core/shapes.js +5 -5
- package/dist/src/core/shapes.js.map +1 -1
- package/dist/src/core/tiles.d.ts +25 -17
- package/dist/src/core/tiles.js +32 -31
- package/dist/src/core/tiles.js.map +1 -1
- package/dist/src/core/vector.d.ts +5 -5
- package/dist/src/core/vector.js +3 -3
- package/dist/src/core/vector.js.map +1 -1
- package/dist/src/core/view.d.ts +12 -12
- package/dist/src/core/view.js +27 -27
- package/dist/src/core/view.js.map +1 -1
- package/package.json +44 -43
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
* Geometria vetorial desenhada em SVG: converte linhas, polígonos e círculos geográficos em atributos
|
|
3
3
|
* `d` de `<path>` nas coordenadas da camada (pixels do mundo menos a origem do enquadramento).
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { GeoPoint, Point } from './geo';
|
|
6
6
|
import { LayerFrame } from './tiles';
|
|
7
7
|
/** Converte graus para o ponto da camada no enquadramento. */
|
|
8
|
-
export declare function toLayerPoint(latlng:
|
|
8
|
+
export declare function toLayerPoint(latlng: GeoPoint, frame: LayerFrame, tileSize?: number): Point;
|
|
9
9
|
/**
|
|
10
10
|
* Atributo `d` de um conjunto de anéis/linhas. `closed`: cada anel é fechado com `z` (polígono). Pontos
|
|
11
11
|
* repetidos depois do arredondamento são descartados.
|
|
12
12
|
*/
|
|
13
13
|
export declare function pathData(rings: readonly (readonly Point[])[], closed: boolean): string;
|
|
14
|
-
/** `d` de linhas geográficas (`
|
|
15
|
-
export declare function linesPath(lines: readonly (readonly
|
|
14
|
+
/** `d` de linhas geográficas (`GeoPoint[][]`, uma por parte) no enquadramento. */
|
|
15
|
+
export declare function linesPath(lines: readonly (readonly GeoPoint[])[], frame: LayerFrame, closed: boolean, tileSize?: number): string;
|
|
16
16
|
/** `d` de um círculo de raio em PIXELS em torno do ponto da camada (dois arcos). */
|
|
17
17
|
export declare function circlePathPx(center: Point, radius: number): string;
|
|
18
18
|
/** Raio em pixels de um círculo de `meters` metros na latitude, no zoom (escala local do Mercator). */
|
|
19
19
|
export declare function metersToPixels(meters: number, lat: number, zoom: number, tileSize?: number): number;
|
|
20
20
|
/** `d` de um círculo geográfico de raio em metros. */
|
|
21
|
-
export declare function circlePath(center:
|
|
21
|
+
export declare function circlePath(center: GeoPoint, radiusMeters: number, frame: LayerFrame, tileSize?: number): string;
|
package/dist/src/core/vector.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DEFAULT_TILE_SIZE,
|
|
1
|
+
import { DEFAULT_TILE_SIZE, geoToPixel, metersPerPixel } from './projection';
|
|
2
2
|
/** Converte graus para o ponto da camada no enquadramento. */
|
|
3
3
|
export function toLayerPoint(latlng, frame, tileSize = DEFAULT_TILE_SIZE) {
|
|
4
|
-
const p =
|
|
4
|
+
const p = geoToPixel(latlng, frame.zoom, tileSize);
|
|
5
5
|
return { x: p.x - frame.origin.x, y: p.y - frame.origin.y };
|
|
6
6
|
}
|
|
7
7
|
/** Arredonda a uma casa (o SVG não ganha nada com mais precisão e o atributo fica menor). */
|
|
@@ -35,7 +35,7 @@ export function pathData(rings, closed) {
|
|
|
35
35
|
}
|
|
36
36
|
return d;
|
|
37
37
|
}
|
|
38
|
-
/** `d` de linhas geográficas (`
|
|
38
|
+
/** `d` de linhas geográficas (`GeoPoint[][]`, uma por parte) no enquadramento. */
|
|
39
39
|
export function linesPath(lines, frame, closed, tileSize = DEFAULT_TILE_SIZE) {
|
|
40
40
|
return pathData(lines.map((line) => line.map((p) => toLayerPoint(p, frame, tileSize))), closed);
|
|
41
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector.js","sourceRoot":"","sources":["../../../src/core/vector.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"vector.js","sourceRoot":"","sources":["../../../src/core/vector.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG7E,8DAA8D;AAC9D,MAAM,UAAU,YAAY,CAAC,MAAgB,EAAE,KAAiB,EAAE,QAAQ,GAAG,iBAAiB;IAC5F,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACnD,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC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Y,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC7H,CAAC"}
|
package/dist/src/core/view.d.ts
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cálculos da vista (centro + zoom) sobre um retângulo de tela, sem DOM: limites de zoom, área máxima
|
|
3
|
-
* (`
|
|
3
|
+
* (`boundary`), enquadramento de um retângulo (`fitTo`) e conversões entre tela e mapa.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { GeoPoint, GeoBox, PixelBox, Point } from './geo';
|
|
6
6
|
export interface ViewLimits {
|
|
7
7
|
readonly minZoom: number;
|
|
8
8
|
readonly maxZoom: number;
|
|
9
9
|
/** Área de onde a vista não sai. `null`: só não passa dos polos do Mercator. */
|
|
10
|
-
readonly
|
|
10
|
+
readonly boundary: GeoBox | null;
|
|
11
11
|
readonly tileSize: number;
|
|
12
12
|
}
|
|
13
13
|
export declare const DEFAULT_LIMITS: ViewLimits;
|
|
14
14
|
export interface ViewState {
|
|
15
|
-
readonly center:
|
|
15
|
+
readonly center: GeoPoint;
|
|
16
16
|
readonly zoom: number;
|
|
17
17
|
}
|
|
18
18
|
export declare function clampZoom(zoom: number, limits: Pick<ViewLimits, 'minZoom' | 'maxZoom'>): number;
|
|
19
19
|
/** Quanto mover `view` (pixels do mundo) para ficar dentro de `area` (pixels do mundo), por eixo. */
|
|
20
|
-
export declare function
|
|
20
|
+
export declare function boxOffset(view: PixelBox, area: PixelBox, axes?: {
|
|
21
21
|
x: boolean;
|
|
22
22
|
y: boolean;
|
|
23
23
|
}): Point;
|
|
24
24
|
/** Retângulo geográfico em pixels do mundo no zoom. */
|
|
25
|
-
export declare function
|
|
25
|
+
export declare function projectBox(bounds: GeoBox, zoom: number, tileSize?: number): PixelBox;
|
|
26
26
|
/**
|
|
27
27
|
* Centro mais próximo de `center` que mantém a vista (tamanho `size`) dentro da área permitida. Sem
|
|
28
|
-
* `
|
|
28
|
+
* `boundary`, só o eixo vertical é contido (o mundo não "acaba" na horizontal, ele se repete).
|
|
29
29
|
*/
|
|
30
|
-
export declare function limitCenter(center:
|
|
30
|
+
export declare function limitCenter(center: GeoPoint, zoom: number, size: Point, limits: ViewLimits): GeoPoint;
|
|
31
31
|
/**
|
|
32
32
|
* Maior zoom (inteiro, dentro dos limites) em que `bounds` cabe inteiro na tela de tamanho `size`, com
|
|
33
33
|
* `padding` px de folga em cada lado.
|
|
34
34
|
*/
|
|
35
|
-
export declare function
|
|
36
|
-
/** Vista que enquadra `bounds`: centro do retângulo projetado e o zoom de `
|
|
37
|
-
export declare function
|
|
35
|
+
export declare function fitZoom(bounds: GeoBox, size: Point, limits: ViewLimits, padding?: Point): number;
|
|
36
|
+
/** Vista que enquadra `bounds`: centro do retângulo projetado e o zoom de `fitZoom`. */
|
|
37
|
+
export declare function fitView(bounds: GeoBox, size: Point, limits: ViewLimits, padding?: Point): ViewState;
|
|
38
38
|
/** Retângulo geográfico visível com o centro e o zoom dados. */
|
|
39
|
-
export declare function
|
|
39
|
+
export declare function visibleBox(view: ViewState, size: Point, tileSize?: number): GeoBox;
|
|
40
40
|
/**
|
|
41
41
|
* Nova vista depois de mudar o zoom mantendo fixo o ponto da tela `anchor` (o ponteiro na roda, o meio
|
|
42
42
|
* da pinça): o que estava sob o dedo continua sob o dedo.
|
package/dist/src/core/view.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DEFAULT_TILE_SIZE, MAX_LATITUDE,
|
|
2
|
-
export const DEFAULT_LIMITS = { minZoom: 0, maxZoom: 19,
|
|
1
|
+
import { DEFAULT_TILE_SIZE, MAX_LATITUDE, geoToPixel, pixelToGeo, worldSize } from './projection';
|
|
2
|
+
export const DEFAULT_LIMITS = { minZoom: 0, maxZoom: 19, boundary: null, tileSize: DEFAULT_TILE_SIZE };
|
|
3
3
|
export function clampZoom(zoom, limits) {
|
|
4
4
|
return Math.max(limits.minZoom, Math.min(limits.maxZoom, zoom));
|
|
5
5
|
}
|
|
@@ -11,7 +11,7 @@ function rebound(left, right) {
|
|
|
11
11
|
return left + right > 0 ? Math.round(left - right) / 2 : Math.max(0, Math.ceil(left)) - Math.max(0, Math.floor(right));
|
|
12
12
|
}
|
|
13
13
|
/** Quanto mover `view` (pixels do mundo) para ficar dentro de `area` (pixels do mundo), por eixo. */
|
|
14
|
-
export function
|
|
14
|
+
export function boxOffset(view, area, axes = { x: true, y: true }) {
|
|
15
15
|
const minOffset = { x: area.min.x - view.min.x, y: area.min.y - view.min.y };
|
|
16
16
|
const maxOffset = { x: area.max.x - view.max.x, y: area.max.y - view.max.y };
|
|
17
17
|
return {
|
|
@@ -20,35 +20,35 @@ export function boundsOffset(view, area, axes = { x: true, y: true }) {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
/** Retângulo geográfico em pixels do mundo no zoom. */
|
|
23
|
-
export function
|
|
24
|
-
const nw =
|
|
25
|
-
const se =
|
|
23
|
+
export function projectBox(bounds, zoom, tileSize = DEFAULT_TILE_SIZE) {
|
|
24
|
+
const nw = geoToPixel({ lat: bounds.north, lng: bounds.west }, zoom, tileSize);
|
|
25
|
+
const se = geoToPixel({ lat: bounds.south, lng: bounds.east }, zoom, tileSize);
|
|
26
26
|
return { min: nw, max: se };
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Centro mais próximo de `center` que mantém a vista (tamanho `size`) dentro da área permitida. Sem
|
|
30
|
-
* `
|
|
30
|
+
* `boundary`, só o eixo vertical é contido (o mundo não "acaba" na horizontal, ele se repete).
|
|
31
31
|
*/
|
|
32
32
|
export function limitCenter(center, zoom, size, limits) {
|
|
33
33
|
const ts = limits.tileSize;
|
|
34
|
-
const c =
|
|
34
|
+
const c = geoToPixel(center, zoom, ts);
|
|
35
35
|
const half = { x: size.x / 2, y: size.y / 2 };
|
|
36
36
|
const view = { min: { x: c.x - half.x, y: c.y - half.y }, max: { x: c.x + half.x, y: c.y + half.y } };
|
|
37
|
-
const area = limits.
|
|
38
|
-
?
|
|
37
|
+
const area = limits.boundary
|
|
38
|
+
? projectBox(limits.boundary, zoom, ts)
|
|
39
39
|
: { min: { x: 0, y: 0 }, max: { x: worldSize(zoom, ts), y: worldSize(zoom, ts) } };
|
|
40
|
-
const offset =
|
|
40
|
+
const offset = boxOffset(view, area, { x: !!limits.boundary, y: true });
|
|
41
41
|
// Menos de um pixel: ignora (evita laço de correções minúsculas por arredondamento da projeção).
|
|
42
42
|
if (Math.abs(offset.x) <= 1 && Math.abs(offset.y) <= 1)
|
|
43
43
|
return center;
|
|
44
|
-
return
|
|
44
|
+
return pixelToGeo({ x: c.x + offset.x, y: c.y + offset.y }, zoom, ts);
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* Maior zoom (inteiro, dentro dos limites) em que `bounds` cabe inteiro na tela de tamanho `size`, com
|
|
48
48
|
* `padding` px de folga em cada lado.
|
|
49
49
|
*/
|
|
50
|
-
export function
|
|
51
|
-
const pb =
|
|
50
|
+
export function fitZoom(bounds, size, limits, padding = { x: 0, y: 0 }) {
|
|
51
|
+
const pb = projectBox(bounds, 0, limits.tileSize);
|
|
52
52
|
const w = Math.max(pb.max.x - pb.min.x, 1e-9);
|
|
53
53
|
const h = Math.max(pb.max.y - pb.min.y, 1e-9);
|
|
54
54
|
const availW = Math.max(size.x - 2 * padding.x, 1);
|
|
@@ -56,18 +56,18 @@ export function boundsZoom(bounds, size, limits, padding = { x: 0, y: 0 }) {
|
|
|
56
56
|
const zoom = Math.floor(Math.log2(Math.min(availW / w, availH / h)));
|
|
57
57
|
return clampZoom(Number.isFinite(zoom) ? zoom : limits.maxZoom, limits);
|
|
58
58
|
}
|
|
59
|
-
/** Vista que enquadra `bounds`: centro do retângulo projetado e o zoom de `
|
|
60
|
-
export function
|
|
61
|
-
const zoom =
|
|
62
|
-
const pb =
|
|
63
|
-
const center =
|
|
59
|
+
/** Vista que enquadra `bounds`: centro do retângulo projetado e o zoom de `fitZoom`. */
|
|
60
|
+
export function fitView(bounds, size, limits, padding = { x: 0, y: 0 }) {
|
|
61
|
+
const zoom = fitZoom(bounds, size, limits, padding);
|
|
62
|
+
const pb = projectBox(bounds, zoom, limits.tileSize);
|
|
63
|
+
const center = pixelToGeo({ x: (pb.min.x + pb.max.x) / 2, y: (pb.min.y + pb.max.y) / 2 }, zoom, limits.tileSize);
|
|
64
64
|
return { center: limitCenter(center, zoom, size, limits), zoom };
|
|
65
65
|
}
|
|
66
66
|
/** Retângulo geográfico visível com o centro e o zoom dados. */
|
|
67
|
-
export function
|
|
68
|
-
const c =
|
|
69
|
-
const nw =
|
|
70
|
-
const se =
|
|
67
|
+
export function visibleBox(view, size, tileSize = DEFAULT_TILE_SIZE) {
|
|
68
|
+
const c = geoToPixel(view.center, view.zoom, tileSize);
|
|
69
|
+
const nw = pixelToGeo({ x: c.x - size.x / 2, y: c.y - size.y / 2 }, view.zoom, tileSize);
|
|
70
|
+
const se = pixelToGeo({ x: c.x + size.x / 2, y: c.y + size.y / 2 }, view.zoom, tileSize);
|
|
71
71
|
return {
|
|
72
72
|
south: Math.max(se.lat, -MAX_LATITUDE),
|
|
73
73
|
west: nw.lng,
|
|
@@ -80,11 +80,11 @@ export function viewBounds(view, size, tileSize = DEFAULT_TILE_SIZE) {
|
|
|
80
80
|
* da pinça): o que estava sob o dedo continua sob o dedo.
|
|
81
81
|
*/
|
|
82
82
|
export function zoomAroundView(view, nextZoom, anchor, size, tileSize = DEFAULT_TILE_SIZE) {
|
|
83
|
-
const c =
|
|
83
|
+
const c = geoToPixel(view.center, view.zoom, tileSize);
|
|
84
84
|
const offset = { x: anchor.x - size.x / 2, y: anchor.y - size.y / 2 };
|
|
85
|
-
const fixed =
|
|
86
|
-
const fixedNext =
|
|
87
|
-
const center =
|
|
85
|
+
const fixed = pixelToGeo({ x: c.x + offset.x, y: c.y + offset.y }, view.zoom, tileSize);
|
|
86
|
+
const fixedNext = geoToPixel(fixed, nextZoom, tileSize);
|
|
87
|
+
const center = pixelToGeo({ x: fixedNext.x - offset.x, y: fixedNext.y - offset.y }, nextZoom, tileSize);
|
|
88
88
|
return { center, zoom: nextZoom };
|
|
89
89
|
}
|
|
90
90
|
//# sourceMappingURL=view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../src/core/view.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../src/core/view.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAUlG,MAAM,CAAC,MAAM,cAAc,GAAe,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC;AAOnH,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,MAA+C;IACrF,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;AAClE,CAAC;AAED;;;GAGG;AACH,SAAS,OAAO,CAAC,IAAY,EAAE,KAAa;IAC1C,OAAO,IAAI,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACzH,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,SAAS,CAAC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CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACxF,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACxD,MAAM,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACxG,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AACpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@trismegisto/maps",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Hermes Design System — núcleo dos mapas sem framework (projeção, vista, tiles, vetores, GeoJSON, mapas base embutidos do mundo e do Brasil, coroplético, rotas e street view, catálogos de texto); as peças Angular ficam em @trismegisto/angular/map",
|
|
5
|
-
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"sideEffects": false,
|
|
8
|
-
"main": "dist/src/core/index.js",
|
|
9
|
-
"module": "dist/src/core/index.js",
|
|
10
|
-
"types": "dist/src/core/index.d.ts",
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"types": "./dist/src/core/index.d.ts",
|
|
14
|
-
"default": "./dist/src/core/index.js"
|
|
15
|
-
},
|
|
16
|
-
"./basemaps/*": {
|
|
17
|
-
"types": "./dist/basemaps/*/index.d.ts",
|
|
18
|
-
"default": "./dist/basemaps/*/index.js"
|
|
19
|
-
},
|
|
20
|
-
"./package.json": "./package.json"
|
|
21
|
-
},
|
|
22
|
-
"files": [
|
|
23
|
-
"dist",
|
|
24
|
-
"NOTICE"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"test
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"@trismegisto/
|
|
37
|
-
"@trismegisto/
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@trismegisto/maps",
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "Hermes Design System — núcleo dos mapas sem framework (projeção, vista, tiles, vetores, GeoJSON, mapas base embutidos do mundo e do Brasil, coroplético, rotas e street view, catálogos de texto); as peças Angular ficam em @trismegisto/angular/map",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"main": "dist/src/core/index.js",
|
|
9
|
+
"module": "dist/src/core/index.js",
|
|
10
|
+
"types": "dist/src/core/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/src/core/index.d.ts",
|
|
14
|
+
"default": "./dist/src/core/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./basemaps/*": {
|
|
17
|
+
"types": "./dist/basemaps/*/index.d.ts",
|
|
18
|
+
"default": "./dist/basemaps/*/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"NOTICE",
|
|
25
|
+
"MIGRATION.md"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc -p tsconfig.json",
|
|
29
|
+
"test": "node ../angular/scripts/check-strings.mjs src --ts-objects && vitest run",
|
|
30
|
+
"test:watch": "vitest"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@trismegisto/primitives": "^4.0.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@trismegisto/icons": "file:../icons",
|
|
37
|
+
"@trismegisto/primitives": "file:../primitives",
|
|
38
|
+
"@trismegisto/tokens": "file:../tokens",
|
|
39
|
+
"jsdom": "^27.4.0",
|
|
40
|
+
"mapshaper": "^0.6.121",
|
|
41
|
+
"typescript": "~5.9.0",
|
|
42
|
+
"vitest": "^4.1.11"
|
|
43
|
+
}
|
|
44
|
+
}
|