2015-01-09 20:57:34 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
2016-10-11 10:40:15 +02:00
|
|
|
* @package contao-leaflet-maps
|
2015-01-09 20:57:34 +01:00
|
|
|
* @author David Molineus <david.molineus@netzmacht.de>
|
2016-10-11 10:40:15 +02:00
|
|
|
* @copyright 2014-2016 netzmacht David Molineus
|
2015-01-09 20:57:34 +01:00
|
|
|
* @license LGPL 3.0
|
|
|
|
|
* @filesource
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace Netzmacht\Contao\Leaflet\Frontend;
|
|
|
|
|
|
2015-01-12 19:03:29 +01:00
|
|
|
/**
|
|
|
|
|
* The frontend module for the Leaflet map.
|
|
|
|
|
*
|
|
|
|
|
* @package Netzmacht\Contao\Leaflet\Frontend
|
|
|
|
|
*/
|
2016-10-05 08:12:34 +02:00
|
|
|
class MapModule extends AbstractMapHybrid
|
2015-01-09 20:57:34 +01:00
|
|
|
{
|
2015-01-09 23:20:07 +01:00
|
|
|
/**
|
|
|
|
|
* Template name.
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
2016-10-05 08:12:34 +02:00
|
|
|
protected $templateName = 'mod_leaflet_map';
|
2015-01-14 17:50:23 +01:00
|
|
|
|
2015-01-15 15:30:16 +01:00
|
|
|
/**
|
|
|
|
|
* Get the identifier.
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2015-01-14 17:50:23 +01:00
|
|
|
protected function getIdentifier()
|
|
|
|
|
{
|
2016-10-05 08:12:34 +02:00
|
|
|
if ($this->get('leaflet_mapId')) {
|
|
|
|
|
return $this->get('leaflet_mapId');
|
2015-01-30 17:44:24 +01:00
|
|
|
}
|
|
|
|
|
|
2016-10-05 08:12:34 +02:00
|
|
|
if ($this->get('cssID')[0]) {
|
|
|
|
|
return 'map_' . $this->get('cssID')[0];
|
2015-01-30 17:44:24 +01:00
|
|
|
}
|
|
|
|
|
|
2016-10-05 08:12:34 +02:00
|
|
|
return 'map_mod_' . $this->get('id');
|
2015-01-14 17:50:23 +01:00
|
|
|
}
|
2015-01-09 20:57:34 +01:00
|
|
|
}
|