From e157749de33d9d7fb3f37dc53c476f2ed7f02f4c Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Tue, 22 Sep 2015 13:57:53 -0400 Subject: [PATCH] Use _.contains instead of .indexOf --- helper/geojsonify.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helper/geojsonify.js b/helper/geojsonify.js index 94b41b84..ca499613 100644 --- a/helper/geojsonify.js +++ b/helper/geojsonify.js @@ -35,10 +35,10 @@ function lookupSource(src) { */ function lookupLayer(src) { if (src._type === 'geoname') { - if (src.category && src.category.indexOf('admin') !== -1) { - if (src.category.indexOf('admin:city') !== -1) { return 'locality'; } - if (src.category.indexOf('admin:admin1') !== -1) { return 'region'; } - if (src.category.indexOf('admin:admin2') !== -1) { return 'county'; } + if (_.contains(src.category, 'admin')) { + if (_.contains(src.category, 'admin:city')) { return 'locality'; } + if (_.contains(src.category, 'admin:admin1')) { return 'region'; } + if (_.contains(src.category, 'admin:admin2')) { return 'county'; } return 'neighbourhood'; // this could also be 'local_admin' }