Skip to content

Commit

Permalink
v1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
iBinh committed Jul 13, 2021
1 parent 11edbe6 commit 0f01166
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Get directions.

- `config` **[Object][31]**
- `config.origin` **[number][32]** Origin coordinate `latitude,longitude`
- `config.destination` **[string][33]** Destination coordinate `latitude,longitude`
- `config.destination` **[string][33]** The destination coordinate string. Split by `;` for more than 2 destinations.
- `config.alternatives` **[boolean][41]** Whether to try to return alternative routes. (optional, default `true`)
- `config.vehicle` **(`"car"` \| `"bike"` \| `"taxi"` \| `"hd"`)** Vehicle type (optional, default `'car'`)

Expand Down
5 changes: 2 additions & 3 deletions services/geocoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Geocoding.reverseGeocode = function(config) {
* const match = response.body;
* });
*/
Geocoding.forwardGeocode = function(config) {
Geocoding.forwardGeocode = function(config) {
v.assertShape({
address: v.required(v.string)
})(config);
Expand All @@ -69,7 +69,6 @@ Geocoding.reverseGeocode = function(config) {
});
};


/**
* Get Place detail
*
Expand All @@ -87,7 +86,7 @@ Geocoding.reverseGeocode = function(config) {
* const match = response.body;
* });
*/
Geocoding.placeDetail = function(config) {
Geocoding.placeDetail = function(config) {
v.assertShape({
address: v.required(v.string)
})(config);
Expand Down
94 changes: 74 additions & 20 deletions umd/goong-sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -1616,14 +1616,14 @@
* Autocomplete API service.
*
* Learn more about this service and its responses in
* [Goong REST API documentation](https://docs.goong.io/rest/guide#place).
* [Goong Places API documentation](https://docs.goong.io/rest/place/).
*/
var Autocomplete = {};

/**
* Autocomplete search
*
* See the [public documentation](https://docs.goong.io/rest/guide#get-points-by-keyword).
* See the [public documentation](https://docs.goong.io/rest/place/#places-search-by-keyword-with-autocomplete).
*
* @param {Object} config
* @param {string} config.input - A place name.
Expand Down Expand Up @@ -1674,7 +1674,7 @@
/**
* Autocomplete get place detail
*
* See the [public documentation](https://docs.goong.io/rest/guide#get-point-detail-by-id).
* See the [public documentation](https://docs.goong.io/rest/place/#get-place-detail-by-id).
*
* @param {Object} config
* @param {string} config.placeID - Place id from `Autocomplete` or `Geocoding`.
Expand All @@ -1698,7 +1698,7 @@

return this.client.createRequest({
method: 'GET',
path: '/place/detail',
path: '/Place/Detail',
query: config
});
};
Expand Down Expand Up @@ -1732,7 +1732,7 @@
* Directions API service.
*
* Learn more about this service and its responses in
* [Goong REST API documentation](https://docs.goong.io/rest/guide#direction).
* [Goong Directions API documentation](https://docs.goong.io/rest/directions).
*/
var Directions = {};

Expand All @@ -1741,10 +1741,9 @@
*
* @param {Object} config
* @param {number} config.origin - Origin coordinate `latitude,longitude`
* @param {string} config.destination - Destination coordinate `latitude,longitude`
* @param {string} config.destination - The destination coordinate string. Split by `;` for more than 2 destinations.
* @param {boolean} [config.alternatives=true] - Whether to try to return alternative routes.
* @param {'car'|'bike'|'taxi'} [config.vehicle='car'] - Vehicle type
* @param {'fastest'|'shortest'} [config.type='fastest'] - Routing type
* @param {'car'|'bike'|'taxi'|'hd'} [config.vehicle='car'] - Vehicle type
* @return {GAPIRequest}
*
Expand All @@ -1753,8 +1752,7 @@
* origin: '20.981971,105.864323',
* destination: '21.031011,105.783206',
* alternatives: true,
* vehicle: 'car',
* type: 'shortest'
* vehicle: 'car'
* })
* .send()
* .then(response => {
Expand Down Expand Up @@ -1783,24 +1781,24 @@
* Geocoding API service.
*
* Learn more about this service and its responses in
* [Goong REST API documentation](https://docs.goong.io/rest/guide#geocode).
* [Goong Geocoding API documentation](https://docs.goong.io/rest/geocode).
*/
var Geocoding = {};

/**
* Get Place by coordinate
* Reverse Geocoding
*
* @param {Object} config
* @param {string} config.latlng - Coordinates at which features will be reversed.
* @return {GAPIRequest}
*
* @example
* geocodingClient.reverseGeocode({
* latlng: '20.981971,105.864323'
* latlng: '21.0137443130001,105.798346108'
* })
* .send()
* .then(response => {
* // GeoJSON document with geocoding matches
* // JSON document with geocoding matches
* const match = response.body;
* });
*/
Expand All @@ -1816,13 +1814,71 @@
});
};

/**
* Forward Geocoding
*
* @param {Object} config
* @param {string} config.address - Address string you are looking for
* @return {GAPIRequest}
*
* @example
* geocodingClient.forwardGeocode({
* address: '91 Trung Kinh, Trung Hoa, Cau Giay, Ha Noi'
* })
* .send()
* .then(response => {
* // JSON document with geocoding matches
* const match = response.body;
* });
*/
Geocoding.forwardGeocode = function(config) {
validator.assertShape({
address: validator.required(validator.string)
})(config);

return this.client.createRequest({
method: 'GET',
path: '/Geocode',
query: config
});
};

/**
* Get Place detail
*
* @param {Object} config
* @param {string} config.place_id - Place ID string
* @return {GAPIRequest}
*
* @example
* geocodingClient.placeDetail({
* place_id: 'uq58Yr/RA0wuHVtqzDczw7bbR4Gs7gs2b5DRZtogUr2bvWTaN5Vb2qd/atCZ1FoPg7cdIqFo9E_2TxQzrc20hw==.ZXhwYW5kMA=='
* })
* .send()
* .then(response => {
* // JSON document with geocoding matches
* const match = response.body;
* });
*/
Geocoding.placeDetail = function(config) {
validator.assertShape({
address: validator.required(validator.string)
})(config);

return this.client.createRequest({
method: 'GET',
path: '/Geocode',
query: config
});
};

var geocoding = createServiceFactory_1(Geocoding);

/**
* Map Matching API service.
*
* Learn more about this service and its responses in
* [Goong REST API documentation](https://docs.goong.io/rest/guide#distance-matrix).
* [Goong Distance Matrix API documentation](https://docs.goong.io/rest/distance_matrix/).
*/
var DistanceMatrix = {};

Expand All @@ -1832,16 +1888,14 @@
* @param {Object} config
* @param {number} config.origins - Origin coordinate: `latitude,longitude|latitude,longitude`
* @param {string} config.destinations - List of destination coordinate: `latitude,longitude|latitude,longitude|latitude,longitude`
* @param {'car'|'bike'|'taxi'} [config.vehicle='car'] - Vehicle type
* @param {'fastest'|'shortest'} [config.type='fastest'] - Routing type
* @param {'car'|'bike'|'taxi'|'hd'} [config.vehicle='car'] - Vehicle type
* @return {GAPIRequest}
*
* @example
* matrixClient.getMatrix({
* origins: '20.981971,105.864323',
* destinations: '21.031011,105.783206|21.022328,105.790480|21.016665,105.788774',
* vehicle: 'car',
* type: 'fastest',
* vehicle: 'car'
* })
* .send()
* .then(response => {
Expand Down Expand Up @@ -1869,7 +1923,7 @@
* Static Images API service.
*
* Learn more about this service and its responses in
* [Goong REST API documentation](https://docs.goong.io/rest/guide#static-map).
* [Goong Static Map API documentation](https://docs.goong.io/rest/staticmap/).
*/
var Static = {};

Expand Down
Loading

0 comments on commit 0f01166

Please sign in to comment.