Releases: watergis/maplibre-gl-terradraw
Releases · watergis/maplibre-gl-terradraw
v0.6.3
Patch Changes
- 5a285ce: fix: support select and delete-selection mode for MeasureControl. Use change event to compute distance and area instead of finished.
v0.6.2
Patch Changes
- 42e6ef0: fix: changed TerraDraw mode style for MeasureControl to differentiate from normal control. Also, circle layer for line label is added to visualize node of distance.
v0.6.1
Patch Changes
- af6beaf: fix: only add relevant source for user specified modes. For example, only line layer and source is added if no modes of polygon are used.
v0.6.0
Minor Changes
-
36861d2: This release has a breaking change of the plugin interface. Please read carefully this changelog.
added MaplibreMeasureControl to provide measure line and area control easily.
Usage of MaplibreMeasureControl
is like the below code.
const drawControl = new MaplibreMeasureControl({
modes: [
'linestring',
'polygon',
'rectangle',
'angled-rectangle',
'circle',
'sector',
'sensor',
'freehand',
'delete'
],
open: true
});
map.addControl(drawControl, 'top-left');
Due to adding new plugin control, default
export was removed.
New usage of MaplibreTerradrawControl
will be like below.
- import MaplibreTerradrawControl from '$lib/index.js';
+ import { MaplibreTerradrawControl } from '$lib/index.js';
for CDN, library name of MaplibreTerradrawControl
needs to be added.
- const draw = new MaplibreTerradrawControl();
+ const draw = new MaplibreTerradrawControl.MaplibreTerradrawControl();
Furthermore, all interfaces and constants are now exported from index.js.
v0.5.1
Patch Changes
- 9358be9: chore: updated vite and other dependencies. Moved exports.types before import and require in package.json
v0.5.0
Minor Changes
- 853a8a1: feat: add on/off function to the control for subscribing some events (currently only two modes - mode-changed and feature-deleted are supported)
v0.4.4
Patch Changes
- fc1c04f: fix: in some timing, TerraDraw throw error of 'Can not register unless mode is unregistered'. Hence, it resets _state in modes as unregistered before adding.
v0.4.3
Patch Changes
- 5529521: chore: updated devDependencies.
v0.4.2
Patch Changes
- cdf5c1d: fix: fixed bug of angled-rectangle, sensor and sector SVG icons which were not rotated with transform in some browser.
- 37a9836: fix: fixed bug when render button is removed. add default hidden mode if no render buttom.
v0.4.1
Patch Changes
- fa9ec0f: call this.deactivate() when calling map.removeControl(drawControl)