Skip to content

Commit

Permalink
Merge pull request #434 from mapbox/ip-proximity
Browse files Browse the repository at this point in the history
Add 'ip' as valid value for geocoding proximity parameter
  • Loading branch information
mpothier authored Mar 3, 2022
2 parents f8cb18a + a422353 commit 1eab68b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

- **Revert:** add `driving-traffic` profile to Isochrone service.

## 0.13.3

**Add:** add `ip` as valid value for `proximity` parameter in the geocoding service

## 0.13.2

**Add:** add `fuzzyMatch` and `worldview` parameters to the geocoding service
Expand Down
2 changes: 1 addition & 1 deletion docs/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,7 @@ See the [public documentation][236].
- `config.mode` **(`"mapbox.places"` \| `"mapbox.places-permanent"`)** Either `mapbox.places` for ephemeral geocoding, or `mapbox.places-permanent` for storing results and batch geocoding. (optional, default `"mapbox.places"`)
- `config.countries` **[Array][210]<[string][201]>?** Limits results to the specified countries.
Each item in the array should be an [ISO 3166 alpha 2 country code][237].
- `config.proximity` **[Coordinates][232]?** Bias local results based on a provided location.
- `config.proximity` **([Coordinates][232] \| `"ip"`)?** Bias local results based on a provided coordinate location or a user's IP address.
- `config.types` **[Array][210]<(`"country"` \| `"region"` \| `"postcode"` \| `"district"` \| `"place"` \| `"locality"` \| `"neighborhood"` \| `"address"` \| `"poi"` \| `"poi.landmark"`)>?** Filter results by feature types.
- `config.autocomplete` **[boolean][202]** Return autocomplete results or not. (optional, default `true`)
- `config.bbox` **[BoundingBox][238]?** Limit results to a bounding box.
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mapbox/mapbox-sdk",
"version": "0.13.2",
"version": "0.13.3",
"description": "JS SDK for accessing Mapbox APIs",
"main": "index.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions services/geocoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var featureTypes = [
* @param {'mapbox.places'|'mapbox.places-permanent'} [config.mode="mapbox.places"] - Either `mapbox.places` for ephemeral geocoding, or `mapbox.places-permanent` for storing results and batch geocoding.
* @param {Array<string>} [config.countries] - Limits results to the specified countries.
* Each item in the array should be an [ISO 3166 alpha 2 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
* @param {Coordinates} [config.proximity] - Bias local results based on a provided location.
* @param {Coordinates|'ip'} [config.proximity] - Bias local results based on a provided coordinate location or a user's IP address.
* @param {Array<'country'|'region'|'postcode'|'district'|'place'|'locality'|'neighborhood'|'address'|'poi'|'poi.landmark'>} [config.types] - Filter results by feature types.
* @param {boolean} [config.autocomplete=true] - Return autocomplete results or not.
* @param {BoundingBox} [config.bbox] - Limit results to a bounding box.
Expand Down Expand Up @@ -96,7 +96,7 @@ Geocoding.forwardGeocode = function(config) {
query: v.required(v.string),
mode: v.oneOf('mapbox.places', 'mapbox.places-permanent'),
countries: v.arrayOf(v.string),
proximity: v.coordinates,
proximity: v.oneOf(v.coordinates, 'ip'),
types: v.arrayOf(v.oneOf(featureTypes)),
autocomplete: v.boolean,
bbox: v.arrayOf(v.number),
Expand Down

0 comments on commit 1eab68b

Please sign in to comment.