Files
contao-leaflet-maps/src/Netzmacht/Contao/Leaflet/Frontend/MapModule.php

60 lines
1.1 KiB
PHP
Raw Normal View History

<?php
/**
* @package dev
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2015 netzmacht creative David Molineus
* @license LGPL 3.0
* @filesource
*
*/
namespace Netzmacht\Contao\Leaflet\Frontend;
use Netzmacht\Contao\Toolkit\ServiceContainerTrait;
2015-01-09 23:20:07 +01:00
use Netzmacht\Contao\Leaflet\MapService;
2015-01-12 19:03:29 +01:00
/**
* The frontend module for the Leaflet map.
*
* @package Netzmacht\Contao\Leaflet\Frontend
*/
2015-01-09 23:20:07 +01:00
class MapModule extends \Module
{
2015-01-12 19:03:29 +01:00
use ServiceContainerTrait;
use HybridTrait;
2015-01-09 23:20:07 +01:00
/**
* Template name.
*
* @var string
*/
protected $strTemplate = 'mod_leaflet_map';
/**
2015-01-12 19:03:29 +01:00
* {@inheritdoc}
2015-01-09 23:20:07 +01:00
*/
public function __construct($objElement, $strColumn = 'main')
{
2015-01-12 19:03:29 +01:00
$this->construct($objElement, $strColumn);
2015-01-09 23:20:07 +01:00
}
2015-01-15 15:30:16 +01:00
/**
* Get the identifier.
*
* @return string
*/
protected function getIdentifier()
{
2015-01-30 17:44:24 +01:00
if ($this->leaflet_mapId) {
return $this->leaflet_mapId;
}
if ($this->cssID[0]) {
return 'map_' . $this->cssID[0];
}
return 'map_mod_' . $this->id;
}
}