{"id":22035620,"url":"https://github.com/sebastianbaar/cordova-plugin-nativegeocoder","last_synced_at":"2025-07-24T16:07:18.451Z","repository":{"id":57159687,"uuid":"73921821","full_name":"sebastianbaar/cordova-plugin-nativegeocoder","owner":"sebastianbaar","description":"Cordova plugin for native forward and reverse geocoding","archived":false,"fork":false,"pushed_at":"2023-03-07T12:12:06.000Z","size":1067,"stargazers_count":61,"open_issues_count":2,"forks_count":34,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T22:06:43.829Z","etag":null,"topics":["android","cordova-android","cordova-android-plugin","cordova-ios","cordova-ios-plugin","cordova-plugin","cordova-plugin-nativegeocoder","geocoder","ios","reversegeocode","swift"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sebastianbaar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-16T13:17:08.000Z","updated_at":"2024-12-06T15:56:26.000Z","dependencies_parsed_at":"2024-06-18T15:37:49.764Z","dependency_job_id":"a43936e9-5929-4530-a5e1-a8452b9f49f9","html_url":"https://github.com/sebastianbaar/cordova-plugin-nativegeocoder","commit_stats":{"total_commits":48,"total_committers":8,"mean_commits":6.0,"dds":0.7083333333333333,"last_synced_commit":"765ca49250a71b2b47f02a9d1102185e3d0544d4"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbaar%2Fcordova-plugin-nativegeocoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbaar%2Fcordova-plugin-nativegeocoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbaar%2Fcordova-plugin-nativegeocoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbaar%2Fcordova-plugin-nativegeocoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebastianbaar","download_url":"https://codeload.github.com/sebastianbaar/cordova-plugin-nativegeocoder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248126062,"owners_count":21051862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","cordova-android","cordova-android-plugin","cordova-ios","cordova-ios-plugin","cordova-plugin","cordova-plugin-nativegeocoder","geocoder","ios","reversegeocode","swift"],"created_at":"2024-11-30T10:25:41.627Z","updated_at":"2025-04-09T23:20:09.452Z","avatar_url":"https://github.com/sebastianbaar.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cordova NativeGeocoder plugin\nCall `nativegeocoder.reverseGeocode()` to transform a latitude and longitude into an address or `nativegeocoder.forwardGeocode()` to transform an address into a latitude and longitude using iOS [CoreLocation](https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CoreLocation_Framework/) service and Android [Geocoder](https://developer.android.com/reference/android/location/Geocoder.html) class.\n\n\u003e No need for creating API keys or querying external APIs\n\n\n**Please read [Known Issues](#known-issues) before posting an issue! Thank you!** :heart_eyes:\n\n## Ionic\n\nThis plugin is also available for **Ionic [awesome-cordova-plugins](https://danielsogl.gitbook.io/awesome-cordova-plugins/native-geocoder/) \u0026 [Capacitor](https://capacitorjs.com)**.\n\n## Installation\n```\ncordova plugin add cordova-plugin-nativegeocoder\n```\n**For iOS Cordova iOS version \u003e5.0.0 is required.**\n\n## Configuration\nYou can also configure the following variable to customize the iOS location plist entry\n\n- `LOCATION_WHEN_IN_USE_DESCRIPTION` for `NSLocationWhenInUseUsageDescription` (defaults to \"Use geocoder service\")\n\n## Supported Platforms\n- iOS\n- Android\n\n## API\n- [.reverseGeocode(success, error, latitude, longitude, options)]()\n- [.forwardGeocode(success, error, addressString, options)]()\n\n## .reverseGeocode(successCallback, errorCallback, latitude, longitude, options);\nReverse geocode a given latitude and longitude to find location address.\n\n### Parameters\n\n| Parameter        | Type       | Default | Description                                                   |\n| ---------------- | ---------- | ------- | ------------------------------------------------------------- |\n| `success` | `Function` |         | Success callback (with Array\u003cResult\u003e)              |\n| `error`   | `Function` |         | Error callback. |\n| `latitude` | `Number` |         | The latitude.               |\n| `longitude`   | `Number` |         | The longtitude. |\n| `options`   | `Object` |         | Optional. Is called when the api encounters an error while initializing the context. |\n\nAll available `options` attributes:\n\n| Attribute                      | Type     | Default                                                      | Comment                                        |\n| ------------------------------ | -------- | ------------------------------------------------------------ | -------------------------------------------------- |\n| `useLocale`  | `Boolean` | true | Optional. Only works for Android and iOS 11.0+. |\n| `defaultLocale` | `String` |  | Optional. E.g.: 'fa-IR' or 'de_DE'; works only for Android and iOS 11.0+. |\n| `maxResults` | `Number` | 1 | Optional. Min value: 1, max value: 5. |\n\n### Array\u003cResult\u003e\nConforms to [Apple's](https://developer.apple.com/documentation/corelocation/clplacemark) and [Android's](https://developer.android.com/reference/android/location/Address.html) geocoder's result arrays.\n\n| Value | Type     |\n|-------------|-----------\n| `latitude`  | `String` |\n| `longitude`  | `String` |\n| `countryCode`  | `String` | \n| `postalCode`  | `String` | \n| `administrativeArea`  | `String` | \n| `subAdministrativeArea`  | `String` | \n| `locality`  | `String` | \n| `subLocality`  | `String` | \n| `thoroughfare`  | `String` | \n| `subThoroughfare`  | `String` |\n| `areasOfInterest`  | `Array\u003cString\u003e` | \n| `addressLines` (Android only) | `Array\u003cString\u003e` | \n\n\n### Example\n```js\nnativegeocoder.reverseGeocode(success, failure, 52.5072095, 13.1452818, { useLocale: true, maxResults: 1 });\n\nfunction success(result) {\n  var firstResult = result[0];\n  console.log(\"First Result: \" + JSON.stringify(firstResult));\n}\n\nfunction failure(err) {\n  console.log(err);\n}\n```\n\n## .forwardGeocode(success, error, addressString, options)\nForward geocode a given address to find coordinates.\n\n### Parameters\n\n| Parameter        | Type       | Default | Description                                                   |\n| ---------------- | ---------- | ------- | ------------------------------------------------------------- |\n| `success` | `Function` |         | Success callback (with Array\u003cResult\u003e)              |\n| `error`   | `Function` |         | Error callback. |\n| `addressString` | `String` |         | The address to be geocoded.               |\n| `options`   | `Object` |         | Optional. Is called when the api encounters an error while initializing the context. |\n\nAll available `options` attributes:\n\n| Attribute                      | Type     | Default                                                      | Comment                                        |\n| ------------------------------ | -------- | ------------------------------------------------------------ | -------------------------------------------------- |\n| `useLocale`  | `Boolean` | true | Optional. Only works for Android and iOS 11.0+. |\n| `defaultLocale` | `String` |  | Optional. E.g.: 'fa-IR' or 'de_DE'; works only for Android and iOS 11.0+. |\n| `maxResults` | `Number` | 1 | Optional. Min value: 1, max value: 5. |\n\n### Array\u003cResult\u003e\nConforms to [Apple's](https://developer.apple.com/documentation/corelocation/clplacemark) and [Android's](https://developer.android.com/reference/android/location/Address.html) geocoder's result arrays.\n\n| Value | Type     |\n|-------------|-----------\n| `latitude`  | `String` |\n| `longitude`  | `String` |\n| `countryCode`  | `String` | \n| `postalCode`  | `String` | \n| `administrativeArea`  | `String` | \n| `subAdministrativeArea`  | `String` | \n| `locality`  | `String` | \n| `subLocality`  | `String` | \n| `thoroughfare`  | `String` | \n| `subThoroughfare`  | `String` |\n| `areasOfInterest`  | `Array\u003cString\u003e` | \n| `addressLines` (Android only) | `Array\u003cString\u003e` | \n\n### Example\n```js\nnativegeocoder.forwardGeocode(success, failure, \"Berlin\", { useLocale: true, maxResults: 1 });\n\nfunction success(coordinates) {\n  var firstResult = coordinates[0];\n  console.log(\"The coordinates are latitude = \" + firstResult.latitude + \" and longitude = \" + firstResult.longitude);\n}\n\nfunction failure(err) {\n  console.log(err);\n}\n```\n\n## Known Issues\n\n### Android \n\n#### Geocoder not working\nErrors like `Geocoder:getFromLocationName Error: grpc failed`, `Geocoder is not present on this device/emulator.`, `Geocoder [...] Error` or `Geocoder Service not available`.\n\n**Why?**: \nThe plugin checks for `Geocoder.isPresent()` ([Android docs](https://developer.android.com/reference/android/location/Geocoder.html#isPresent())). One reason for Geocoder not working on a device could be that you are running your app on an emulator or on a device without Google Play Services. But Geocoder API \"[...] requires a backend service that is not included in the core android framework\".\n\n**Any workaround?**: \nYes, install Google Play services. Open `SDK Tools` \u003e Tab `SDK Tools` \u003e install `Google Play services`.\n\n### iOS\n...\n\n## Thank you :heart:\nYes you! Thank you very much for using cordova-plugin-nativegeocoder. If you have any feedback or run into issues using the plugin, please file an [issue](https://github.com/sebastianbaar/cordova-plugin-nativegeocoder/issues/new) on this repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastianbaar%2Fcordova-plugin-nativegeocoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebastianbaar%2Fcordova-plugin-nativegeocoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastianbaar%2Fcordova-plugin-nativegeocoder/lists"}