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

Events

JavaScript within the browser is event driven, meaning that JavaScript responds to interactions by generating events, and expects a program to listen to interesting events. The event model for the Google Maps API V3 is similar to that used in V2 of the API, though much has changed under the hood. There are two types of events:

  • User events (such as "click" mouse events) are propagated from the DOM to the Google Maps API. These events are separate and distinct from standard DOM events.
  • MVC state change notifications reflect changes in Maps API objects and are named using a property_changed convention.

Build your event

use Ivory\GoogleMap\Events\Event;

$event = new Event();

// Configure your event
$event->setInstance($instance);
$event->setEventName($eventName);
$event->setHandle($handle);

// It can only be used with a DOM event
// By default, the capture flag is false
$event->setCapture(true);

Instance

The $instance variable describes the javascript variable which registers the event. Each Ivory google map objects which can register an event have a method called getJavascriptVariable which identifies this variable.

For example, in the case of an info window, it can be:

$instance = $infoWindow->getJavascriptVariable();

Event name

Each object has his own event name which are described in the google map documentation.

Handle

The $handle is the javascript function which is executed when the event is triggered.

For example, it can be:

$handle = 'function(){alert("The event has been triggered");}'

Add your event to the map

The map wraps an event manager which allows you to add events. Like describes in the introduction, two differents type of event can be used.

DOM event

// Add a DOM event
$map->getEventManager()->addDomEvent($event);

// Add a DOM event which will be triggered only one time
$map->getEventManager()->addDomEventOnce($event);

MVC event

// Add an event
$map->getEventManager()->addEvent($event);

// Add an event which will be triggered only one time
$map->getEventManager()->addEventOnce($event);
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