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

feat(context): save layer opacity in db #1439

Merged
merged 3 commits into from
Oct 13, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions packages/context/src/lib/context-manager/shared/context.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import {
StorageService
} from '@igo2/core';
import type {
AnyLayerOptions,
IgoMap,
Layer,
LayerOptions,
VectorLayerOptions,
VectorTileLayerOptions
VectorTileLayerOptions,
Copy link
Member

Choose a reason for hiding this comment

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

extra comma

} from '@igo2/geo';
import { ExportService } from '@igo2/geo';
import { ObjectUtils, uuid } from '@igo2/utils';
Expand Down Expand Up @@ -451,7 +451,7 @@ export class ContextService {
'EPSG:4326'
);

const context = {
const context: DetailedContext = {
uri: uuid(),
title: '',
scope: 'private',
Expand Down Expand Up @@ -485,16 +485,17 @@ export class ContextService {
}

let i = 0;
for (const l of layers) {
const layer: any = l;
for (const layer of layers) {
const layerOptions: AnyLayerOptions = {
title: layer.options.title,
zIndex: ++i,
visible: layer.visible,
security: layer.options.security,
opacity: layer.opacity
};
const opts = {
id: layer.options.id ? String(layer.options.id) : undefined,
layerOptions: {
title: layer.options.title,
zIndex: ++i,
visible: layer.visible,
security: layer.security
} as LayerOptions,
layerOptions: layerOptions,
Copy link
Member

Choose a reason for hiding this comment

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

Duplicated, should be simplified as

layerOptions,

sourceOptions: {
type: layer.dataSource.options.type,
params: layer.dataSource.options.params,
Expand All @@ -508,7 +509,12 @@ export class ContextService {
}

context.tools = this.tools.map((tool) => {
return { id: String(tool.id), global: tool.global };
return {
id: String(tool.id),
global: tool.global,
name: tool.name,
component: tool.component
Copy link
Member

Choose a reason for hiding this comment

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

pourquoi? je ne comprends pas la raison de passer le tool.component

Copy link
Collaborator

Choose a reason for hiding this comment

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

@aziz-access nous sommes p-t en présence d'un Partial?

};
});

return context;
Expand Down