2017 © Pedro Peláez
 

library php-google-api

A collection of google map api calls, staticmap, geocode

image

quexer69/php-google-api

A collection of google map api calls, staticmap, geocode

  • Friday, March 24, 2017
  • by Quexer69
  • Repository
  • 0 Watchers
  • 0 Stars
  • 41 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

PHP Google API

Latest Stable Version Total Downloads License, (*1)

...for Google Map API v3, PHP >= 5.3.0, Yii 1.*, (*2)

###Configuration

in your app and/or console configuration file, add these, (*3)

'components' => array(
    'googleMapApi'   => array(
            'class'             => 'vendor.quexer69.php-google-api.GoogleMapApi',
            /**
             * Google Maps Image and Geocode API settings
             */
            'staticmap_api_key' => '***************************************',
            'geocode_api_key'   => '***************************************',
            'map_type'          => 'terrain',
            'map_size'          => '520x350',
            'map_sensor'        => false,
            'map_zoom'          => 9,
            'map_scale'         => 1,
            'map_image_path'    => '/images/google_map',
            'map_marker_color'  => 'red',
            'map_iframe_width'  => '100%',
            'map_iframe_height' => '500', // in px
            'language'          => 'de',
            'quiet'             => false
    ),
    ...
),

###Usage

Just type in an address string as you do on google maps!, (*4)

$address              = '70180 Stuttgart, Germany';
$filePath             = Yii::app()->googleMapApi->createImage($address,null);

For query by latitude and longitude, (*5)

$latlng               = '48.7632145,9.174027';
$filePath             = Yii::app()->googleMapApi->createImage(null, $latlng);

Calculate Distance between two geo points, (*6)

$latlng_origin        = array('48.7632145,9.174027');
$latlng_destination   = array('48.4525334,9.468254');
$unit                 = 'miles' // or 'km'

$distance             = Yii::app()->googleMapApi->getDistance($latlng_origin, $latlng_destination, $unit);

###Public Methods

public function getGoogleMapIframe($address, $latlng, $iFrameWidth, $iFrameHeight), (*7)

public function createImage($address, $latlng, $setMarker), (*8)

public function getGeoCodeObject($address, $latlng), (*9)

public function getDistance($start, $finish, $unit), (*10)

public static function getCountryByCode($short_country_code), (*11)

The Versions

24/03 2017

dev-master

9999999-dev https://github.com/Quexer69/php-google-api

A collection of google map api calls, staticmap, geocode

  Sources   Download

BSD-3-Clause

The Requires

 

api yii google

08/10 2014

3.2.0

3.2.0.0 https://github.com/Quexer69/php-google-api

A collection of google map api calls, staticmap, geocode

  Sources   Download

BSD-3-Clause

The Requires

 

api yii google

30/09 2014

3.1.1

3.1.1.0 https://github.com/Quexer69/php-google-api

A collection of google map api calls, staticmap, geocode

  Sources   Download

BSD-3-Clause

The Requires

 

api yii google

30/09 2014

3.1.0

3.1.0.0 https://github.com/Quexer69/php-google-api

A collection of google map api calls, staticmap, geocode

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

api yii google

30/09 2014

3.0.0

3.0.0.0 https://github.com/Quexer69/php-google-api

A collection of google map api calls, staticmap, geocode

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

api yii google

30/09 2014

2.0.0

2.0.0.0 https://github.com/Quexer69/php-google-api

A collection of google map api calls, staticmap, geocode

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

api yii google