2017 © Pedro Peláez
 

library google-embed-php

Use the Embed API of Google Maps with PHP

image

frolki1_dev/google-embed-php

Use the Embed API of Google Maps with PHP

  • Sunday, April 30, 2017
  • by Frolki1_Dev
  • Repository
  • 1 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 4 Versions
  • 14 % Grown

The README.md

Google Embed PHP

Build Status codecov GitHub issues Packagist Packagist Pre Release GitHub license, (*1)

Use the Embed API of Google Maps with PHP, (*2)

Requirement

To use this library you must have at least PHP 7.0., (*3)

Installation

The Google Embed can be installed with Composer. Run this command:, (*4)

composer require frolki1_dev/google-embed-php

Usage

To use this library you must have an api key. You can get the free version because you can use the embed api for free., (*5)

use Frolki1_Dev\GoogleEmbedMap;

$maps = new GoogleEmbedMap(<Add here your api key>);

// Create a direction map
$direction = $maps->createDirectionsMap();

// Create a place map
$place = $maps->createPlaceMap();

// Crsate a search map
$search = $maps->createSearchMap();

// Create a view map
$view = $maps->createViewMap();

Options

You have the following options in every map type:, (*6)

// Set a location (street, location, place)
$mapType->setLocation(<string>);

// Set the center of the view (latitude and longitude)
$mapType->setCenter(<float>, <float>);

// Set the zoom factor (0 - 21, 0 = Whole world, 21 = A single building)
$mapType->setZoom(<int>);

// Define the UI language
$mapType->setLanguage(<string>);

// Show the map as a road map
$mapType->useRoadMap();

// Show the map as a satellite map
$mapType->useSatelliteMap();

// Get the source (url)
$mapType->getSource();

// Build a iframe
$mapType->getIFrame();

Direction options

The direction map has also the options and the following methods:, (*7)

// How the method setLocation but only the start point
$direction->start(<string>);

// Same how method start but only the destination point
$direction->destination(<string>);

// Add waypoints (Can be multiple called)
$direction->addWayPoint(<string>);

// Calculate the route with the car
$direction->drivingMode();

// Calculate the route with walking
$direction->walkingMode();

// Calculate the route with biking
$direction->bicyclingMode();

// Calclate the route with flying
$direction->flyingMode();

// Avoid tolls
$direction->avoidTolls();

// Avoid Ferry
$direction->avoidFerries();

// Avoid Highway
$dircetion->avoidHighways();

// Use the metric unit
$direction->useMetricUnit();

// Use the imperial unit
$direction->useImperialUnit();

License

This library is an open source project and is licensed under the MIT license., (*8)

The Versions

30/04 2017

dev-master

9999999-dev

Use the Embed API of Google Maps with PHP

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

30/04 2017

v1.0.x-dev

1.0.9999999.9999999-dev

Use the Embed API of Google Maps with PHP

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

30/04 2017

v1.0

1.0.0.0

Use the Embed API of Google Maps with PHP

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

29/04 2017

v0.1

0.1.0.0

Use the Embed API of Google Maps with PHP

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires