@richpods/tiny-geojson-tool 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/components/EditorMap.vue.d.ts +2 -1
- package/dist/components/GeoJsonEditor.vue.d.ts +3 -1
- package/dist/components/GeoJsonViewer.vue.d.ts +3 -1
- package/dist/composables/useDrawing.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/tiny-geojson-tool.js +945 -887
- package/dist/types.d.ts +5 -0
- package/dist/utils/mapView.d.ts +17 -8
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -56,6 +56,7 @@ Both components accept:
|
|
|
56
56
|
| `pmtilesUrl` | `string` | **(required)** | URL to a PMTiles archive for the base map |
|
|
57
57
|
| `center` | `[lng, lat]` | `[0, 20]` | Initial map center |
|
|
58
58
|
| `zoom` | `number` | `2` | Initial zoom level |
|
|
59
|
+
| `bboxPadding` | `[top, right, bottom, left]` | `[0, 0, 0, 0]` | Extra padding used when fitting to GeoJSON bounds |
|
|
59
60
|
|
|
60
61
|
`GeoJsonEditor` additionally accepts:
|
|
61
62
|
|
|
@@ -65,6 +66,12 @@ Both components accept:
|
|
|
65
66
|
| `pointRadius` | `number` | `10` | Radius of point features in pixels |
|
|
66
67
|
| `l10n` | `Partial<EditorLocale>` | English | Override UI strings for localization |
|
|
67
68
|
|
|
69
|
+
Initial map view priority on load:
|
|
70
|
+
|
|
71
|
+
1. If `modelValue.bbox` is present, it is used directly.
|
|
72
|
+
2. Otherwise, bounds are calculated from `modelValue.features`.
|
|
73
|
+
3. If no bounds can be determined (empty map), `center` and `zoom` are used.
|
|
74
|
+
|
|
68
75
|
## Drawing Tools
|
|
69
76
|
|
|
70
77
|
The editor toolbar provides six modes:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EditorFeatureCollection, EditorFeature, Position, ToolMode } from "../types";
|
|
1
|
+
import type { EditorFeatureCollection, EditorFeature, Position, ToolMode, BboxPadding } from "../types";
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
modelValue: EditorFeatureCollection;
|
|
4
4
|
activeTool: ToolMode;
|
|
@@ -6,6 +6,7 @@ type __VLS_Props = {
|
|
|
6
6
|
pointRadius?: number;
|
|
7
7
|
center?: Position;
|
|
8
8
|
zoom?: number;
|
|
9
|
+
bboxPadding?: BboxPadding;
|
|
9
10
|
};
|
|
10
11
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
11
12
|
"update:modelValue": (value: EditorFeatureCollection) => any;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { EditorFeatureCollection, Position } from "../types";
|
|
1
|
+
import type { EditorFeatureCollection, Position, BboxPadding } from "../types";
|
|
2
2
|
import type { EditorLocale } from "../l10n";
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
pmtilesUrl: string;
|
|
5
5
|
pointRadius?: number;
|
|
6
6
|
center?: Position;
|
|
7
7
|
zoom?: number;
|
|
8
|
+
bboxPadding?: BboxPadding;
|
|
8
9
|
l10n?: Partial<EditorLocale>;
|
|
9
10
|
};
|
|
10
11
|
type __VLS_ModelProps = {
|
|
@@ -17,6 +18,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
17
18
|
"onUpdate:modelValue"?: ((value: EditorFeatureCollection) => any) | undefined;
|
|
18
19
|
}>, {
|
|
19
20
|
pointRadius: number;
|
|
21
|
+
bboxPadding: BboxPadding;
|
|
20
22
|
l10n: Partial<EditorLocale>;
|
|
21
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
24
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import type { EditorFeatureCollection, Position } from "../types";
|
|
1
|
+
import type { EditorFeatureCollection, Position, BboxPadding } from "../types";
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
modelValue?: EditorFeatureCollection;
|
|
4
4
|
pmtilesUrl: string;
|
|
5
5
|
center?: Position;
|
|
6
6
|
zoom?: number;
|
|
7
|
+
bboxPadding?: BboxPadding;
|
|
7
8
|
};
|
|
8
9
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
10
|
modelValue: EditorFeatureCollection;
|
|
11
|
+
bboxPadding: BboxPadding;
|
|
10
12
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
13
|
declare const _default: typeof __VLS_export;
|
|
12
14
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ToolMode, Position } from "../types";
|
|
2
2
|
export declare function useDrawing(): {
|
|
3
3
|
activeTool: import("vue").Ref<ToolMode, ToolMode>;
|
|
4
|
-
drawingCoords: import("vue").Ref<[number, number][], [number, number][]
|
|
4
|
+
drawingCoords: import("vue").Ref<[number, number][], Position[] | [number, number][]>;
|
|
5
5
|
selectedFeatureId: import("vue").Ref<string | null, string | null>;
|
|
6
6
|
isDrawing: import("vue").ComputedRef<boolean>;
|
|
7
7
|
setTool: (tool: ToolMode) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,4 +12,4 @@ export { loadIcon, loadIconsForFeatures, getIconUrl, COMMON_ICONS } from "./util
|
|
|
12
12
|
export { DEFAULT_LOCALE } from "./l10n";
|
|
13
13
|
export type { EditorLocale } from "./l10n";
|
|
14
14
|
export { SOURCE_ID, LAYER_IDS, DEFAULTS, MARKER_SIZE_SCALE } from "./constants";
|
|
15
|
-
export type { EditorFeatureCollection, EditorFeature, EditorPolygonFeature, EditorLineStringFeature, EditorPointFeature, EditorMarkerFeature, EditorProperties, BaseProperties, FillStyleProperties, StrokeStyleProperties, MarkerStyleProperties, PointStyleProperties, LabelProperties, Position, ToolMode, EditorProps, ViewerProps, } from "./types";
|
|
15
|
+
export type { EditorFeatureCollection, EditorFeature, EditorPolygonFeature, EditorLineStringFeature, EditorPointFeature, EditorMarkerFeature, EditorProperties, BaseProperties, FillStyleProperties, StrokeStyleProperties, MarkerStyleProperties, PointStyleProperties, LabelProperties, Position, GeoJsonBbox, BboxPadding, ToolMode, EditorProps, ViewerProps, } from "./types";
|