@lbdudc/gp-gis-dsl 0.2.4 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,54 +1,54 @@
1
- {
2
- "name": "@lbdudc/gp-gis-dsl",
3
- "version": "0.2.4",
4
- "homepage": "https://github.com/lbdudc/gis-dsl#readme",
5
- "repository": {
6
- "type": "git",
7
- "url": "git+https://github.com/lbdudc/gis-dsl.git"
8
- },
9
- "description": "A library that parses a DSL instance and generates the spec for the web-based GIS SPL.",
10
- "bin": {
11
- "gis-dsl": "src/cli.js"
12
- },
13
- "main": "src/index.js",
14
- "type": "module",
15
- "author": "Álex Cortiñas",
16
- "dependencies": {
17
- "antlr4": "^4.13.0",
18
- "meow": "^12.0.1",
19
- "mocha": "^10.2.0"
20
- },
21
- "devDependencies": {
22
- "eslint": "^8.54.0",
23
- "eslint-config-prettier": "^9.0.0",
24
- "eslint-plugin-prettier": "^5.0.1",
25
- "husky": "^8.0.3",
26
- "lint-staged": "^15.1.0",
27
- "npm-run-all": "^4.1.5",
28
- "prettier": "^3.1.0",
29
- "strip-bom": "^5.0.0"
30
- },
31
- "keywords": [
32
- "gis",
33
- "dsl"
34
- ],
35
- "license": "MIT",
36
- "lint-staged": {
37
- "*.{json,md,yml}": "prettier --write",
38
- "*.{js}": [
39
- "eslint --fix",
40
- "prettier --write"
41
- ]
42
- },
43
- "scripts": {
44
- "build-grammar": "antlr -Dlanguage=JavaScript -lib grammar -o src/lib -visitor -Xexact-output-dir grammar/GISGrammar.g4",
45
- "eslint": "eslint --ext js src",
46
- "eslint:fix": "eslint --ext js --fix src",
47
- "lint": "npm-run-all eslint prettier",
48
- "lint:fix": "npm-run-all eslint:fix prettier:fix",
49
- "prettier": "prettier --check --ignore-unknown src",
50
- "prettier:fix": "prettier --write --ignore-unknown src",
51
- "prepare": "husky install",
52
- "test": "mocha --ui qunit"
53
- }
54
- }
1
+ {
2
+ "name": "@lbdudc/gp-gis-dsl",
3
+ "version": "0.2.6",
4
+ "homepage": "https://github.com/lbdudc/gis-dsl#readme",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/lbdudc/gis-dsl.git"
8
+ },
9
+ "description": "A library that parses a DSL instance and generates the spec for the web-based GIS SPL.",
10
+ "bin": {
11
+ "gis-dsl": "src/cli.js"
12
+ },
13
+ "main": "src/index.js",
14
+ "type": "module",
15
+ "author": "Álex Cortiñas",
16
+ "dependencies": {
17
+ "antlr4": "^4.13.0",
18
+ "meow": "^12.0.1",
19
+ "mocha": "^10.2.0"
20
+ },
21
+ "devDependencies": {
22
+ "eslint": "^8.54.0",
23
+ "eslint-config-prettier": "^9.0.0",
24
+ "eslint-plugin-prettier": "^5.0.1",
25
+ "husky": "^8.0.3",
26
+ "lint-staged": "^15.1.0",
27
+ "npm-run-all": "^4.1.5",
28
+ "prettier": "^3.1.0",
29
+ "strip-bom": "^5.0.0"
30
+ },
31
+ "keywords": [
32
+ "gis",
33
+ "dsl"
34
+ ],
35
+ "license": "MIT",
36
+ "lint-staged": {
37
+ "*.{json,md,yml}": "prettier --write",
38
+ "*.{js}": [
39
+ "eslint --fix",
40
+ "prettier --write"
41
+ ]
42
+ },
43
+ "scripts": {
44
+ "build-grammar": "antlr -Dlanguage=JavaScript -lib grammar -o src/lib -visitor -Xexact-output-dir grammar/GISGrammar.g4",
45
+ "eslint": "eslint --ext js src",
46
+ "eslint:fix": "eslint --ext js --fix src",
47
+ "lint": "npm-run-all eslint prettier",
48
+ "lint:fix": "npm-run-all eslint:fix prettier:fix",
49
+ "prettier": "prettier --check --ignore-unknown src",
50
+ "prettier:fix": "prettier --write --ignore-unknown src",
51
+ "prepare": "husky install",
52
+ "test": "mocha --ui qunit"
53
+ }
54
+ }
package/src/GISVisitor.js CHANGED
@@ -276,18 +276,21 @@ class Visitor extends GISGrammarVisitor {
276
276
  aux = ctx.getChild(i);
277
277
  auxEntityName = aux.getChild(0).getText();
278
278
  entity = this.store.getCurrentProduct().getEntity(auxEntityName);
279
-
280
- if (!entity) {
281
- throw `ERROR: entity ${auxEntityName} required by layer ${id} does not exists!!`;
282
- }
283
-
284
279
  styleName = aux.getChild(1).getText();
285
280
  style = this.store.getCurrentProduct().getStyle(styleName);
286
- if (!style) {
287
- throw `Style ${aux.getChild(1).getText()} does not exist!!!`;
281
+
282
+ if (entity) {
283
+ layer.addSubLayer(entity.name, styleName);
284
+ } else {
285
+ // GeoTIFF case: no associated entity exists
286
+ const normalizedId = id
287
+ .replace(/Layer$/, "")
288
+ .replace(/^(\d+)([A-Z][a-z]+)/, "$1_$2")
289
+ .toLowerCase();
290
+ layer.addSubLayer(normalizedId, null);
288
291
  }
289
- layer.addSubLayer(entity.name, styleName);
290
292
  }
293
+
291
294
  this.log(`visitCreateWmsLayer ${id} - ${label}`);
292
295
 
293
296
  this.store.getCurrentProduct().addLayer(layer);
package/src/features.js CHANGED
@@ -41,6 +41,7 @@ export default [
41
41
  "MV_T_InformationMode",
42
42
  "MV_T_MeasureControl",
43
43
  "MV_T_ZoomWindow",
44
+ "MV_T_ViewMapAsList",
44
45
  "DM_DataInput",
45
46
  "DM_DI_DataFeeding",
46
47
  "DM_DI_DF_Shapefile",
@@ -16,8 +16,8 @@ export default class WMSLayer {
16
16
  addSubLayer(entityId, style) {
17
17
  this.list = entityId;
18
18
  this.layers.push(entityId);
19
+ if (style) this.availableStyles.push(style);
19
20
  this.defaultStyles = style;
20
- this.availableStyles.push(style);
21
21
  }
22
22
 
23
23
  toString() {