mahal_map 1.6.8 → 1.6.10
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 +1 -1
- package/dist/index.d.mts +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.map +1 -1
- package/dist/mahal_map.sdk.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -575,7 +575,7 @@ const measureTool = new MeasureTool(map, {
|
|
|
575
575
|
| Опция | Тип | Описание |
|
|
576
576
|
| ------------------- | ---------------------------------------- | ------------------------------------------------------------------------ |
|
|
577
577
|
| `mode` | `"distance" \| "area"` | Режим по умолчанию. По умолчанию `"distance"`. |
|
|
578
|
-
| `sourceIdPrefix` | `string` | Префикс id source/layer на карте. По умолчанию `"mahal-measure"
|
|
578
|
+
| `sourceIdPrefix` | `string` | Префикс id source/layer на карте. По умолчанию генерируется уникальный (`"mahal-measure-1"`, `"mahal-measure-2"`, ...) — так несколько инструментов на одной карте не конфликтуют. Задайте явно, если нужен предсказуемый id. |
|
|
579
579
|
| `style` | `MeasureStyleOptions` | Цвета и размеры точек/линий/заливки/бейджа. |
|
|
580
580
|
| `icons` | `MeasureIcons` | SVG-иконки `trash` / `close` / `check` для бейджей. |
|
|
581
581
|
| `labels` | `MeasureLabels` | Подписи единиц: `meters`, `kilometers`, `squareMeters`, `squareKilometers`. |
|
package/dist/index.d.mts
CHANGED
|
@@ -230,14 +230,11 @@ interface MeasureStyleOptions {
|
|
|
230
230
|
pointStrokeColor?: string;
|
|
231
231
|
pointStrokeWidth?: number;
|
|
232
232
|
pointRadius?: number;
|
|
233
|
-
activePointColor?: string;
|
|
234
233
|
lineColor?: string;
|
|
235
234
|
lineWidth?: number;
|
|
236
235
|
lineDasharray?: number[];
|
|
237
236
|
fillColor?: string;
|
|
238
237
|
fillOpacity?: number;
|
|
239
|
-
labelColor?: string;
|
|
240
|
-
labelHaloColor?: string;
|
|
241
238
|
badgeBackground?: string;
|
|
242
239
|
badgeTextColor?: string;
|
|
243
240
|
badgeBorderRadius?: string;
|
|
@@ -280,6 +277,7 @@ declare class MeasureTool {
|
|
|
280
277
|
private prefix;
|
|
281
278
|
private style;
|
|
282
279
|
private labels;
|
|
280
|
+
private originalCursor;
|
|
283
281
|
private pointsSourceId;
|
|
284
282
|
private linesSourceId;
|
|
285
283
|
private fillsSourceId;
|
|
@@ -338,6 +336,7 @@ declare class MeasureTool {
|
|
|
338
336
|
private projectPoint;
|
|
339
337
|
private closestPointOnSegment;
|
|
340
338
|
private findClosestPointOnShape;
|
|
339
|
+
private queryPointsLayer;
|
|
341
340
|
private isOverExistingPoint;
|
|
342
341
|
private onLineMouseMove;
|
|
343
342
|
private clearHoverInsert;
|
|
@@ -368,7 +367,18 @@ declare function lineLength(points: [number, number][]): number;
|
|
|
368
367
|
* geodesic area) — accurate enough for on-map measurement at city scale.
|
|
369
368
|
*/
|
|
370
369
|
declare function polygonArea(points: [number, number][]): number;
|
|
370
|
+
/**
|
|
371
|
+
* Area-weighted polygon centroid (shoelace-based), not a plain average of
|
|
372
|
+
* vertices — a vertex average drifts outside the shape for concave or
|
|
373
|
+
* unevenly-spaced polygons. Longitudes are unwrapped relative to the first
|
|
374
|
+
* point first so shapes crossing the antimeridian don't collapse toward 0.
|
|
375
|
+
*/
|
|
371
376
|
declare function polygonCentroid(points: [number, number][]): [number, number];
|
|
377
|
+
/**
|
|
378
|
+
* True midpoint along the line by cumulative length (not a vertex) — for an
|
|
379
|
+
* uneven polyline the point at index Math.floor(n/2) can sit far from the
|
|
380
|
+
* geometric middle. Longitude interpolation is antimeridian-aware.
|
|
381
|
+
*/
|
|
372
382
|
declare function midpoint(points: [number, number][]): [number, number];
|
|
373
383
|
|
|
374
384
|
type index$1_MeasureIcons = MeasureIcons;
|
package/dist/index.d.ts
CHANGED
|
@@ -230,14 +230,11 @@ interface MeasureStyleOptions {
|
|
|
230
230
|
pointStrokeColor?: string;
|
|
231
231
|
pointStrokeWidth?: number;
|
|
232
232
|
pointRadius?: number;
|
|
233
|
-
activePointColor?: string;
|
|
234
233
|
lineColor?: string;
|
|
235
234
|
lineWidth?: number;
|
|
236
235
|
lineDasharray?: number[];
|
|
237
236
|
fillColor?: string;
|
|
238
237
|
fillOpacity?: number;
|
|
239
|
-
labelColor?: string;
|
|
240
|
-
labelHaloColor?: string;
|
|
241
238
|
badgeBackground?: string;
|
|
242
239
|
badgeTextColor?: string;
|
|
243
240
|
badgeBorderRadius?: string;
|
|
@@ -280,6 +277,7 @@ declare class MeasureTool {
|
|
|
280
277
|
private prefix;
|
|
281
278
|
private style;
|
|
282
279
|
private labels;
|
|
280
|
+
private originalCursor;
|
|
283
281
|
private pointsSourceId;
|
|
284
282
|
private linesSourceId;
|
|
285
283
|
private fillsSourceId;
|
|
@@ -338,6 +336,7 @@ declare class MeasureTool {
|
|
|
338
336
|
private projectPoint;
|
|
339
337
|
private closestPointOnSegment;
|
|
340
338
|
private findClosestPointOnShape;
|
|
339
|
+
private queryPointsLayer;
|
|
341
340
|
private isOverExistingPoint;
|
|
342
341
|
private onLineMouseMove;
|
|
343
342
|
private clearHoverInsert;
|
|
@@ -368,7 +367,18 @@ declare function lineLength(points: [number, number][]): number;
|
|
|
368
367
|
* geodesic area) — accurate enough for on-map measurement at city scale.
|
|
369
368
|
*/
|
|
370
369
|
declare function polygonArea(points: [number, number][]): number;
|
|
370
|
+
/**
|
|
371
|
+
* Area-weighted polygon centroid (shoelace-based), not a plain average of
|
|
372
|
+
* vertices — a vertex average drifts outside the shape for concave or
|
|
373
|
+
* unevenly-spaced polygons. Longitudes are unwrapped relative to the first
|
|
374
|
+
* point first so shapes crossing the antimeridian don't collapse toward 0.
|
|
375
|
+
*/
|
|
371
376
|
declare function polygonCentroid(points: [number, number][]): [number, number];
|
|
377
|
+
/**
|
|
378
|
+
* True midpoint along the line by cumulative length (not a vertex) — for an
|
|
379
|
+
* uneven polyline the point at index Math.floor(n/2) can sit far from the
|
|
380
|
+
* geometric middle. Longitude interpolation is antimeridian-aware.
|
|
381
|
+
*/
|
|
372
382
|
declare function midpoint(points: [number, number][]): [number, number];
|
|
373
383
|
|
|
374
384
|
type index$1_MeasureIcons = MeasureIcons;
|