Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vollkorntomate/flutter-photon
An API client for Komoot's Photon Geocoding API written in and for Dart/Flutter.
https://github.com/vollkorntomate/flutter-photon
dart flutter geocoding osm
Last synced: 2 months ago
JSON representation
An API client for Komoot's Photon Geocoding API written in and for Dart/Flutter.
- Host: GitHub
- URL: https://github.com/vollkorntomate/flutter-photon
- Owner: vollkorntomate
- License: apache-2.0
- Created: 2021-03-24T16:20:11.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-20T14:54:55.000Z (5 months ago)
- Last Synced: 2024-10-07T18:28:15.281Z (3 months ago)
- Topics: dart, flutter, geocoding, osm
- Language: Dart
- Homepage: https://pub.dev/packages/flutter_photon
- Size: 50.8 KB
- Stars: 5
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# flutter_photon
[![version](https://img.shields.io/badge/version-2.0.1-green.svg)]()
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![flutter_photon](https://img.shields.io/badge/pub.dev-v2.0.1-blue.svg)](https://pub.dev/packages/flutter_photon)Wrapper for Komoot's Photon API for Dart/Flutter.
It supports forward and reverse geocoding as well as search-as-you-type.
## Photon
Photon is a free and open-source API hosted by Komoot and powered by ElasticSearch. It returns data from the OpenStreetMap project,
which is licensed under the [ODbL License](https://opendatacommons.org/licenses/odbl/).The API is available at [photon.komoot.io](https://photon.komoot.io)
and licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).
Its source code and some documentation is published on [GitHub](https://github.com/komoot/photon).**Important:** Please be aware of the Terms and Use of Photon! It is free to use, so please be fair and avoid excessive requests!
## Usage
Forward geocoding:
```dart
import 'package:flutter_photon/flutter_photon.dart';void main() async {
final api = PhotonApi();
final results = await api.forwardSearch('munich');
}
```Reverse geocoding:
```dart
import 'package:flutter_photon/flutter_photon.dart';void main() async {
final api = PhotonApi();
final results = await api.reverseSearch(48.123, 11.321);
}
```Self-hosted instances (custom URL):
```dart
void main() async {
final api = PhotonApi(baseUrl: 'https://example.com/api');
}
```You can find more examples on how to use the API by looking at the [tests](test/flutter_photon_test.dart).
## Features and Bugs
Feel free to open a new issue! I am always happy to improve this package.
## Contribution
Feel free to open pull requests and help to improve this package!