2017 © Pedro Peláez
 

package google-map-distance-calculator

Simple class for basic google maps distance calculations.

image

owenmelbz/google-map-distance-calculator

Simple class for basic google maps distance calculations.

  • Wednesday, February 21, 2018
  • by OwenMelbz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Simple Google Maps Distance Calculator

Allows you to return distance and duration between 2 long/lat positions, (*1)

Usage


use OwenMelbz\GoogleMapDistanceCalculator\DistanceCalculator; $maps = new DistanceCalculator($apiKey = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXx'); $maps->setStartingPoint(52.629129, 1.290570); $maps->setEndPoint(52.623990, 1.304594); $maps->setEndPoints([ [52.623990, 1.304594], [52.623990, 1.304594], [52.623990, 1.304594], ]); // maximum of 25 is supported by google $maps->setTravelMode('walking'); // default 'driving' $maps->setFormat('xml'); // default 'json' $maps->setUnit('metric'); // default 'imperial' $maps->getDistance(); $maps->getDistanceInMeters(); $maps->getTravelDuration(); $maps->getTravelDurationInSeconds(); $maps->calculate(); // returns whole response from google $maps->toArray(); // generates a friendly bundle of the data $maps->getDistanceInMeters(2); // If using multiple endpoints the array key to return the data from e.g. the 3rd item in the array.

The Versions

21/02 2018

dev-master

9999999-dev

Simple class for basic google maps distance calculations.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

by Owen Melbourne

distance google maps