arcasolutions/google-map
Laravel package providing Google Maps integration for your app, with helpers to generate map views and include the required scripts. Useful for quickly embedding maps and configuring markers or map options within Laravel projects.
Polygon objects are similar to polyline objects in that they consist of a series of coordinates in an ordered sequence. However, instead of being open-ended, polygons are designed to define regions within a closed loop.
use Ivory\GoogleMap\Overlays\Polygon;
$polygon = new Polygon();
// Configure your polygon options
$polygon->setPrefixJavascriptVariable('polygon_');
$polygon->setOption('fillColor', '#000000');
$polygon->setOption('fillOpacity', 0.5);
$polygon->setOptions(array(
'fillColor' => '#000000',
'fillOpacity' => 0.5,
));
Like describe in the introduction, a polygon object consists of an array of coordinates. So, you need to add coordinate to your polygon.
use Ivory\GoogleMap\Overlays\Polygon;
$polygon = new Polygon();
// Add coordinates to your polygon
$polygon->addCoordinate(0, 0, true);
$polygon->addCoordinate(1, 1, true);
use Ivory\GoogleMap\Overlays\Polygon;
$polygon = new Polygon();
// Add your polygon to the map
$map->addPolygon($polygon);
How can I help you explore Laravel packages today?