Added cruising api endpoint support
This commit is contained in:
1 parent
04f3d42c01
commit
b653fd2eaf
4 files changed
+524
-2
No files matched your search
+13
-2
@@ -1,8 +1,17 @@
|
||||
var NodeGeocoder = require('node-geocoder');
|
||||
const NodeGeocoder = require('node-geocoder');
|
||||
|
||||
function addressToString (address) {
|
||||
var string = '';
|
||||
string = address.address1 ? address.street1 + ',' : '';
|
||||
string = string + (address.locality ? ' ' + address.locality + ',' : '');
|
||||
string = string + (address.region ? ' ' + address.region : '');
|
||||
string = string + (address.postal ? ' ' + address.postal : '');
|
||||
string = string + (address.country ? ' ' + address.country : '');
|
||||
return string;
|
||||
}
|
||||
|
||||
var options = {
|
||||
provider: 'google',
|
||||
|
||||
// Optional depending on the providers
|
||||
httpAdapter: 'https', // Default
|
||||
apiKey: 'AIzaSyCvpBGztvxtRUNigOW9f0GXVRWlukJZsps', // for Mapquest, OpenCage, Google Premier
|
||||
@@ -12,6 +21,8 @@ var options = {
|
||||
var geocoder = NodeGeocoder(options);
|
||||
|
||||
|
||||
|
||||
exports.addressToString = addressToString;
|
||||
exports.geocoder = geocoder;
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user