Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Google Map Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Extension

An extension helper allows you to add/render additional libraries and/or append some javascript code just before/after the generated one. To understand how it works, you will dig into a simple example.

First, you need to create your own extension:

namespace My\Own\Helper\Extension;

use Ivory\GoogleMap\Helper\Extension\ExtensionHelperInterface;
use Ivory\GoogleMap\Map;

class MyExtensionHelper implements ExtensionHelperInterface
{
    /**
     * {[@inheritdoc](https://github.com/inheritdoc)}
     */
    public function renderLibraries(Map $map)
    {
        // Here, we can render additional libraries...
        return '<script type="text/javascript" src="//your/own/library.js"></script>'.PHP_EOL;
    }

    /**
     * {[@inheritdoc](https://github.com/inheritdoc)}
     */
    public function renderBefore(Map $map)
    {
        // Here, we can render js code just before the generated one.
        return 'var before = \'before\''.PHP_EOL;
    }

    /**
     * {[@inheritdoc](https://github.com/inheritdoc)}
     */
    public function renderAfter(Map $map)
    {
        // Here, we can render js code just after the generated one.
        return 'var after = \'after\''.PHP_EOL;
    }
}

Then, you need to register you extension on the map helper & simply render your map:

use Ivory\GoogleMap\Map;
use Ivory\GoogleMap\Helper\MapHelper;
use My\Own\Helper\Extension\MyExtensionHelper;

$mapHelper = new MapHelper();
$mapHelper->setExtensionHelper('my_extension', new MyExtensionHelper());

$map = new Map();

$output = $mapHelper->renderJavascripts($map);

The output will be:

// Google map loading...
<script type="text/javascript" src="//your/own/library.js"></script>
<script type="text/javascript">
var before = 'before';
// Generated code...
var after = 'after';
</script>
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky