Static Images API service.
Learn more about this service and its responses in Goong Static Map API documentation.
Get a static map image.
config
Objectconfig.origin
number Origin coordinatelatitude,longitude
config.destination
string Destination coordinatelatitude,longitude
config.width
number Width of the image in pixels, default 600px. (optional, default600
)config.height
number Height of the image in pixels, default 400px. (optional, default400
)config.vehicle
("car"
|"bike"
|"taxi"
) Vehicle type (optional, default'car'
)config.type
("fastest"
|"shortest"
) Routing type (optional, default'fastest'
)config.color
string Color of route line, default #253494 (optional, default'#253494'
)
staticClient.getStaticImage({
origin: '20.981971,105.864323',
destination: '20.994531,105.849663',
width: 600,
height: 400,
vehicle: 'car',
type: 'fastest',
color: '#253494'
})
.send()
.then(response => {
const image = response.body;
});
Returns GAPIRequest
Geocoding API service.
Learn more about this service and its responses in Goong Geocoding API documentation.
Reverse Geocoding
geocodingClient.reverseGeocode({
latlng: '21.0137443130001,105.798346108'
})
.send()
.then(response => {
// JSON document with geocoding matches
const match = response.body;
});
Returns GAPIRequest
Forward Geocoding
geocodingClient.forwardGeocode({
address: '91 Trung Kinh, Trung Hoa, Cau Giay, Ha Noi'
})
.send()
.then(response => {
// JSON document with geocoding matches
const match = response.body;
});
Returns GAPIRequest
Get Place detail
geocodingClient.placeDetail({
place_id: 'uq58Yr/RA0wuHVtqzDczw7bbR4Gs7gs2b5DRZtogUr2bvWTaN5Vb2qd/atCZ1FoPg7cdIqFo9E_2TxQzrc20hw==.ZXhwYW5kMA=='
})
.send()
.then(response => {
// JSON document with geocoding matches
const match = response.body;
});
Returns GAPIRequest
Autocomplete API service.
Learn more about this service and its responses in Goong Places API documentation.
Autocomplete search
See the public documentation.
config
Objectconfig.input
string A place name.config.location
string A location to use as a hint when looking up the specified address -latitude,longitude
config.radius
number Distance round from your location by kilometersconfig.limit
number Limit the number of results returned. Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script. (optional, default10
)
autocompleteClient.search({
input: 'san bay noi bai',
limit: 5
})
.send()
.then(response => {
const match = response.body;
});
// autocomplete with location
autocompleteClient.search({
input: 'san bay noi bai',
location: '21.028531,105.854189',
radius: 100
})
.send()
.then(response => {
const match = response.body;
});
Returns GAPIRequest
Autocomplete get place detail
See the public documentation.
config
Objectconfig.placeID
string Place id fromAutocomplete
orGeocoding
. Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script.
autocompleteClient.placeDetail({
placeid: '0WmA4vbeody2J9AEvVM9YE3ZN85z7Mrw',
})
.send()
.then(response => {
const match = response.body;
});
Returns GAPIRequest
Directions API service.
Learn more about this service and its responses in Goong Directions API documentation.
Get directions.
config
Objectconfig.origin
number Origin coordinatelatitude,longitude
config.destination
string The destination coordinate string. Split by;
for more than 2 destinations.config.alternatives
boolean Whether to try to return alternative routes. (optional, defaulttrue
)config.vehicle
("car"
|"bike"
|"taxi"
|"hd"
) Vehicle type (optional, default'car'
)
directionsClient.getDirections({
origin: '20.981971,105.864323',
destination: '21.031011,105.783206',
alternatives: true,
vehicle: 'car'
})
.send()
.then(response => {
const directions = response.body;
});
Returns GAPIRequest
Map Matching API service.
Learn more about this service and its responses in Goong Distance Matrix API documentation.
Get a duration and/or distance matrix showing travel times and distances between coordinates.
config
Object
matrixClient.getMatrix({
origins: '20.981971,105.864323',
destinations: '21.031011,105.783206|21.022328,105.790480|21.016665,105.788774',
vehicle: 'car'
})
.send()
.then(response => {
const matrix = response.body;
});
Returns GAPIRequest