Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added BackgroundLayer model #581

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from
Open

Conversation

viatkinviatkin
Copy link
Contributor

@viatkinviatkin viatkinviatkin commented Mar 15, 2022

  • Maplayer background settings moved to BackgroundLayer model
  • Removed logic that filters maplayers by canBeBackground=true property

Copy link
Member

@kuzkok kuzkok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Где-то должна быть загрузка подложек в роуте edit-map

@@ -161,10 +161,6 @@ export default EditFormRoute.extend({
let hierarchy = this.sortLayersByIndex(rootLayers);
model.set('hierarchy', hierarchy);

let backgroundLayers = Ember.A();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут весь этот метод был добавлен для того чтобы подложки была возможность отфильтровать - посмотри ПР где он добавлен, и убери его совсем.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправлено


this.setLayerCategories(model, layers);
this.getBackgroundLayers().then(backgroundLayers => controller.set('backgroundLayers', backgroundLayers));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

при вычитке модели должны вычитываться, и там же проставлятся в свойство, и должно ждать пока не вычитаются

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправлено

boundingBox: {
__caption__: 'boundingBox'
},
securityKey: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это поле мне кажется тут не надо

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправлено

if (!Ember.isNone(layersInTree)) {
layersInTree.addObject(mapLayer);
}
}

let rootArray = this.get('mapLayer');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а как оно теперь в дерево слоев попадает? Дерево слоев по идее в model.hierarchy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Раньше дерево слоев лежало в model.otherlayers (отфильтрованные слои из model.hierarchy по canbebackground=false), подложки в model.backgroundLayers. Сейчас дерево слоев - это model.hierarchy, так как все слои с canbebackground=false удалены.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

об этом и пишу. Надо сделать чтоб добавлялось в model.hierarchy

Copy link
Contributor Author

@viatkinviatkin viatkinviatkin Apr 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Они попадают же в дерево слоев?

const layers = this.get('hierarchy');
layers.addObject(mapLayer);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

все ок, я проглядела эту строчку

let secondaryParentLayerPath = primaryParentLayerPath.indexOf('hierarchy') !== -1 ? 'model.otherLayers' : 'model.hierarchy';
let backgroundLayerPath = 'model.backgroundLayers';
let secondaryParentLayerPath = 'model.hierarchy';
let backgroundLayerPath = 'backgroundLayers';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я вот тут немного не поняла, почему ушла 'model'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, это ошибка. Сначала клал подложки в свойство контроллера после загрузки модели, сейчас они загружаются вместе с моделью и лежат в model.backgroundLayers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants