bensquire/php-static-maps-generator
最新稳定版本:2.0.2
Composer 安装命令:
composer require bensquire/php-static-maps-generator
包简介
A PHP library to generate Google Static Map Links.
关键字:
README 文档
README
php-static-maps-generator
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
$styling = new \GoogleStaticMap\Feature\Styling(); $styling->setHue('#006400'); $styling->setLightness(50); $featureStyling = new \GoogleStaticMap\Feature(); $featureStyling->setFeature('all'); $featureStyling->setElement('all'); $featureStyling->setStyle($styling); $map = new \GoogleStaticMap\Map(); $map->setCenter('London,UK'); $map->setHeight(300); $map->setWidth(232); $map->setZoom(8); $map->setFormat('jpg'); $map->addFeature($featureStyling); echo '<img src="' . $map . '" height="' . $map->getHeight() . '" width="' . $map->getWidth() . '" />';
Example Output:
Fix coding standards:
/usr/local/bin/php-cs-fixer fix --config=.php_cs.dist -v --dry-run
Google Static Maps API Documentation
https://developers.google.com/maps/documentation/static-maps/intro
Requirements:
This library requires no additional software beyond a functional version of PHP 7.1 (or greater) and if you wish to retrieve the Map image, a working Internet connection.
统计信息
- 总下载量: 2.11k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-12-04