diff --git a/README.md b/README.md index 2999845..25dddc4 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,15 @@ [![pub package](https://img.shields.io/pub/v/geocoding.svg)](https://pub.dartlang.org/packages/geocoding) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart) -[![Buid status](https://github.com/Baseflow/flutter-geocoding/workflows/Geocoding/badge.svg)](https://github.com/Baseflow/flutter-geocoding/actions?query=workflow%3AGeocoding) +[![Buid status](https://github.com/Baseflow/flutter-geocoding/actions/workflows/geocoding.yaml/badge.svg)](https://github.com/Baseflow/flutter-geocoding/actions/workflows/geocoding.yaml) [![codecov](https://codecov.io/gh/Baseflow/flutter-geocoding/branch/main/graph/badge.svg)](https://codecov.io/gh/Baseflow/flutter-geocoding) The Flutter geocoding plugin is build following the federated plugin architecture. A detailed explanation of the federated plugin concept can be found in the [Flutter documentation](https://flutter.dev/docs/development/packages-and-plugins/developing-packages#federated-plugins). This means the geocoding plugin is separated into the following packages: 1. [`geocoding`][1]: the app facing package. This is the package users depend on to use the plugin in their project. For details on how to use the [`geocoding`][1] plugin you can refer to its [README.md][2] file. At this moment the Android and iOS platform implementations are also part of this package; -3. [`geocoding_platform_interface`][3]: this packages declares the interface which all platform packages must implement to support the app-facing package. Instructions on how to implement a platform packages can be found in the [README.md][4] of the [`geocoding_platform_interface`][3] package. +2. [`geocoding_platform_interface`][3]: this packages declares the interface which all platform packages must implement to support the app-facing package. Instructions on how to implement a platform packages can be found in the [README.md][4] of the [`geocoding_platform_interface`][3] package. [1]: ./geocoding [2]: ./geocoding/README.md [3]: ./geocoding_platform_interface -[4]: ./geocoding_platform_interface/README.md \ No newline at end of file +[4]: ./geocoding_platform_interface/README.md diff --git a/geocoding/README.md b/geocoding/README.md index 4f81950..5aa6f5a 100644 --- a/geocoding/README.md +++ b/geocoding/README.md @@ -1,49 +1,51 @@ -# Flutter Geocoding Plugin +# Flutter Geocoding Plugin [![pub package](https://img.shields.io/pub/v/geocoding.svg)](https://pub.dartlang.org/packages/geocoding) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart) -[![Buid status](https://github.com/Baseflow/flutter-geocoding/workflows/Geocoding/badge.svg)](https://github.com/Baseflow/flutter-geocoding/actions?query=workflow%3AGeocoding) +[![Buid status](https://github.com/Baseflow/flutter-geocoding/actions/workflows/geocoding.yaml/badge.svg)](https://github.com/Baseflow/flutter-geocoding/actions/workflows/geocoding.yaml) [![codecov](https://codecov.io/gh/Baseflow/flutter-geocoding/branch/main/graph/badge.svg)](https://codecov.io/gh/Baseflow/flutter-geocoding) A Flutter Geocoding plugin which provides easy geocoding and reverse-geocoding features. -**Important**: +**Important**: 1. This plugin uses the free Geocoding services provided by the iOS and Android platforms. This means that there are restrictions to their use. More information can be found in the [Apple documentation for iOS](https://developer.apple.com/documentation/corelocation/clgeocoder) and the [Google documentation for Android](https://developer.android.com/reference/android/location/Geocoder). When a `PlatformException(IO_ERROR, ...)` gets thrown, most of the times it means that the rate limit has been reached. -2. The availability of the Google Play Services depends on your country. If your country doesn't support a connection with the Google Play Services, you'll need to try a VPN to establish a connection. For more information about how to work with Google Play Services visit the following link: https://developers.google.com/android/guides/overview +2. The availability of the Google Play Services depends on your country. If your country doesn't support a connection with the Google Play Services, you'll need to try a VPN to establish a connection. For more information about how to work with Google Play Services visit the following link: https://developers.google.com/android/guides/overview ## Usage To use this plugin, please follow the installation guide on the [official geocoding plugin page](https://pub.dev/packages/geocoding/install). -> **NOTE:** This plugin relies on the AndroidX version of the Android Support Libraries. This means you need to make sure your Android project is also upgraded to support AndroidX. Detailed instructions can be found [here](https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility). +> **NOTE:** This plugin relies on the AndroidX version of the Android Support Libraries. This means you need to make sure your Android project is also upgraded to support AndroidX. Detailed instructions can be found [here](https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility). > ->The TL;DR version is: +> The TL;DR version is: > ->1. Add the following to your "gradle.properties" file: +> 1. Add the following to your "gradle.properties" file: > ->``` ->android.useAndroidX=true ->android.enableJetifier=true ->``` ->2. Make sure you set the `compileSdkVersion` in your "android/app/build.gradle" file to 33: +> ```properties +> android.useAndroidX=true +> android.enableJetifier=true +> ``` > ->``` ->android { -> compileSdkVersion 33 +> 2. Make sure you set the `compileSdkVersion` in your "android/app/build.gradle" file to 33: > -> ... ->} ->``` ->3. Make sure you replace all the `android.` dependencies to their AndroidX counterparts (a full list can be found [Android migration guide](https://developer.android.com/jetpack/androidx/migrate)). +> ```gradle +> android { +> compileSdkVersion 33 +> +> ... +> } +> ``` +> +> 3. Make sure you replace all the `android.` dependencies to their AndroidX counterparts (a full list can be found [Android migration guide](https://developer.android.com/jetpack/androidx/migrate)). ## API To translate an address into latitude and longitude coordinates you can use the `placemarkFromAddress` method: -``` dart +```dart import 'package:geocoding/geocoding.dart'; List locations = await locationFromAddress("Gronausestraat 710, Enschede"); @@ -51,21 +53,21 @@ List locations = await locationFromAddress("Gronausestraat 710, Ensche If you want to translate latitude and longitude coordinates into an address you can use the `placemarkFromCoordinates` method: -``` dart +```dart import 'package:geocoding/geocoding.dart'; List placemarks = await placemarkFromCoordinates(52.2165157, 6.9437819); ``` -The setLocaleIdentifier with the `localeIdentifier` parameter can be used to enforce the results to be formatted (and translated) according to the specified locale. The `localeIdentifier` should be formatted using the syntax: [languageCode]_[countryCode]. Use the [ISO 639-1 or ISO 639-2](https://www.loc.gov/standards/iso639-2/php/English_list.php) standard for the language code and the 2 letter [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard for the country code. Some examples are: +The setLocaleIdentifier with the `localeIdentifier` parameter can be used to enforce the results to be formatted (and translated) according to the specified locale. The `localeIdentifier` should be formatted using the syntax: [languageCode]\_[countryCode]. Use the [ISO 639-1 or ISO 639-2](https://www.loc.gov/standards/iso639-2/php/English_list.php) standard for the language code and the 2 letter [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard for the country code. Some examples are: -Locale identifier | Description ------------------ | ----------- -en | All English speakers (will translate all attributes to English) -en_US | English speakers in the United States of America -en_UK | English speakers in the United Kingdom -nl_NL | Dutch speakers in The Netherlands -nl_BE | Dutch speakers in Belgium +| Locale identifier | Description | +| ----------------- | --------------------------------------------------------------- | +| en | All English speakers (will translate all attributes to English) | +| en_US | English speakers in the United States of America | +| en_UK | English speakers in the United Kingdom | +| nl_NL | Dutch speakers in The Netherlands | +| nl_BE | Dutch speakers in Belgium | ## Issues diff --git a/geocoding_android/README.md b/geocoding_android/README.md index 54ac278..a25f7a2 100644 --- a/geocoding_android/README.md +++ b/geocoding_android/README.md @@ -1,4 +1,4 @@ -# geocoding\_android +# geocoding_android The android implementation of [`geocoding`][1]. @@ -8,4 +8,4 @@ This package is [endorsed][2], which means you can simply use `geocoding` normally. This package will be automatically included in your app when you do. [1]: https://pub.dev/packages/geocoding -[2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin \ No newline at end of file +[2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin diff --git a/geocoding_platform_interface/README.md b/geocoding_platform_interface/README.md index 5a97124..ef289bf 100644 --- a/geocoding_platform_interface/README.md +++ b/geocoding_platform_interface/README.md @@ -1,14 +1,16 @@ # geocoding_platform_interface -[![pub package](https://img.shields.io/pub/v/geocoding_platform_interface.svg)](https://pub.dartlang.org/packages/geocoding_platform_interface) ![Build status](https://github.com/Baseflow/flutter-geocoding/workflows/geocoding_platform_interface/badge.svg?branch=main) [![style: flutter_lints](https://img.shields.io/badge/style-flutter_lints-40c4ff.svg)](https://pub.dev/packages/flutter_lints) +[![pub package](https://img.shields.io/pub/v/geocoding_platform_interface.svg)](https://pub.dartlang.org/packages/geocoding_platform_interface) +[![Buid status](https://github.com/Baseflow/flutter-geocoding/actions/workflows/geocoding_platform_interface.yaml/badge.svg)](https://github.com/Baseflow/flutter-geocoding/actions/workflows/geocoding_platform_interface.yaml) +[![style: flutter_lints](https://img.shields.io/badge/style-flutter_lints-40c4ff.svg)](https://pub.dev/packages/flutter_lints) A common platform interface for the [`geocoding`][1] plugin. This interface allows platform-specific implementations of the `geocoding` plugin, as well as the plugin itself, to ensure they are supporting the -same interface. Have a look at the [Federated plugins](https://flutter.dev/docs/development/packages-and-plugins/developing-packages#federated-plugins) -section of the official [Developing packages & plugins](https://flutter.dev/docs/development/packages-and-plugins/developing-packages) -documentation for more information regarding the federated architecture concept. +same interface. Have a look at the [Federated plugins](https://flutter.dev/docs/development/packages-and-plugins/developing-packages#federated-plugins) +section of the official [Developing packages & plugins](https://flutter.dev/docs/development/packages-and-plugins/developing-packages) +documentation for more information regarding the federated architecture concept. ## Usage @@ -39,4 +41,4 @@ If you would like to contribute to the plugin (e.g. by improving the documentati This Geocoding plugin for Flutter is developed by [Baseflow](https://baseflow.com). [1]: ../geocoding -[2]: lib/geocoding_platform_interface.dart \ No newline at end of file +[2]: lib/geocoding_platform_interface.dart