@igo2/geo 19.0.0-next.11 → 19.0.0-next.12

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.
@@ -37,6 +37,7 @@ import OlGeoJSON from 'ol/format/GeoJSON';
37
37
  import * as olgeom from 'ol/geom';
38
38
  import { Point } from 'ol/geom';
39
39
  import * as olStyle from 'ol/style';
40
+ import { Style } from 'ol/style';
40
41
  import * as olformat from 'ol/format';
41
42
  import { EsriJSON, WMTSCapabilities, WMSCapabilities } from 'ol/format';
42
43
  import OlVectorSource from 'ol/source/Vector';
@@ -4621,26 +4622,28 @@ function olStyleToBasicIgoStyle(layer) {
4621
4622
  if (typeof layerOlStyle === 'function' || layerOlStyle instanceof Array) {
4622
4623
  return;
4623
4624
  }
4624
- const rStyle = {
4625
- fill: {
4626
- color: layerOlStyle.getFill().getColor()
4627
- },
4628
- stroke: {
4629
- color: layerOlStyle.getStroke().getColor(),
4630
- width: 2
4631
- },
4632
- circle: {
4625
+ if (layerOlStyle instanceof Style) {
4626
+ return {
4633
4627
  fill: {
4634
- color: layerOlStyle.getImage().getFill().getColor()
4628
+ color: layerOlStyle.getFill().getColor()
4635
4629
  },
4636
4630
  stroke: {
4637
- color: layerOlStyle.getImage().getStroke().getColor(),
4631
+ color: layerOlStyle.getStroke().getColor(),
4638
4632
  width: 2
4639
4633
  },
4640
- radius: 5
4641
- }
4642
- };
4643
- return rStyle;
4634
+ circle: {
4635
+ fill: {
4636
+ color: layerOlStyle.getImage().getFill().getColor()
4637
+ },
4638
+ stroke: {
4639
+ color: layerOlStyle.getImage().getStroke().getColor(),
4640
+ width: 2
4641
+ },
4642
+ radius: 5
4643
+ }
4644
+ };
4645
+ }
4646
+ return;
4644
4647
  }
4645
4648
 
4646
4649
  class VectorWatcher extends Watcher {
@@ -6745,7 +6748,7 @@ function featuresAreTooDeepInView(viewController, featuresExtent, areaRatio) {
6745
6748
  function moveToOlFeatures(viewController, olFeatures, motion = FeatureMotion.Default, scale, areaRatio) {
6746
6749
  const extent = viewController.getExtent();
6747
6750
  const projection = viewController.getOlProjection();
6748
- const featuresExtent = computeOlFeaturesExtent(olFeatures, projection);
6751
+ const featuresExtent = computeOlFeaturesExtent(Array.isArray(olFeatures) ? olFeatures : [olFeatures], projection);
6749
6752
  let viewExtent = featuresExtent;
6750
6753
  if (scale !== undefined) {
6751
6754
  viewExtent = scaleExtent(viewExtent, scale);
@@ -10119,9 +10122,11 @@ class TileLayer extends Layer {
10119
10122
  });
10120
10123
  const tileLayer = new olLayerTile(olOptions);
10121
10124
  const tileSource = tileLayer.getSource();
10122
- tileSource.setTileLoadFunction((tile, url) => {
10123
- this.customLoader(tile, url, this.authInterceptor);
10124
- });
10125
+ if ('setTileLoadFunction' in tileSource) {
10126
+ tileSource.setTileLoadFunction((tile, url) => {
10127
+ this.customLoader(tile, url, this.authInterceptor);
10128
+ });
10129
+ }
10125
10130
  return tileLayer;
10126
10131
  }
10127
10132
  /**
@@ -13122,7 +13127,7 @@ class LayerViewerBottomActionsComponent {
13122
13127
  return this.controller.selected.every((layer) => this.isLowerable(layer));
13123
13128
  }
13124
13129
  get canRename() {
13125
- if (!this.viewerOptions.group.canRename || this.selected.length > 1) {
13130
+ if (!this.viewerOptions.group?.canRename || this.selected.length > 1) {
13126
13131
  return false;
13127
13132
  }
13128
13133
  const layer = this.selected[0];
@@ -33438,7 +33443,7 @@ class SearchResultsItemComponent {
33438
33443
  dataProjection: this.result.data.projection,
33439
33444
  featureProjection: this.map.projection
33440
33445
  });
33441
- moveToOlFeatures(this.map.viewController, [olFeature], FeatureMotion.Default);
33446
+ moveToOlFeatures(this.map.viewController, olFeature, FeatureMotion.Default);
33442
33447
  }
33443
33448
  /**
33444
33449
  * On mouse event, mouseenter /mouseleave
@@ -36457,7 +36462,7 @@ class ToastComponent {
36457
36462
  dataProjection: this.feature.projection,
36458
36463
  featureProjection: this.map.projection
36459
36464
  });
36460
- moveToOlFeatures(this.map.viewController, [olFeature], FeatureMotion.Zoom);
36465
+ moveToOlFeatures(this.map.viewController, olFeature, FeatureMotion.Zoom);
36461
36466
  }
36462
36467
  }
36463
36468
  swipe(action) {
@@ -37497,8 +37502,7 @@ class EditionWorkspaceService {
37497
37502
  'SRID=' +
37498
37503
  projDest.replace('EPSG:', '') +
37499
37504
  ';' +
37500
- this.wktFormat.writeGeometry(this.geoJsonFormat
37501
- .readFeature(feature.geometry)
37505
+ this.wktFormat.writeGeometry(this.geoJsonFormat.readFeature(feature.geometry)
37502
37506
  .getGeometry()
37503
37507
  .transform('EPSG:4326', projDest), { dataProjection: projDest });
37504
37508
  }
@@ -37586,8 +37590,7 @@ class EditionWorkspaceService {
37586
37590
  'SRID=' +
37587
37591
  projDest.replace('EPSG:', '') +
37588
37592
  ';' +
37589
- this.wktFormat.writeGeometry(this.geoJsonFormat
37590
- .readFeature(feature.geometry)
37593
+ this.wktFormat.writeGeometry(this.geoJsonFormat.readFeature(feature.geometry)
37591
37594
  .getGeometry()
37592
37595
  .transform('EPSG:4326', projDest), { dataProjection: projDest });
37593
37596
  }