Theme format refactoring: move line properties into a seperate lineRendering configuration
This commit is contained in:
parent
7b9836f273
commit
a041fbf050
50 changed files with 876 additions and 63 deletions
|
@ -7,6 +7,8 @@
|
|||
import ScriptUtils from "./ScriptUtils";
|
||||
import {writeFileSync} from "fs";
|
||||
import {LayerConfigJson} from "../Models/ThemeConfig/Json/LayerConfigJson";
|
||||
import LineRenderingConfig from "../Models/ThemeConfig/LineRenderingConfig";
|
||||
import LineRenderingConfigJson from "../Models/ThemeConfig/Json/LineRenderingConfigJson";
|
||||
|
||||
/**
|
||||
* In place fix
|
||||
|
@ -26,10 +28,11 @@ function fixLayerConfig(config: LayerConfigJson): void {
|
|||
}
|
||||
}
|
||||
|
||||
if(config.mapRendering === undefined){
|
||||
if(config.mapRendering === undefined || true){
|
||||
// This is a legacy format, lets create a pointRendering
|
||||
let location: ("point"|"centroid")[] = ["point"]
|
||||
if(config.wayHandling === 2){
|
||||
let wayHandling: number = config.wayHandling
|
||||
if(wayHandling === 2){
|
||||
location = ["point", "centroid"]
|
||||
}
|
||||
config.mapRendering = [
|
||||
|
@ -43,6 +46,27 @@ function fixLayerConfig(config: LayerConfigJson): void {
|
|||
}
|
||||
]
|
||||
|
||||
if(wayHandling !== 1){
|
||||
const lineRenderConfig = <LineRenderingConfigJson>{
|
||||
color: config["color"],
|
||||
width: config["width"],
|
||||
dashArray: config["dashArray"]
|
||||
}
|
||||
if(Object.keys(lineRenderConfig).length > 0){
|
||||
config.mapRendering.push(lineRenderConfig)
|
||||
}
|
||||
}
|
||||
/*delete config["color"]
|
||||
delete config["width"]
|
||||
delete config["dashArray"]
|
||||
|
||||
delete config["icon"]
|
||||
delete config["iconOverlays"]
|
||||
delete config["label"]
|
||||
delete config["iconSize"]
|
||||
delete config["rotation"]
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue