diff --git a/lib/index.js b/lib/index.js index ae741997..9e5a85d5 100644 --- a/lib/index.js +++ b/lib/index.js @@ -76,6 +76,7 @@ function getFooterNode() { * @param {String} [options.worldview="us"] Filter results to geographic features whose characteristics are defined differently by audiences belonging to various regional, cultural, or political groups. * @param {Boolean} [options.enableGeolocation=false] If `true` enable user geolocation feature. * @param {('address'|'street'|'place'|'country')} [options.addressAccuracy="street"] The accuracy for the geolocation feature with which we define the address line to fill. The browser API returns the user's position with accuracy, and sometimes we can get the neighbor's address. To prevent receiving an incorrect address, you can reduce the accuracy of the definition. + * @param {String} [options.noResultsLabel="No results found"] Text to display if no results have been found. * @example * var geocoder = new MapboxGeocoder({ accessToken: mapboxgl.accessToken }); * map.addControl(geocoder); @@ -888,7 +889,7 @@ MapboxGeocoder.prototype = { }, _renderNoResults: function(){ - var errorMessage = "
No results found
"; + var errorMessage = `
${this.options.noResultsLabel || 'No results found'}
`; this._renderMessage(errorMessage); },