4.3 2022-03-06 17:40 UTC

This package is auto-updated.

Last update: 2024-11-29 13:31:22 UTC


README

Total Downloads Latest Stable Version License

Geocode

Geocoding is the process of converting addresses, place names, or other location identifiers into geographic coordinates (latitude and longitude). This essential functionality enables various applications and services to accurately locate and visualize locations on a map.

"Buy Me A Coffee"

Register an API Key

Your application's API key. This key identifies your application for purposes of quota management. Learn how to get a key.

Install

composer require davidvandertuijn/geocode

Usage

use Davidvandertuijn\Geocode;

Request

$geocode = new Geocode();

$geocode->setApiKey(''); // Your application's API key.
$geocode->setAddress('Westblaak 180, 3012 KN, Rotterdam, NL');

if ($geocode->request()) {
    $latitude = $geocode->getLatitude(); // 51.9163212
    $longitude = $geocode->getLongitude(); // 4.475754
}