apple-maps-server-sdk 1.0.9 → 1.1.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
@@ -206,4 +206,202 @@ Before using this API, you must have an [Apple Developer account](https://develo
206
206
 
207
207
 
208
208
 
209
+ ## API
210
+
211
+ #### .geocode(options [object])
212
+
213
+ Fetch geocoded data about an address.
214
+
215
+ **options**: supports keys
216
+ - `q` \[required\] - The address to geocode. IE: 1 Apple Park, Cupertino, CA
217
+ - `limitToCountries` \[optional\] - A comma-separated list of country codes to limit the results to IE: US,CA.
218
+ - `lang` \[optional\] - The language the server should use when returning the response, specified using a BCP 47 language code. IE: en-US.
219
+ - `searchLocation` \[optional\] - A location defined as a hint. Specify the location as a comma-separated string containing the latitude and longitude. IE: 37.78,-122.42.
220
+ - `searchRegion` \[optional\] - A region defined as a hint. Specify the region specified as a comma-separated string that describes the region in the form north-latitude, east-longitude, south-latitude, west-longitude. IE: 38,-122.1,37.5,-122.5.
221
+ - `userLocation` \[optional\] - The location of the user, specified as a comma-separated string that contains the latitude and longitude. IE: 37.78,-122.42.
222
+
223
+ **response**
224
+ ```
225
+ {
226
+ "results": [
227
+ {
228
+ country: string;
229
+ countryCode: string;
230
+ displayMapRegion: {
231
+ eastLongitude: number;
232
+ northLatitude: number;
233
+ southLatitude: number;
234
+ westLongitude: number;
235
+ };
236
+ formattedAddressLines: string[];
237
+ name: string;
238
+ coordinate: {
239
+ latitude: number;
240
+ longitude: number;
241
+ };
242
+ structuredAddress: {
243
+ administrativeArea: string;
244
+ administrativeAreaCode: string;
245
+ areasOfInterest: string[];
246
+ dependentLocalities: string[];
247
+ fullThoroughfare: string;
248
+ locality: string;
249
+ postCode: string;
250
+ subLocality: string;
251
+ subThoroughfare: string;
252
+ thoroughfare: string;
253
+ }
254
+ }
255
+ ]
256
+ }
257
+ ```
258
+
259
+ #### .reverseGeocode(options [object])
260
+
261
+ Fetch reverse geocoded data about coordinates.
262
+
263
+ **options**: supports keys
264
+ - `loc` \[required\] - The coordinate to reverse geocode as a comma-separated string that contains the latitude and longitude. IE: 37.3316851,-122.0300674.
265
+ - `lang` \[optional\] - The language the server should use when returning the response, specified using a BCP 47 language code. IE: en-US.
266
+
267
+ **response**
268
+ ```
269
+ {
270
+ "results": [
271
+ {
272
+ country: string;
273
+ countryCode: string;
274
+ displayMapRegion: {
275
+ eastLongitude: number;
276
+ northLatitude: number;
277
+ southLatitude: number;
278
+ westLongitude: number;
279
+ };
280
+ formattedAddressLines: string[];
281
+ name: string;
282
+ coordinate: {
283
+ latitude: number;
284
+ longitude: number;
285
+ };
286
+ structuredAddress: {
287
+ administrativeArea: string;
288
+ administrativeAreaCode: string;
289
+ areasOfInterest: string[];
290
+ dependentLocalities: string[];
291
+ fullThoroughfare: string;
292
+ locality: string;
293
+ postCode: string;
294
+ subLocality: string;
295
+ subThoroughfare: string;
296
+ thoroughfare: string;
297
+ }
298
+ }
299
+ ]
300
+ }
301
+ ```
302
+
303
+ #### .eta(options [object])
304
+
305
+ Returns the estimated time of arrival (ETA) and distance between starting and ending locations.
306
+
307
+ **options**: supports keys
308
+ - `origin` \[required\] - The starting point for estimated arrival time requests, specified as a comma-separated string that contains the latitude and longitude. IE: 37.331423,-122.030503.
309
+ - `destinations` \[required\] - Destination coordinates represented as pairs of latitude and longitude separated by a vertical bar character (”|”).
310
+ IE: 37.32556561130194,-121.94635203581443|37.44176585512703,-122.17259315798667.
311
+
312
+ The parameter must specify at least one destination coordinate, but no more than 10 destinations. Specify the location as a comma-separated string that contains the latitude and longitude.
313
+ - `transportType` \[optional\] - The mode of transportation to use when estimating arrival times.
314
+
315
+ Default: Automobile
316
+
317
+ Possible values: Automobile, Transit, Walking
318
+ - `departureDate` \[optional\] - The time of departure to use in an estimated arrival time request, in ISO 8601 format in UTC time.
319
+ IE: 2020-09-15T16:42:00Z.
320
+
321
+ If you don’t specify a departure date, the server uses the current date and time when you make the request.
322
+ - `arrivalDate` \[optional\] - The intended time of arrival in ISO 8601 format in UTC time.
323
+
324
+ **response**
325
+ ```
326
+ {
327
+ "etas": [
328
+ {
329
+ destination: {
330
+ latitude: number;
331
+ longitude: number;
332
+ };
333
+ distanceMeters: number;
334
+ expectedTravelTimeSeconds: number;
335
+ staticTravelTimeSeconds: number;
336
+ transportType: "Automobile" | "Transit" | "Walking";
337
+ }
338
+ ]
339
+ }
340
+ ```
341
+
342
+
343
+ #### .search(options [object])
344
+
345
+ Find places by name or by specific search criteria.
346
+
347
+ **options**: supports keys
348
+ - `q` \[required\] - The place to search for. IE: eiffel tower.
349
+ - `excludePoiCategories` \[optional\] - A comma-separated list of strings that describes the points of interest to exclude from the search results. IE: Restaurant,Cafe. See [https://developer.apple.com/documentation/applemapsserverapi/poicategory](https://developer.apple.com/documentation/applemapsserverapi/poicategory) for a list of all possible PoiCategories.
350
+ - `includePoiCategories` \[optional\] - A comma-separated list of strings that describes the points of interest to include in the search results. IE: Restaurant,Cafe. See [https://developer.apple.com/documentation/applemapsserverapi/poicategory](https://developer.apple.com/documentation/applemapsserverapi/poicategory) for a list of all possible PoiCategories.
351
+ - `limitToCountries` \[optional\] - A comma-separated list of ISO ALPHA-2 codes of the countries to limit the results to. IE: US,CA limits the search to the United States and Canada.
352
+ - `resultTypeFilter` \[optional\] - A comma-separated list of strings that describes the kind of result types to include in the response. IE: Poi.
353
+
354
+ Possible values: Poi, Address
355
+ - `lang` \[optional\] - The language the server should use when returning the response. IE: en-US. Defaults to en-US.
356
+ - `searchLocation` \[optional\] - A location defined as a hint. Specify the location as a comma-separated string containing the latitude and longitude. IE: 37.78,-122.42.
357
+ - `searchRegion` \[optional\] - A region defined as a hint. Specify the region specified as a comma-separated string that describes the region in the form north-latitude,east-longitude,south-latitude,west-longitude. IE: 38,-122.1,37.5,-122.5.
358
+ - `userLocation` \[optional\] - The location of the user, specified as a comma-separated string that contains the latitude and longitude. IE: 37.78,-122.42.
359
+
360
+ **response**
361
+ ```
362
+ {
363
+ "displayMapRegion": {
364
+ eastLongitude: number;
365
+ northLatitude: number;
366
+ southLatitude: number;
367
+ westLongitude: number;
368
+ }
369
+ "results": [
370
+ {
371
+ poiCategory: PoiCategory;
372
+ country: string;
373
+ countryCode: string;
374
+ displayMapRegion: {
375
+ eastLongitude: number;
376
+ northLatitude: number;
377
+ southLatitude: number;
378
+ westLongitude: number;
379
+ };
380
+ formattedAddressLines: string[];
381
+ name: string;
382
+ coordinate: {
383
+ latitude: number;
384
+ longitude: number;
385
+ };
386
+ structuredAddress: {
387
+ administrativeArea: string;
388
+ administrativeAreaCode: string;
389
+ areasOfInterest: string[];
390
+ dependentLocalities: string[];
391
+ fullThoroughfare: string;
392
+ locality: string;
393
+ postCode: string;
394
+ subLocality: string;
395
+ subThoroughfare: string;
396
+ thoroughfare: string;
397
+ }
398
+ }
399
+ ]
400
+ }
401
+ ```
402
+
403
+
404
+
405
+
406
+
209
407
 
package/lib/globals.d.ts CHANGED
@@ -50,7 +50,7 @@ export interface GeocodeInput {
50
50
  userLocation?: string;
51
51
  }
52
52
  export interface ReverseGeocodeInput {
53
- q: string;
53
+ loc: string;
54
54
  lang?: string;
55
55
  }
56
56
  export interface ETAInput {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apple-maps-server-sdk",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "description": "An SDK for the Apple Maps Server API",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
package/src/globals.ts CHANGED
@@ -104,7 +104,7 @@ export interface GeocodeInput {
104
104
  }
105
105
 
106
106
  export interface ReverseGeocodeInput {
107
- q: string;
107
+ loc: string;
108
108
  lang?: string;
109
109
  }
110
110