mapricot 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -37,7 +37,7 @@ Methods are grouped by product, the same way as the API's paths. Each returns th
37
37
  | `client.places.get(id, { lang })` | [`GET /places/v1/{id}`](https://mapricot.com/docs/places/#look-up-a-saved-place) |
38
38
  | `client.routing.route(waypoints, { mode, geometries, steps, lang, costing })` | [`POST /routing/v1/route`](https://mapricot.com/docs/routing/#get-a-route) |
39
39
  | `client.routing.optimize(waypoints, { mode, geometries, steps, lang, costing })` | [`POST /routing/v1/optimize`](https://mapricot.com/docs/routing/#optimize-the-order-of-stops) |
40
- | `client.routing.isochrone(location, minutes, { mode, costing })` | [`POST /routing/v1/isochrone`](https://mapricot.com/docs/routing/#get-an-isochrone) |
40
+ | `client.routing.isochrone(location, minutes, { mode, costing, generalize })` | [`POST /routing/v1/isochrone`](https://mapricot.com/docs/routing/#get-an-isochrone) |
41
41
  | `client.ipGeolocation.lookup(ip)` | [`GET /ip-geolocation/v1/{ip}`](https://mapricot.com/docs/ip-geolocation/#look-up-an-address) |
42
42
  | `client.account()` | `GET /account`, which checks a key and is never billed |
43
43
 
@@ -75,6 +75,8 @@ const area = await client.routing.isochrone({ lat: 45.5189, lon: -122.6793 }, [5
75
75
  map.addSource("reach", { type: "geojson", data: area });
76
76
  ```
77
77
 
78
+ `generalize` smooths each outline to within that many meters, from 10 to 5000, so it has fewer points. The API picks it from the travel time when you leave it out. A long drive's outlines are detailed and large, and `generalize: 300` makes them much smaller while keeping their shape at city scale.
79
+
78
80
  Pass `steps: true` and each leg's `steps` has its turn-by-turn directions: an `instruction`, its distance and time, and its `lat` and `lon`. They're in English unless you pass `lang`, such as `lang: "fr"`.
79
81
 
80
82
  `costing` changes how a route, optimized route, or isochrone picks its roads, with Valhalla's [costing options](https://mapricot.com/docs/routing/#costing-options) for the mode, such as `{ useTolls: 0, useHighways: 0 }` to drive avoiding tolls and highways where it can.
package/dist/index.d.ts CHANGED
@@ -218,6 +218,7 @@ export declare class Mapricot {
218
218
  isochrone: (location: Point, minutes: number[], { signal, ...options }?: RequestOptions & {
219
219
  mode?: "drive" | "walk" | "bicycle";
220
220
  costing?: Costing;
221
+ generalize?: number;
221
222
  }) => Promise<Isochrones>;
222
223
  };
223
224
  readonly ipGeolocation: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mapricot",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Official client for the Mapricot API: geocoding, places, routing, and IP geolocation.",
5
5
  "keywords": [
6
6
  "geocoding",