bjornd / jvectormap

jvectormap.com
GNU Affero General Public License v3.0
1.38k stars 431 forks source link

Filtering in json config #465

Closed suggy75 closed 4 years ago

suggy75 commented 4 years ago

I'm trying to create a custom map, starting out by just using a very basic config. Every time I try and apply a filter I get an error. Not sure what I'm missing.

[{
  "name": "read_data",
  "file_name": "ne_110m_admin_0_countries_lakes.shp",
  "filter": "continent = \"Europe\""
},
{
  "name": "write_data",
  "format": "jvectormap",
  "file_name": "map.js",
  "params": {
    "code_field": "ISO_A2",
    "name_field": "NAME",
    "name": "world"
  }
}]

results in an error "Europe" not recognised as an available field.

Every config block in the documentation results in an error of some sort.

Running on Mac OS.

suggy75 commented 4 years ago

Turns out it was as simple as updating the filter to 'Europe' instead of \"Europe\"