brizaldi / locationiq-dart-client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

openapi

LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.

This Dart package is automatically generated by the OpenAPI Generator project:

  • API version: 1.1.0
  • Build package: org.openapitools.codegen.languages.DartClientCodegen

Requirements

Dart 2.0 or later

Installation & Usage

Github

If this Dart package is published to Github, add the following dependency to your pubspec.yaml

dependencies:
  openapi:
    git: https://github.com/location-iq/locationiq-dart-client.git

Local

To use the package in your local drive, add the following dependency to your pubspec.yaml

dependencies:
  openapi:
    path: /path/to/openapi

Tests

TODO

Getting Started

Please follow the installation procedure and then run the following:

import 'package:openapi/api.dart';

// TODO Configure API key authorization: key
//defaultApiClient.getAuthentication<ApiKeyAuth>('key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('key').apiKeyPrefix = 'Bearer';

var api_instance = AutocompleteApi();
var q = "Empire state"; // String | Address to geocode
var normalizecity = 1; // int | For responses with no city value in the address section, the next available element in this order - city_district, locality, town, borough, municipality, village, hamlet, quarter, neighbourhood - from the address section will be normalized to city. Defaults to 1 for SDKs.
var limit = 10; // int | Limit the number of returned results. Default is 10.
var viewbox = "-132.84908,47.69382,-70.44674,30.82531"; // String | The preferred area to find search results.  To restrict results to those within the viewbox, use along with the bounded option. Tuple of 4 floats. Any two corner points of the box - `max_lon,max_lat,min_lon,min_lat` or `min_lon,min_lat,max_lon,max_lat` - are accepted in any order as long as they span a real box. 
var bounded = 1; // int | Restrict the results to only items contained with the viewbox
var countrycodes = "us"; // String | Limit search to a list of countries.
var acceptLanguage = "en"; // String | Preferred language order for showing search results, overrides the value specified in the Accept-Language HTTP header. Defaults to en. To use native language for the response when available, use accept-language=native
var tag = "place"; // String | Restricts the autocomplete search results to elements of specific OSM class and type.  Example - To restrict results to only class place and type city: tag=place:city, To restrict the results to all of OSM class place: tag=place

try {
    var result = api_instance.autocomplete(q, normalizecity, limit, viewbox, bounded, countrycodes, acceptLanguage, tag);
    print(result);
} catch (e) {
    print("Exception when calling AutocompleteApi->autocomplete: $e\n");
}

Documentation for API Endpoints

All URIs are relative to https://eu1.locationiq.com/v1

Class Method HTTP request Description
AutocompleteApi autocomplete GET /autocomplete.php
BalanceApi balance GET /balance.php
DirectionsApi directions GET /directions/driving/{coordinates} Directions Service
MatchingApi matching GET /matching/driving/{coordinates} Matching Service
MatrixApi matrix GET /matrix/driving/{coordinates} Matrix Service
NearestApi nearest GET /nearest/driving/{coordinates} Nearest Service
ReverseApi reverse GET /reverse.php Reverse Geocoding
SearchApi search GET /search.php Forward Geocoding

Documentation For Models

Documentation For Authorization

key

  • Type: API key
  • API key parameter name: key
  • Location: URL query string

Author

About


Languages

Language:Dart 98.0%Language:Shell 2.0%