@regionerne/gis-komponent 0.0.114 → 0.0.115

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.
@@ -50,7 +50,6 @@ import * as i1$4 from '@angular/material/dialog';
50
50
  import { MatDialog, MatDialogModule, MatDialogContent, MatDialogActions, MAT_DIALOG_DATA, MatDialogRef, MatDialogTitle } from '@angular/material/dialog';
51
51
  import 'ol/ol.css';
52
52
  import { MultiPolygon, Polygon, Point as Point$1, LineString } from 'ol/geom';
53
- import { getArea, getLength } from 'ol/sphere';
54
53
  import Draw, { createBox, createRegularPolygon } from 'ol/interaction/Draw';
55
54
  import { Draw as Draw$1, Snap, Select as Select$1, Modify } from 'ol/interaction';
56
55
  import { Style, Fill, Circle, Stroke, Icon, Text, RegularShape } from 'ol/style';
@@ -80,6 +79,7 @@ import PrecisionModel from 'jsts/org/locationtech/jts/geom/PrecisionModel';
80
79
  import { polygon } from '@turf/helpers';
81
80
  import booleanWithin$1 from '@turf/boolean-within';
82
81
  import booleanOverlap from '@turf/boolean-overlap';
82
+ import { getArea } from 'ol/sphere';
83
83
  import * as i5 from '@angular/material/autocomplete';
84
84
  import { MatAutocompleteModule } from '@angular/material/autocomplete';
85
85
  import { map as map$1 } from 'rxjs/operators';
@@ -4263,7 +4263,7 @@ class ToolboxComponent {
4263
4263
  zIndex: 999,
4264
4264
  style: (feature) => {
4265
4265
  const geom = feature.getGeometry();
4266
- const area = getArea(geom);
4266
+ const area = geom.getArea();
4267
4267
  const formattedArea = this.settings.sizeInHa
4268
4268
  ? `(${this._formatNumber(area / 10000, 2)} ha)`
4269
4269
  : (area > 1000000
@@ -4308,7 +4308,7 @@ class ToolboxComponent {
4308
4308
  zIndex: 999,
4309
4309
  style: (feature) => {
4310
4310
  const geom = feature.getGeometry();
4311
- const length = getLength(geom);
4311
+ const length = geom.getLength(); // getLength(geom);
4312
4312
  const formattedLength = `${this._formatNumber(length, 2)} m`;
4313
4313
  return new Style({
4314
4314
  stroke: new Stroke({
@@ -4342,7 +4342,6 @@ class ToolboxComponent {
4342
4342
  this._distanceMeasureDraw.on('drawstart', (evt) => {
4343
4343
  const sketch = evt.feature;
4344
4344
  this._featureHelper.setId(sketch);
4345
- console.log("🚀 ~ ToolboxComponent ~ constructor ~ sketch:", sketch);
4346
4345
  sketch.getGeometry().on('change', (geomEvt) => {
4347
4346
  const geom = geomEvt.target;
4348
4347
  const coords = geom.getCoordinates();
@@ -4354,7 +4353,7 @@ class ToolboxComponent {
4354
4353
  const c1 = coords[i];
4355
4354
  const c2 = coords[i + 1];
4356
4355
  const segment = new LineString([c1, c2]);
4357
- const length = getLength(segment);
4356
+ const length = segment.getLength(); // getLength(segment, { projection: 'EPSG:25832' });
4358
4357
  totalLength += length;
4359
4358
  const mid = [(c1[0] + c2[0]) / 2, (c1[1] + c2[1]) / 2];
4360
4359
  const formatted = `${this._formatNumber(length, 2)} m`;