We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a88b7f commit d229606Copy full SHA for d229606
lib/index.js
@@ -692,7 +692,8 @@ MapboxGeocoder.prototype = {
692
693
config = extend(config,
694
this.options.version === 'v6' ? { longitude: coords[0], latitude: coords[1]} : { query: coords },
695
- !config.types || config.types.length !== 1 ? {limit: 1 } : {}
+ !config.types && config.limit && config.limit !== 1 ? {limit: 1} : {}, // force limit=1 if no types and limit > 1
696
+ config.types && config.types.length !== 1 ? {limit: 1 } : {} // force limit=1 if multiple types
697
);
698
} break;
699
case GEOCODE_REQUEST_TYPE.FORWARD: {
0 commit comments