mirror of
https://github.com/CIMEngine/cimengine-build-tools.git
synced 2024-11-24 13:06:20 +03:00
feat: map_settings
This commit is contained in:
parent
e12d8f54d4
commit
f10f91c676
6 changed files with 1109 additions and 2 deletions
23
.eslintrc.js
Normal file
23
.eslintrc.js
Normal 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
1068
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cimengine-build-tools",
|
||||
"version": "1.5.0",
|
||||
"version": "1.6.0",
|
||||
"description": "Geojson data processing tools for CIMEngine",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
@ -35,5 +35,8 @@
|
|||
"md5": "^2.3.0",
|
||||
"yaml": "^2.3.1",
|
||||
"yargs": "^17.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.56.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ let config = YAML.parse(fs.readFileSync(geofixConf.config, "utf-8"));
|
|||
|
||||
let features = [];
|
||||
|
||||
for (country of layers) {
|
||||
for (let country of layers) {
|
||||
let properties = countries_properties[country] || {};
|
||||
|
||||
let co_features = JSON.parse(
|
||||
|
|
|
@ -31,6 +31,10 @@ let roadSizesTemplate = fs.readFileSync(
|
|||
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 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, "layers.yaml"), layersTemplate);
|
||||
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);
|
||||
|
||||
|
|
5
tools/file_templates/map_settings.json
Normal file
5
tools/file_templates/map_settings.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"name": "Map name",
|
||||
"geoURL": "link to geo.geojson",
|
||||
"countryInfoURL": "link to countries.json"
|
||||
}
|
Loading…
Add table
Reference in a new issue