vue-maplibre-gl
Advanced tools
Comparing version 5.4.2 to 5.4.3
@@ -7,3 +7,2 @@ import { AbstractDrawMode } from './mode.abstract.ts'; | ||
private _mode; | ||
private _hasHelperVertex; | ||
private _moveStart; | ||
@@ -10,0 +9,0 @@ constructor(plugin: DrawPlugin, map: Map, source: GeoJSONSource, model: DrawModel | undefined); |
@@ -34,2 +34,3 @@ import { FitBoundsOptions } from '../../types.ts'; | ||
minSizeLabel?: string; | ||
hasHelperVertex?: boolean; | ||
meta: 'polygon' | 'circle' | 'vertex' | 'midpoint'; | ||
@@ -36,0 +37,0 @@ } |
/*! | ||
* vue-maplibre-gl v5.4.2 | ||
* vue-maplibre-gl v5.4.3 | ||
* (c) 2025 Volker Nauruhn | ||
* @license MIT | ||
*/ | ||
import { C as r, a as e, b as l, D as s, d, P as M } from "./draw.control-CCixCTEF.js"; | ||
import { C as r, a as e, b as l, D as s, d, P as M } from "./draw.control-qeEPmgJ_.js"; | ||
export { | ||
@@ -8,0 +8,0 @@ r as CircleMode, |
/*! | ||
* vue-maplibre-gl v5.4.2 | ||
* vue-maplibre-gl v5.4.3 | ||
* (c) 2025 Volker Nauruhn | ||
@@ -10,4 +10,4 @@ * @license MIT | ||
import { reactive as q, defineComponent as p, markRaw as te, getCurrentInstance as P, shallowRef as Y, ref as _, provide as I, watch as c, onMounted as me, onBeforeUnmount as C, h as H, unref as G, nextTick as re, inject as g, createCommentVNode as O, Teleport as fe, createTextVNode as ae, isRef as D, warn as ge } from "vue"; | ||
import { m as x, i as W, c as T, e as J, s as Q, f as X, g as he, h as ye, u as B, j, k as Z, l as pe, M as K, B as oe, n as ie, A as z, o as Se } from "./draw.control-CCixCTEF.js"; | ||
import { p as vt, C as bt, a as At, b as Rt, D as Ot, d as Mt, P as Et } from "./draw.control-CCixCTEF.js"; | ||
import { m as x, i as W, c as T, e as J, s as Q, f as X, g as he, h as ye, u as B, j, k as Z, l as pe, M as K, B as oe, n as ie, A as z, o as Se } from "./draw.control-qeEPmgJ_.js"; | ||
import { p as vt, C as bt, a as At, b as Rt, D as Ot, d as Mt, P as Et } from "./draw.control-qeEPmgJ_.js"; | ||
import { Map as ve, AttributionControl as be, FullscreenControl as Ae, GeolocateControl as Re, NavigationControl as Oe, ScaleControl as Me, Marker as Ee } from "maplibre-gl"; | ||
@@ -14,0 +14,0 @@ import Le from "mitt"; |
{ | ||
"name": "vue-maplibre-gl", | ||
"version": "5.4.2", | ||
"version": "5.4.3", | ||
"description": "Vue 3 plugin for maplibre-gl", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -51,10 +51,4 @@ import type { DrawPlugin } from '@/plugins/draw/plugin.ts'; | ||
this.collection!.features[ 0 ].properties.area = areaSize; | ||
this.collection!.features[ 0 ].properties.tooSmall = areaSize < this.plugin.options.minArea.size; | ||
// Polygon mode has at least 4 vertices on creation and will be always too small | ||
if (this.collection!.features[ 0 ].properties.meta !== 'polygon' || this.collection!.features[ 0 ].geometry.coordinates.length > 4) { | ||
this.collection!.features[ 0 ].properties.minSizeLabel = this.plugin.options.minArea.label; | ||
} else { | ||
this.collection!.features[ 0 ].properties.minSizeLabel = undefined; | ||
} | ||
this.collection!.features[ 0 ].properties.tooSmall = areaSize < this.plugin.options.minArea.size && !this.collection!.features[ 0 ].properties.hasHelperVertex; | ||
this.collection!.features[ 0 ].properties.minSizeLabel = this.plugin.options.minArea.label; | ||
} | ||
@@ -61,0 +55,0 @@ this.source.setData(this.collection ?? { type: 'FeatureCollection', features: [] }); |
@@ -13,3 +13,2 @@ import { throttle } from '@/lib/debounce.ts'; | ||
private _mode: 'create' | 'move' | 'add_vertex' | 'move_vertex' | undefined; | ||
private _hasHelperVertex = true; | ||
private _moveStart: DrawModeSnapshot | undefined; | ||
@@ -50,5 +49,5 @@ | ||
if (this._hasHelperVertex && len === 5) { | ||
if (polygon.properties.hasHelperVertex && len === 5) { | ||
polygon.geometry.coordinates[ 0 ].splice(helperVertex, 1); | ||
this._hasHelperVertex = false; | ||
polygon.properties.hasHelperVertex = false; | ||
} | ||
@@ -87,3 +86,2 @@ break; | ||
this._hasHelperVertex = true; | ||
this.createFeatureCollection({ | ||
@@ -95,3 +93,3 @@ type : 'Feature', | ||
}, | ||
properties: { meta: 'polygon' } | ||
properties: { meta: 'polygon', hasHelperVertex: true } | ||
}); | ||
@@ -143,3 +141,3 @@ this.collection!.features[ 1 ].geometry.coordinates = [ pos, pos ]; | ||
polygon.geometry.coordinates[ 0 ][ 1 ] = pos; | ||
if (this._hasHelperVertex) { | ||
if (polygon.properties!.hasHelperVertex) { | ||
const npos = this.map.unproject([ e.point.x + 1, e.point.y ]), | ||
@@ -146,0 +144,0 @@ dist = Math.abs((npos.lng - pos[ 0 ]) / 3); |
@@ -39,2 +39,3 @@ import type { FitBoundsOptions } from '@/types.ts'; | ||
minSizeLabel?: string; | ||
hasHelperVertex?: boolean; | ||
meta: 'polygon' | 'circle' | 'vertex' | 'midpoint'; | ||
@@ -41,0 +42,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
1019713
9342