Skip to content

Commit 15c7166

Browse files
committed
update README.md
1 parent e28a726 commit 15c7166

1 file changed

Lines changed: 33 additions & 3 deletions

File tree

README.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# @aashari/nodejs-geocoding
22

3-
NodeJS library that encode and decode geolocation which helps you convert latitude and longitude to formatted address, or formatted_address to latitude and longitude.
3+
A NodeJS library that can encode and decode geolocation information. This library allows you to convert latitude and longitude to formatted addresses or formatted addresses to latitude and longitude.
44

5-
> ⚠️⚠️⚠️ please do not use this library for commercial, use the official Google Maps API instead!
5+
> ⚠️⚠️⚠️ Please note that this library is not intended for commercial use. Please use the official Google Maps API instead.
66
77
### Installation
8+
To install @aashari/nodejs-geocoding, use one of the following commands:
9+
10+
811
via yarn:
912

1013
```
@@ -44,7 +47,7 @@ geocoding.decode(-6.170131, 106.8241607).then(result => {
4447

4548
#### Encode Formatted Address
4649

47-
##### Example Code
50+
##### Example Code (default language: en)
4851
```javascript
4952
// importing the dependency
5053
const geocoding = require('@aashari/nodejs-geocoding');
@@ -70,3 +73,30 @@ geocoding.encode("jalan merdeka utara no.3 jakarta").then(result => {
7073
}
7174
]
7275
```
76+
77+
##### Example Code (custom language: id)
78+
```javascript
79+
// importing the dependency
80+
const geocoding = require('@aashari/nodejs-geocoding');
81+
82+
// encode formatted address to latitude and longitude
83+
geocoding.encode("jalan merdeka utara no.3 jakarta", "id").then(result => {
84+
console.log(result);
85+
});
86+
```
87+
88+
##### Expected Output
89+
```
90+
[
91+
{
92+
latitude: -6.175308299999999,
93+
longitude: 106.8281502,
94+
formatted_address: 'Jalan Medan Merdeka Utara No.3, RT.3/RW.2, Gambir, Kota Jakarta Pusat, Jakarta'
95+
},
96+
{
97+
latitude: -6.1714815,
98+
longitude: 106.8269598,
99+
formatted_address: 'Jalan Medan Merdeka Utara, RT.3/RW.2, Gambir, Kota Jakarta Pusat, Jakarta'
100+
}
101+
]
102+
```

0 commit comments

Comments
 (0)