@regionerne/gis-komponent 0.0.54 → 0.0.56
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.
|
@@ -3181,15 +3181,14 @@ class ToolboxComponent {
|
|
|
3181
3181
|
if (!this.WKTString) {
|
|
3182
3182
|
return;
|
|
3183
3183
|
}
|
|
3184
|
+
if (!this.selectedDrawItem) {
|
|
3185
|
+
return;
|
|
3186
|
+
}
|
|
3184
3187
|
const wktFormat = new WKT();
|
|
3185
3188
|
try {
|
|
3186
3189
|
const feature = wktFormat.readFeature(this.WKTString, { featureProjection: 'EPSG:25832', dataProjection: 'EPSG:25832' });
|
|
3187
3190
|
const featureType = feature.getGeometry()?.getType();
|
|
3188
|
-
|
|
3189
|
-
this._confirmService.open({ message: `Den WKT du indlæser er af typen ${featureType} og det er ikke tilladt for denne indstilling`, primaryText: 'Ok', title: 'Advarsel' }).subscribe();
|
|
3190
|
-
return;
|
|
3191
|
-
}
|
|
3192
|
-
this._settingsHelper.getStyle(this.selectedGeometrySetting.style, this.profile.styleRepositoryWorkspace, this.profile.styleRepositoryGeoserver, featureType).subscribe({
|
|
3191
|
+
this._settingsHelper.getStyle(this.selectedDrawItem?.style, this.profile.styleRepositoryWorkspace, this.profile.styleRepositoryGeoserver, featureType).subscribe({
|
|
3193
3192
|
next: featureStyle => {
|
|
3194
3193
|
if (featureType === 'Polygon') {
|
|
3195
3194
|
this.handleFeatureValidation(feature).subscribe({
|
|
@@ -3197,7 +3196,7 @@ class ToolboxComponent {
|
|
|
3197
3196
|
if (result) {
|
|
3198
3197
|
result.forEach(feature => {
|
|
3199
3198
|
feature.setStyle(featureStyle);
|
|
3200
|
-
this._featureHelper.setTypeId(feature, this.
|
|
3199
|
+
this._featureHelper.setTypeId(feature, this.selectedDrawItem?.typeId || '');
|
|
3201
3200
|
this._featureHelper.setId(feature);
|
|
3202
3201
|
});
|
|
3203
3202
|
this._overlap.handleOverlaps(result).pipe(filter(f => !!f)).subscribe({
|
|
@@ -3222,7 +3221,7 @@ class ToolboxComponent {
|
|
|
3222
3221
|
}
|
|
3223
3222
|
else {
|
|
3224
3223
|
feature.setStyle(featureStyle);
|
|
3225
|
-
this._featureHelper.setTypeId(feature, this.
|
|
3224
|
+
this._featureHelper.setTypeId(feature, this.selectedDrawItem?.typeId || '');
|
|
3226
3225
|
this._featureHelper.setId(feature);
|
|
3227
3226
|
this._zoomService.zoomToFeatures([feature]);
|
|
3228
3227
|
this._drawLayerService.source.addFeature(feature);
|
|
@@ -3335,11 +3334,11 @@ class ToolboxComponent {
|
|
|
3335
3334
|
startDraw() {
|
|
3336
3335
|
this.activeMode = 'draw';
|
|
3337
3336
|
// Set the first item as default
|
|
3338
|
-
if (!this.selectedDrawItem) {
|
|
3337
|
+
if (!this.selectedDrawItem && this.drawItems && this.drawItems.length > 0) {
|
|
3339
3338
|
this.selectedDrawItem = this.drawItems[0];
|
|
3339
|
+
// Actually start drawing immediately
|
|
3340
|
+
this._doStartDraw(this.selectedDrawItem);
|
|
3340
3341
|
}
|
|
3341
|
-
// Actually start drawing immediately
|
|
3342
|
-
this._doStartDraw(this.selectedDrawItem);
|
|
3343
3342
|
}
|
|
3344
3343
|
_deleteSelect;
|
|
3345
3344
|
get deleteSelect() {
|
|
@@ -3866,7 +3865,7 @@ class ToolboxComponent {
|
|
|
3866
3865
|
const changeTypeSelect = new Select$1({
|
|
3867
3866
|
// layers: [this._drawLayer!],
|
|
3868
3867
|
layers: [this._drawLayerService.layer],
|
|
3869
|
-
filter: f => !this._featureHelper.isLocked(f) && this._featureHelper.typeId(f) !== this.
|
|
3868
|
+
filter: f => !this._featureHelper.isLocked(f) && this._featureHelper.typeId(f) !== this.selectedDrawItem?.typeId // can't changed locked and cant change to same type
|
|
3870
3869
|
});
|
|
3871
3870
|
this._interactionHelper.setAsTemp(changeTypeSelect);
|
|
3872
3871
|
changeTypeSelect.on('select', evt => {
|
|
@@ -3971,6 +3970,12 @@ class ToolboxComponent {
|
|
|
3971
3970
|
setNewMapDimensions() {
|
|
3972
3971
|
this.map.getTargetElement().style.width = this.mapWidth + 'px';
|
|
3973
3972
|
this.map.getTargetElement().style.height = this.mapHeight + 'px';
|
|
3973
|
+
if (this.mapWidth < 1920 && this.profile.toolboxInitialPosition.includes('højre')) {
|
|
3974
|
+
const offset = this.mapWidth <= 800 ? 80 : (this.mapWidth <= 1280 ? 40 :
|
|
3975
|
+
(this.mapWidth <= 1680 ? 20 : 0));
|
|
3976
|
+
//Map got smaller, push Toolbox to the left
|
|
3977
|
+
this._layoutService.bringElementIntoViewIfNeeded('.toolbox-wrapper', -offset, this.collapsed);
|
|
3978
|
+
}
|
|
3974
3979
|
this.map.updateSize();
|
|
3975
3980
|
}
|
|
3976
3981
|
doPrint() {
|