GEOLYTIX/xyz

Layer may not have `layer.params.fields` - crashes iteration

Closed this issue · 0 comments

A layer may not have a fields parameter.
This PR just nullish assigns it to make sure that when the featureFormat is hit, the spread using layer.params.fields does not fail with the error, 'e.params.fields is not iterable'.

The example below does not use any fields as the styling is default and no labels or anything are required.

   {
      "label": "Points",
      "template": {
        "template": "select id, ST_AsText(geom_p_4326) FROM table where id = %{id};",
        "reduce": true,
        "key": "points",
        "dbs": "KFC"
      },
      "type": "vector_layer",
      "key": "points",
      "format": "wkt",
      "srid": "4326",
      "zIndex": 94,
      "query": "points",
      "queryCheck": true,
      "queryparams": {
        "id": true,
        "reduce": true
      },
      "style": {
        "default": {
          "icon": {
            "type": "triangle"
          }
        }
      }
    }