From 41ee1236d91a6d98d37601c9b0bd8886dcf1bc18 Mon Sep 17 00:00:00 2001 From: Seth Fitzsimmons Date: Tue, 9 May 2017 17:01:49 -0700 Subject: [PATCH] Omit global search UI when no geocoder --- modules/ui/feature_list.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/modules/ui/feature_list.js b/modules/ui/feature_list.js index f04d98e9b5..6faf63233c 100644 --- a/modules/ui/feature_list.js +++ b/modules/ui/feature_list.js @@ -186,16 +186,18 @@ export function uiFeatureList(context) { list.selectAll('.no-results-item .entity-name') .text(noResultsWorldwide ? t('geocoder.no_results_worldwide') : t('geocoder.no_results_visible')); - list.selectAll('.geocode-item') - .data([0]) - .enter().append('button') - .attr('class', 'geocode-item') - .on('click', geocoderSearch) - .append('div') - .attr('class', 'label') - .append('span') - .attr('class', 'entity-name') - .text(t('geocoder.search')); + if (services.geocoder) { + list.selectAll('.geocode-item') + .data([0]) + .enter().append('button') + .attr('class', 'geocode-item') + .on('click', geocoderSearch) + .append('div') + .attr('class', 'label') + .append('span') + .attr('class', 'entity-name') + .text(t('geocoder.search')); + } list.selectAll('.no-results-item') .style('display', (value.length && !results.length) ? 'block' : 'none');