@richpods/tiny-geojson-tool 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/dist/components/EditorMap.vue.d.ts +7 -2
- package/dist/components/GeoJsonEditor.vue.d.ts +8 -2
- package/dist/index.d.ts +2 -1
- package/dist/tiny-geojson-tool.js +864 -821
- package/dist/types.d.ts +2 -0
- package/dist/utils/mapView.d.ts +6 -1
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EditorLocale } from "./l10n";
|
|
2
2
|
/** GeoJSON RFC 7946 aligned types for the editor */
|
|
3
3
|
export type Position = [number, number];
|
|
4
|
+
export type BBox = [number, number, number, number];
|
|
4
5
|
export type PolygonCoordinates = Position[][];
|
|
5
6
|
export type LineStringCoordinates = Position[];
|
|
6
7
|
export type PointCoordinates = Position;
|
|
@@ -84,6 +85,7 @@ export type EditorProperties = BaseProperties & FillStyleProperties & StrokeStyl
|
|
|
84
85
|
export interface EditorFeatureCollection {
|
|
85
86
|
type: "FeatureCollection";
|
|
86
87
|
features: EditorFeature[];
|
|
88
|
+
bbox?: BBox;
|
|
87
89
|
}
|
|
88
90
|
/** Tool modes */
|
|
89
91
|
export type ToolMode = "select" | "draw-point" | "draw-polygon" | "draw-line" | "draw-marker" | "eraser";
|
package/dist/utils/mapView.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { type Map as MaplibreMap } from "maplibre-gl";
|
|
2
|
-
import type { EditorFeature, Position } from "../types";
|
|
2
|
+
import type { BBox, EditorFeature, EditorFeatureCollection, Position } from "../types";
|
|
3
3
|
export declare function shouldAutoFitOnLoad(center?: Position, zoom?: number): boolean;
|
|
4
4
|
export declare function fitMapToFeatures(map: MaplibreMap, features: EditorFeature[], options?: {
|
|
5
5
|
padding?: number;
|
|
6
6
|
maxZoom?: number;
|
|
7
7
|
pointZoom?: number;
|
|
8
8
|
}): void;
|
|
9
|
+
export declare function computeBbox(fc: EditorFeatureCollection): BBox | undefined;
|
|
10
|
+
export declare function fitMapToBbox(map: MaplibreMap, bbox: BBox, options?: {
|
|
11
|
+
padding?: number;
|
|
12
|
+
maxZoom?: number;
|
|
13
|
+
}): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@richpods/tiny-geojson-tool",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "RichPods' GeoJSON editor and viewer for MapLibre GL JS with drawing tools (points, lines, polygons), simplestyle-spec property editing, hover popups, PMTiles basemap support, and typed v-model bindings for custom mapping workflows.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|