-
Notifications
You must be signed in to change notification settings - Fork 6
Installation
Matt Sparks edited this page Jul 4, 2017
·
4 revisions
Composer is the recommended method for installation.
composer require sparkscoding/static-maps
Once installed, include the autoloader (if it's not already included) and pull in the components you need. At a minimum you need the main StaticMap
class and the Map
component.
include '../vendor/autoload.php';
use SparksCoding\StaticMaps\StaticMap;
use SparksCoding\StaticMaps\Components\Map;
// Add your api key
$staticMap = StaticMap::key('your_api_key');
// Set the builder
$staticMap->setBuilder('\SparksCoding\StaticMaps\Builders\GoogleStaticMapBuilder');
// Add the map
$staticMap->setMap(
Map::create()->center('Lexington, KY')->zoom(13)
);
Additional examples can be found on the Examples page.