feat: map_settings

This commit is contained in:
Artemy 2024-01-24 09:36:42 +03:00
parent e12d8f54d4
commit f10f91c676
6 changed files with 1109 additions and 2 deletions

23
.eslintrc.js Normal file
View file

@ -0,0 +1,23 @@
module.exports = {
env: {
commonjs: true,
es2021: true,
node: true,
},
extends: "eslint:recommended",
overrides: [
{
env: {
node: true,
},
files: [".eslintrc.{js,cjs}"],
parserOptions: {
sourceType: "script",
},
},
],
parserOptions: {
ecmaVersion: "latest",
},
rules: {},
};

1068
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{ {
"name": "cimengine-build-tools", "name": "cimengine-build-tools",
"version": "1.5.0", "version": "1.6.0",
"description": "Geojson data processing tools for CIMEngine", "description": "Geojson data processing tools for CIMEngine",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@ -35,5 +35,8 @@
"md5": "^2.3.0", "md5": "^2.3.0",
"yaml": "^2.3.1", "yaml": "^2.3.1",
"yargs": "^17.7.2" "yargs": "^17.7.2"
},
"devDependencies": {
"eslint": "^8.56.0"
} }
} }

View file

@ -32,7 +32,7 @@ let config = YAML.parse(fs.readFileSync(geofixConf.config, "utf-8"));
let features = []; let features = [];
for (country of layers) { for (let country of layers) {
let properties = countries_properties[country] || {}; let properties = countries_properties[country] || {};
let co_features = JSON.parse( let co_features = JSON.parse(

View file

@ -31,6 +31,10 @@ let roadSizesTemplate = fs.readFileSync(
path.join(__dirname, "file_templates", "roadSizes.json") path.join(__dirname, "file_templates", "roadSizes.json")
); );
let settingsTemplate = fs.readFileSync(
path.join(__dirname, "file_templates", "map_settings.json")
);
let name = args.name || "cime-project"; let name = args.name || "cime-project";
let currpath = path.join(process.cwd(), name, "src"); let currpath = path.join(process.cwd(), name, "src");
@ -43,6 +47,10 @@ fs.writeFileSync(path.join(currpath, "config.yaml"), configTemplate);
fs.writeFileSync(path.join(currpath, "properties.yaml"), propertiesTemplate); fs.writeFileSync(path.join(currpath, "properties.yaml"), propertiesTemplate);
fs.writeFileSync(path.join(currpath, "layers.yaml"), layersTemplate); fs.writeFileSync(path.join(currpath, "layers.yaml"), layersTemplate);
fs.writeFileSync(path.join(currpath, "countries.json"), countriesTemplate); fs.writeFileSync(path.join(currpath, "countries.json"), countriesTemplate);
fs.writeFileSync(
path.join(currpath, "..", "map_settings.json"),
settingsTemplate
);
fs.writeFileSync(path.join(currpath, "roads", "sizes.json"), roadSizesTemplate); fs.writeFileSync(path.join(currpath, "roads", "sizes.json"), roadSizesTemplate);

View file

@ -0,0 +1,5 @@
{
"name": "Map name",
"geoURL": "link to geo.geojson",
"countryInfoURL": "link to countries.json"
}