Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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!