-
Notifications
You must be signed in to change notification settings - Fork 26
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,11 @@ import { | |
StorageService | ||
} from '@igo2/core'; | ||
import type { | ||
AnyLayerOptions, | ||
IgoMap, | ||
Layer, | ||
LayerOptions, | ||
VectorLayerOptions, | ||
VectorTileLayerOptions | ||
VectorTileLayerOptions, | ||
} from '@igo2/geo'; | ||
import { ExportService } from '@igo2/geo'; | ||
import { ObjectUtils, uuid } from '@igo2/utils'; | ||
|
@@ -451,7 +451,7 @@ export class ContextService { | |
'EPSG:4326' | ||
); | ||
|
||
const context = { | ||
const context: DetailedContext = { | ||
uri: uuid(), | ||
title: '', | ||
scope: 'private', | ||
|
@@ -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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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, | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pourquoi? je ne comprends pas la raison de passer le tool.component There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra comma