The static map rendering lets you embed a Google Maps image on your web page without requiring javascript or any dynamic page loading.
First of all, if you want to render a static map, you will need to build a static map helper. So, let's go:
use Ivory\GoogleMap\Helper\Builder\StaticMapHelperBuilder;
$staticMapHelperBuilder = StaticMapHelperBuilder::create();
$staticMapHelper = $staticMapHelperBuilder->build();
The map helper is built via a builder. The builder allows you to configure your api key and subscribers. The api key allows you to bypass Google rate limits and subscribers allow you to attach additional code to the map.
If you have an API key, you can use:
$staticMapHelperBuilder->setKey('api-key');
If you have a secret key, you can use:
$staticMapHelperBuilder->setSecret('secret');
If you have a client or channel, you can use:
$staticMapHelperBuilder->setClient('client-id');
$staticMapHelperBuilder->setChannel('channel');
If you want to hook into the static map rendering process, you can use:
$staticMapHelperBuilder->addSubscriber(/* ... */);
For rendering a static map, you can use:
echo '<img src="'.$mapHelper->render($map).'" />';
This method renders an url according to your map:
<img src="map_url" />