Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thunderbug1/maptiler_flutter
Flutter wrapper of the MapTiler Apis.
https://github.com/thunderbug1/maptiler_flutter
Last synced: 11 minutes ago
JSON representation
Flutter wrapper of the MapTiler Apis.
- Host: GitHub
- URL: https://github.com/thunderbug1/maptiler_flutter
- Owner: thunderbug1
- License: mit
- Created: 2024-01-20T12:33:35.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-01-22T13:27:57.000Z (11 months ago)
- Last Synced: 2024-11-06T04:28:32.537Z (about 2 months ago)
- Language: Dart
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# MapTiler Flutter
This Flutter package provides a convenient Dart wrapper around the MapTiler Cloud API, allowing easy access to various MapTiler services like Geocoding, Coordinates, and Geolocation.
# Motivation
I started this package since I wanted to build a location selector with autocomplete functionality for [Activilit](https://activilit.com).
I didn't want to use the google maps API since it is quite expensive and so I researched for alternatives and found MapTiler.## Features
- Geocoding API: Forward and reverse geocoding, including batch geocoding.
- Coordinates API: Search coordinate systems and transformations.
- Geolocation API: IP-based geolocation services.
- Maps API: todo
- Static Maps API: todo
- Tiles API: todo
- Data API: todo
- Other API: todo## Getting Started
To get started with this package, add it as a dependency in your Flutter project.
### Installation
Add this to your package's pubspec.yaml file:
```yaml
dependencies:
maptiler_flutter: ^0.1.0
```### Import the Package
```
import 'package:maptiler_flutter/maptiler.dart';
```### Usage
Before using the APIs, you must initialize the package with your MapTiler API key.### Setting up API Key
```
void main() {
MapTilerConfig.setApiKey('YOUR_MAPTILER_API_KEY');
runApp(MyApp());
}
```### API Usage
```
// Forward Geocoding
MapTiler.geocodingAPI.searchByName("Zurich").then((result) {
print(result.features);
});// Reverse Geocoding
MapTiler.geocodingAPI.searchByCoordinates(8.55, 47.36667).then((result) {
print(result.features);
});// Search Coordinates
MapTiler.coordinatesAPI.searchCoordinates("query").then((result) {
print(result.results);
});// IP Geolocation
MapTiler.geolocationAPI.getIPGeolocation().then((result) {
print(result.city);
});
```### Models
This package provides several models to represent the data structures used by the MapTiler API, including SearchResults, Feature, GeolocationResult, and more.### Error Handling
The API methods throw exceptions in case of failure. Make sure to handle these appropriately in your application.### Contributing
Contributions to the package are welcome. Please follow the standard pull request process for your contributions.### License
This package is licensed under the MIT License.### Disclaimer
This package is not officially affiliated with MapTiler.