-
Notifications
You must be signed in to change notification settings - Fork 7
[siteplan] show red yellow comparism also in non-developer mode #1259
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 9 commits
f847e99
0fef519
0bc58b1
bb11610
3916959
b6f1559
06b0464
78b1226
5c64533
e9a0a59
82245c4
b920443
9a39ee3
4b973ab
9ecab5d
9c22af3
9c7da4d
493bde2
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 |
|---|---|---|
|
|
@@ -114,15 +114,13 @@ export default class FeatureService extends Vue { | |
| unsubscribe: SubscribeOptions | undefined | ||
| map: Map = store.state.map | ||
| model: SiteplanModel | null = null | ||
| developmentOptions = false | ||
| svgService: SvgService = new SvgService(axios) | ||
| listFeature: ILageplanFeature[] = [] | ||
| inLODView = false | ||
| collisionService = new CollisionService(this.map) | ||
|
|
||
| mounted (): void { | ||
| this.createLayers() | ||
| this.developmentOptions = Configuration.developmentMode() | ||
| this.loadModel() | ||
| store.subscribe((m, s) => { | ||
| if (m.type === 'setSheetCutCRS') { | ||
|
|
@@ -221,7 +219,7 @@ export default class FeatureService extends Vue { | |
| ] | ||
| .map(state => featureClass.getFeatures(state)) | ||
| .flat() | ||
| .map(feature => featureClass.setFeatureColor(feature)) | ||
| .map(feature => featureClass.setFeatureColor(feature, SiteplanColorValue.COLOR_UNCHANGED_PLANNING)) | ||
| case TableType.FINAL: | ||
| return [ | ||
| model.commonState, | ||
|
|
@@ -230,40 +228,32 @@ export default class FeatureService extends Vue { | |
| ] | ||
| .map(state => featureClass.getFeatures(state)) | ||
| .flat() | ||
| .map(feature => featureClass.setFeatureColor(feature)) | ||
| .map(feature => featureClass.setFeatureColor(feature, SiteplanColorValue.COLOR_UNCHANGED_PLANNING)) | ||
| case TableType.DIFF:{ | ||
| if (Configuration.developmentMode()) { | ||
| // Temporary demo: Only show red/yellow in development mode | ||
| const compareState = featureClass.compareChangedState( | ||
| model.changedInitialState, | ||
| model.changedFinalState | ||
| ) | ||
| return [ | ||
| featureClass | ||
| .getFeatures(model.commonState) | ||
| .map(feature => featureClass.setFeatureColor(feature)), | ||
| compareState, | ||
| featureClass | ||
| .getFeatures(model.finalState) | ||
| .map(feature => | ||
| featureClass.setFeatureColor( | ||
| feature, | ||
| SiteplanColorValue.COLOR_ADDED | ||
| )), | ||
| featureClass | ||
| .getFeatures(model.initialState) | ||
| .map(feature => | ||
| featureClass.setFeatureColor( | ||
| feature, | ||
| SiteplanColorValue.COLOR_REMOVED | ||
| )) | ||
| ].flat() | ||
| } | ||
|
|
||
| return [model.commonState, model.finalState, model.changedInitialState] | ||
| .map(state => featureClass.getFeatures(state)) | ||
| .flat() | ||
| .map(feature => featureClass.setFeatureColor(feature)) | ||
| const compareState = featureClass.compareChangedState( | ||
| model.changedInitialState, | ||
| model.changedFinalState | ||
| ) | ||
| return [ | ||
| featureClass | ||
| .getFeatures(model.commonState) | ||
| .map(feature => featureClass.setFeatureColor(feature, SiteplanColorValue.COLOR_UNCHANGED_PLANNING)), | ||
|
||
| compareState, | ||
| featureClass | ||
| .getFeatures(model.finalState) | ||
| .map(feature => | ||
| featureClass.setFeatureColor( | ||
| feature, | ||
| SiteplanColorValue.COLOR_ADDED | ||
| )), | ||
| featureClass | ||
| .getFeatures(model.initialState) | ||
| .map(feature => | ||
| featureClass.setFeatureColor( | ||
| feature, | ||
| SiteplanColorValue.COLOR_REMOVED | ||
| )) | ||
| ].flat() | ||
| } | ||
| } | ||
| } catch (e) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,7 +84,8 @@ export default class SvgDraw { | |
| centerText: boolean, | ||
| fontSize: number, | ||
| rotate?: number, | ||
| centerVertical?: boolean | ||
| centerVertical?: boolean, | ||
| applyColor?: boolean | ||
| ): Element { | ||
| const labelsvg = document.createElement('text') | ||
| if (!label) { | ||
|
|
@@ -94,6 +95,12 @@ export default class SvgDraw { | |
| labelsvg.setAttribute('id', 'label') | ||
| labelsvg.setAttribute('font-size', fontSize.toString()) | ||
| labelsvg.setAttribute('font-family', 'siteplanfont') | ||
| if (label.color && applyColor) { | ||
| const rgbColorString = `rgb(${label.color[0]}, ${label.color[1]}, ${label.color[2]})` | ||
| labelsvg.setAttribute('fill', rgbColorString) | ||
| labelsvg.setAttribute('stroke', rgbColorString) | ||
| } | ||
|
||
|
|
||
| labelsvg.setAttribute('stroke-width', '0.2') | ||
| labelsvg.setAttribute('style', 'writing-mode: vertical-rl;') | ||
| const textAnchor = this.getTextAnchor(centerText, label) | ||
|
|
@@ -255,6 +262,7 @@ export default class SvgDraw { | |
| true, | ||
| 13, | ||
| 90, | ||
| true, | ||
| true | ||
| )) | ||
| return new SvgElement('RouteMarker', svg, [], null, []) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.