File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ # Geocode.Farm JavaScript SDK
2+
3+ ## Introduction
4+ The official JavaScript SDK for the Geocode.Farm API.
5+
6+ This SDK allows you to easily integrate geocoding (both forward and reverse) into your JavaScript applications.
7+
8+ ## Installation
9+
10+ You can include the ` geocodefarm.js ` file directly in your HTML project, or install it through package managers like npm or yarn.
11+
12+ To use the SDK, simply include the script and initialize it with your API key.
13+
14+ ## Example Usage
15+
16+ ``` html
17+ <script src =" https://github.com/geocodefarm/geocodefarm-js/raw/refs/heads/main/geocodefarm.js" ></script >
18+ <script >
19+ const geocode = new GeocodeFarm (' your_api_key_here' );
20+
21+ // Example: Forward geocoding
22+ geocode .forward (' 1600 Pennsylvania Ave, Washington, DC' ).then (response => {
23+ if (response .success ) {
24+ console .log (' Coordinates:' , response .lat , response .lon );
25+ } else {
26+ console .error (' Error:' , response .error );
27+ }
28+ });
29+
30+ // Example: Reverse geocoding
31+ geocode .reverse (38.8977 , - 77.0365 ).then (response => {
32+ if (response .success ) {
33+ console .log (' Address:' , response .full_address );
34+ } else {
35+ console .error (' Error:' , response .error );
36+ }
37+ });
38+ </script >
39+ ```
40+
41+ ## License
42+ This SDK is licensed under ** The Unlicense** (public domain).
43+
44+ ## Contributing
45+ If you find any bugs or have suggestions, please submit an issue or a pull request.
You can’t perform that action at this time.
0 commit comments