mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-12-01 12:33:45 +01:00
Ongoing development.
This commit is contained in:
71
src/Netzmacht/Contao/Leaflet/Event/GetJavascriptEvent.php
Normal file
71
src/Netzmacht/Contao/Leaflet/Event/GetJavascriptEvent.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package dev
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2014 netzmacht creative David Molineus
|
||||
* @license LGPL 3.0
|
||||
* @filesource
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Event;
|
||||
|
||||
use Netzmacht\LeafletPHP\Definition\Map;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* Class GetJavascriptEvent is emitted after the map javascript was created.
|
||||
*
|
||||
* @package Netzmacht\Contao\Leaflet\Event
|
||||
*/
|
||||
class GetJavascriptEvent extends Event
|
||||
{
|
||||
const NAME = 'leaflet.service.get-javascript';
|
||||
|
||||
/**
|
||||
* The generated javascript.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $javascript;
|
||||
|
||||
/**
|
||||
* The map definition.
|
||||
*
|
||||
* @var Map
|
||||
*/
|
||||
private $map;
|
||||
|
||||
/**
|
||||
* Construct.
|
||||
*
|
||||
* @param Map $map The map definition.
|
||||
* @param string $javascript The generated javascript.
|
||||
*/
|
||||
public function __construct($map, $javascript)
|
||||
{
|
||||
$this->map = $map;
|
||||
$this->javascript = $javascript;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the generated javascript.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getJavascript()
|
||||
{
|
||||
return $this->javascript;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the map definition.
|
||||
*
|
||||
* @return Map
|
||||
*/
|
||||
public function getMap()
|
||||
{
|
||||
return $this->map;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user