Skip to content

jordyrosenbrand/tomtom-api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TomTom PHP Api Client

Installation

composer require jordyrosenbrand/tomtom-api-client

Usage

Geocode

use Jordy\Tomtom\Tomtom;

$tomtom = new Tomtom("apikey");
$response = $tomtom->geocode()
    ->setQuery("5171KW 1")
    ->setCountrySet(["NL"])
    ->setLimit(1)
    ->fetch()
    ->first();

$address = $response->getAddressString(); // Europalaan 1, 5171 KW Kaatsheuvel
$lat = $response->getLat(); // 51.64921
$lng = $response->getLng(); //5.04381

Structured Geocode

use Jordy\Tomtom\Tomtom;

$tomtom = new Tomtom("apikey");
$response = $tomtom->structuredGeocode()
    ->setPostalCode("5171KW")
    ->setHouseNumber(1)
    ->setCountryCode("NL")
    ->setLimit(1)
    ->fetch()
    ->first();

XML

use Jordy\Tomtom\Tomtom;

$tomtom = new Tomtom("apikey");
$response = $tomtom->structuredGeocode()
    ->setExtension($tomtom->structuredGeocode()::EXT_XML);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages