A symbol is a vector-based image that can be displayed on a marker or a polyline.
First of all, if you want to render a symbol, you will need to build one. So let's go:
use Ivory\GoogleMap\Overlay\Symbol;
use Ivory\GoogleMap\Overlay\SymbolPath;
$symbol = new Symbol(SymbolPath::CIRCLE);
The symbol constructor requires a path as first argument. It also accepts additional parameters such as anchor (default null), label origin (default null) and options (default empty):
use Ivory\GoogleMap\Base\Point;
use Ivory\GoogleMap\Overlay\Symbol;
use Ivory\GoogleMap\Overlay\SymbolPath;
$symbol = new Symbol(
SymbolPath::CIRCLE,
new Point(20, 34),
new Point(0, 0),
['scale' => 10]
);
A variable is automatically generated when creating a symbol but if you want to update it, you can use:
$symbol->setVariable('symbol');
If you want to update the anchor, you can use:
use Ivory\GoogleMap\Base\Point;
$symbol->setAnchor(new Point(12, 32));
If you want to update the label origin, you can use:
use Ivory\GoogleMap\Base\Point;
$symbol->setLabelOrigin(new Point(12, 32));
The symbol options allows you to configure additional symbol aspects. See the list of available options in the official documentation. Then, to configure them, you can use:
$symbol->setOption('scale', 10);