From 0bdf8f34c25d50a97314495a5c14e5b8f59ccc66 Mon Sep 17 00:00:00 2001 From: mpothier <39810086+mpothier@users.noreply.github.com> Date: Thu, 3 Mar 2022 11:50:11 -0800 Subject: [PATCH 1/3] Add 'ip' as valid value for geocoding proximity parameter --- CHANGELOG.md | 4 ++++ docs/services.md | 2 +- services/geocoding.js | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da8e9e4..51aed80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/docs/services.md b/docs/services.md index 7fe047a..fb63abb 100644 --- a/docs/services.md +++ b/docs/services.md @@ -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. diff --git a/services/geocoding.js b/services/geocoding.js index 35e4aae..02f2814 100644 --- a/services/geocoding.js +++ b/services/geocoding.js @@ -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} [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. @@ -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), From 156ad3e946f5c3f149fdce25d95b3280e8be041e Mon Sep 17 00:00:00 2001 From: mpothier <39810086+mpothier@users.noreply.github.com> Date: Thu, 3 Mar 2022 12:02:02 -0800 Subject: [PATCH 2/3] Bump version in package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3aa9d56..2ce22d9 100644 --- a/package.json +++ b/package.json @@ -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": [ From a42235387b884b84db88175a1923e579839f567c Mon Sep 17 00:00:00 2001 From: mpothier <39810086+mpothier@users.noreply.github.com> Date: Thu, 3 Mar 2022 12:02:51 -0800 Subject: [PATCH 3/3] Update package-lock.json --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index a676d20..7cddb3a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@mapbox/mapbox-sdk", - "version": "0.13.2", + "version": "0.13.3", "lockfileVersion": 1, "requires": true, "dependencies": {