Skip to content

Commit

Permalink
Merge branch 'feature-233176' of https://github.com/Flexberry/ember-f…
Browse files Browse the repository at this point in the history
…lexberry-gis into feature-233176
  • Loading branch information
ronzhak committed Oct 3, 2023
2 parents 9d2ccc2 + d411234 commit 5021a0c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
16 changes: 14 additions & 2 deletions addon/components/geometry-add-modes/manual.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import layout from '../../templates/components/geometry-add-modes/manual';
import LeafletZoomToFeatureMixin from '../../mixins/leaflet-zoom-to-feature';
import { translationMacro as t } from 'ember-i18n';
import { coordinatesToString } from '../../utils/coordinates-to';
import { getCrsCode } from '../../utils/get-crs-by-name';
import { getCrsCode, getCrsByName } from '../../utils/get-crs-by-name';

/**
Component's CSS-classes names.
Expand Down Expand Up @@ -71,6 +71,8 @@ let FlexberryGeometryAddModeManualComponent = Ember.Component.extend(LeafletZoom
*/
_crs: null,

_layerCrs: null,

/**
Added coordinates.
Expand Down Expand Up @@ -109,6 +111,9 @@ let FlexberryGeometryAddModeManualComponent = Ember.Component.extend(LeafletZoom
*/
coordinatesTypeGeometryError: false,

availableCoordinateReferenceSystemsCodes: null,
displayCaptionsDD: false,

/**
Flag to display line error.
Expand Down Expand Up @@ -145,6 +150,8 @@ let FlexberryGeometryAddModeManualComponent = Ember.Component.extend(LeafletZoom
return;
}

// Сохраняем выбранную СК при добавлении объекта.
this.set('_layerCrs', this.get('_crs'));
this.set('_crs', settings.layerCRS);

let layer = this.get('layer');
Expand Down Expand Up @@ -174,7 +181,12 @@ let FlexberryGeometryAddModeManualComponent = Ember.Component.extend(LeafletZoom
return;
}

let baseCrs = this.get('settings.layerCRS');
let baseCrs = this.get('_crs');
const _layerCrsCode = this.get('_layerCrs.code');
if (!Ember.isNone(_layerCrsCode)) {
baseCrs = getCrsByName(_layerCrsCode, this).get('crs');
}

let coordinates = layer.toProjectedGeoJSON(baseCrs).geometry.coordinates;

const str = coordinatesToString(coordinates);
Expand Down
9 changes: 0 additions & 9 deletions addon/components/layers-dialogs/tabs/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,6 @@ export default Ember.Component.extend(
_this.set('_bboxMapIsLoading', false);
});
this.set('_activeTab', 'main-tab');

this.set('availableCoordinateReferenceSystemsCodes', {
'EPSG:3857': 'WGS 84 / Pseudo-Mercator (EPSG:3857)',
'EPSG:4326': 'WGS 84 (EPSG:4326)',
'EPSG:32640': 'WGS 84 / UTM zone 40N (EPSG:32640)',
'EPSG:59001': 'МСК-59 зона 1 (EPSG:59001)',
'EPSG:59002': 'МСК-59 зона 2 (EPSG:59002)',
'EPSG:59003': 'МСК-59 зона 3 (EPSG:59003)'
});
},

actions: {
Expand Down
2 changes: 2 additions & 0 deletions addon/templates/components/geometry-add-modes/manual.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
crsCaption=crsFieldLabel
coordinateReferenceSystem=_crs
_coordinateReferenceSystemCode=_crsCode
availableCoordinateReferenceSystemsCodes=availableCoordinateReferenceSystemsCodes
displayCaptionsDD=displayCaptionsDD
}}
</div>
</div>
Expand Down
4 changes: 1 addition & 3 deletions addon/templates/components/layers-dialogs/tabs/main.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@
{{#if _crsSettingsAreAvailableForType}}
<div class="ui bottom attached tab segment {{if (eq _activeTab "crs-tab") "active"}}" data-tab="crs-tab">
{{flexberry-edit-crs
coordinateReferenceSystem=_layer.coordinateReferenceSystem
availableCoordinateReferenceSystemsCodes=availableCoordinateReferenceSystemsCodes
displayCaptionsDD=true
coordinateReferenceSystem=_layer.coordinateReferenceSystem
}}
</div>
{{/if}}
Expand Down

0 comments on commit 5021a0c

Please sign in to comment.