geocoding_resolver 0.0.3%2B2

SDKflutter
Platformandroidioswindowslinuxmacosweb

Package to translate geographic coordinates into an address and vice versa.

GeoCoding Resolver

pub package License: MIT stars

Flutter Package that provides methods for converting between geographic coordinates and addresses.

Features

  • Reverse geocoding: The library provides methods to get the address of a given geographic coordinate.
  • Address suggestions: The library provides methods to get address suggestions for a given address.
  • Support for multiple languages: The methods accept an optional Locale parameter, which can be used to specify the language in which the address information should be retrieved. The default language is English.
  • Support for multiple address formats: The methods accept an optional AddressFormat parameter, which can be used to specify the address format in which the address information should be retrieved.

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  geocoding_resolver: <lastest>

Usage

The GeoCoder class is implemented as a singleton, with a factory constructor that returns the same instance of the class every time it is called.

GeoCoder geoCoder = GeoCoder();

getAddressFromLatLng

Address address = await geoCoder.getAddressFromLatLng(
    latitude: 37.4219999,
    longitude: 32.0840575
);

getAddressSuggestions

  List<LookupAddress> addresses =
    await geoCoder.getAddressSuggestions(
  address: '1600 Amphitheatre Parkway, Mountain View, CA');

Responses

Address is a class that represents an address and its details. It has the following attributes:

AttributeTypeDescription
placeIddoublerepresents the unique identifier of the place.
latitudedoublerepresents the latitude of the place.
longitudedoublerepresents the longitude of the place.
displayNameStringrepresents the display name of the place.
boundingBoxlist of stringsrepresents the bounding box of the place
addressDetailsStringAn instance of the AddressDetails class that holds more detailed information about the address.

AddressDetails is a class that represents the details of an address. It has the following attributes:

AttributeTypeDescription
houseNumberStringrepresents the house number of the address.
roadStringrepresents the road of the address.
neighbourhoodStringrepresents the neighborhood of the address.
hamletStringrepresents the hamlet of the address.
cityStringrepresents the city of the address
stateStringrepresents the state of the address.
postcodeStringrepresents the postal code of the address.
countryStringrepresents the country of the address.
countryCodeStringrepresents the country code of the address.

Dependencies

http: ^0.13.5

Additional information

the library uses the following APIs: