-
Notifications
You must be signed in to change notification settings - Fork 7
HTM-1886 | HTM-1883: Enable choosing a layer style in the viewer when configured #1141
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
Changes from all 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 |
|---|---|---|
|
|
@@ -43,3 +43,7 @@ | |
| .not-visible-on-map .icon { | ||
| color: var(--text-color); | ||
| } | ||
|
|
||
| .style-radio-button { | ||
| font-style: italic; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,3 +58,7 @@ | |
| tm-toc-filter-input { | ||
| display: block; | ||
| } | ||
|
|
||
| .toc-tree ::ng-deep .tree-node-checkbox { | ||
| align-self: flex-start; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,14 +7,16 @@ import { map, tap } from 'rxjs/operators'; | |
| import { MenubarService } from '../../menubar'; | ||
| import { TocMenuButtonComponent } from '../toc-menu-button/toc-menu-button.component'; | ||
| import { Store } from '@ngrx/store'; | ||
| import { AppLayerModel, AuthenticatedUserService, BaseComponentTypeEnum, TocConfigModel } from '@tailormap-viewer/api'; | ||
| import { AppLayerModel, AuthenticatedUserService, BaseComponentTypeEnum, TocConfigModel, WmsStyleModel } from '@tailormap-viewer/api'; | ||
| import { MapService } from '@tailormap-viewer/map'; | ||
| import { selectFilteredLayerTree, selectFilterEnabled } from '../state/toc.selectors'; | ||
| import { toggleFilterEnabled } from '../state/toc.actions'; | ||
| import { | ||
| select3dTilesLayers, selectEditableLayers, selectIn3dView, selectLayersWithoutWebMercatorIds, selectSelectedNode, selectSelectedNodeId, | ||
| } from '../../../map/state/map.selectors'; | ||
| import { moveLayerTreeNode, setLayerVisibility, toggleLevelExpansion, toggleSelectedLayerId } from '../../../map/state/map.actions'; | ||
| import { | ||
| moveLayerTreeNode, setLayerStyle, setLayerVisibility, toggleLevelExpansion, toggleSelectedLayerId, | ||
| } from '../../../map/state/map.actions'; | ||
| import { selectFilteredLayerIds } from '../../../state/filter-state/filter.selectors'; | ||
| import { setEditActive, setSelectedEditLayer } from '../../edit/state/edit.actions'; | ||
| import { ComponentConfigHelper } from '../../../shared'; | ||
|
|
@@ -164,4 +166,9 @@ export class TocComponent implements OnInit, OnDestroy { | |
| this.store$.dispatch(setSelectedEditLayer( { layer })); | ||
| this.store$.dispatch(setEditActive({ active: true })); | ||
| } | ||
|
|
||
| protected changeStyle({ layerId, selectedStyle }: { layerId: string; selectedStyle: WmsStyleModel }) { | ||
| this.store$.dispatch(setLayerStyle({ layerId, selectedStyleName: selectedStyle.name })); | ||
| this.mapService.setLayerStyle(layerId, selectedStyle.name); | ||
|
Collaborator
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. Dont think this should be needed - since this value is changing in the state this could be picked up by the application map service already |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,6 +65,13 @@ export class MapService { | |
| }); | ||
| } | ||
|
|
||
| public setLayerStyle(layerId: string, styleName: string) { | ||
|
Collaborator
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. Not needed I think |
||
| this.getLayerManager$().pipe(take(1)) | ||
| .subscribe(manager => { | ||
| manager.setLayerStyle(layerId, styleName); | ||
| }); | ||
| } | ||
|
|
||
| public getLayerManager$(): Observable<LayerManagerModel> { | ||
| return this.map.getLayerManager$(); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.