jasekiw / google-static-maps
generates google static map
0.5.1
2016-11-16 03:40 UTC
Requires
- php: ^5.6.0 || ^7.0
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- phpunit/phpunit: ^5.6
This package is not auto-updated.
Last update: 2024-12-21 21:25:41 UTC
README
A PHP library to generate Google Static Map Links. The Google Static Maps Library (V2) is a free service, [made available by Google] (https://developers.google.com/maps/documentation/staticmaps/).
Using simple OO methods, this project will build the URL which can be used in an image tag.
Example Code:
$oStaticMap = new GoogleStaticMap();
$oStaticMap ->setCenter("London,UK")
->setHeight(300)
->setWidth(232)
->setZoom(8)
->setFormat("jpg")
->setFeatureStyling(array(
"feature" => "all",
"element" => "all",
"style" => array(
"hue" => "#006400",
"lightness" => 50
)
));
echo '<img src="' . $oStaticMap . '" height="' . $oStaticMap->getHeight() . '" width="' . $oStaticMap->getWidth() . '" />';
Example Output:
Requirements:
This library requires no additional software beyond a functional version of PHP 5.2 (or greater) and if you wish to retrieve the Map image, a working Internet connection.