mddanish/geocode

Google map API for geocode

1.0.0 2018-10-15 11:28 UTC

This package is auto-updated.

Last update: 2024-11-16 03:17:11 UTC


README

A Composer Package For Google Map Geocode API 🎉

Features

  • Zip Code From Address
  • Latitude From Address
  • Longitude From Address
  • Latitude & Longitude From Address
  • Distance From Address
  • Address From Latitude & Longitude
  • Plus Code From Latitude & Longitude

Installation

It is available on Packagist, and installation via Composer is the recommended way to install. Just add this line to your composer.json file:

"mddanish/geocode": "~1.0"

or run

composer require mddanish/geocode

Note that the vendor folder and the vendor/autoload.php script are generated by composer. They are not the part of this package.

A Simple Example

<?php

use mddanish\TechStreet\GeoCode;
require_once "vendor/autoload.php";

$obj = new GeoCode();
echo $obj->latlonFromAddress('New Delhi','YOUR_API_KEY');

Available Functions

zipcodeFromAddress($address, $key);

latFromAddress($address, $key);

lonFromAddress($address, $key);

latlonFromAddress($address, $key);

distanceFromAddress($addressFrom, $addressTo, $unit, $key);

$unit - "Mi", "Km"

addressFromLatlon($latitude, $longitude, $key);

pluscodeFromLatlon($latitude, $longitude, $type, $key);

$type - "global", "compound"