Files
contao-leaflet-maps/module/config/config.php

155 lines
5.3 KiB
PHP
Raw Normal View History

2014-12-27 22:58:58 +01:00
<?php
2014-12-29 12:17:40 +01:00
/*
* Backend module.
*/
2014-12-27 22:58:58 +01:00
$GLOBALS['BE_MOD']['content']['leaflet'] = array(
2015-01-06 18:49:22 +01:00
'tables' => array(
'tl_leaflet_map',
'tl_leaflet_layer',
'tl_leaflet_control',
'tl_leaflet_marker',
'tl_leaflet_vector',
'tl_leaflet_icon',
),
2015-01-06 14:54:51 +01:00
'icon' => 'system/modules/leaflet/assets/img/leaflet.png',
2014-12-29 19:13:55 +01:00
'stylesheet' => 'system/modules/leaflet/assets/css/backend.css',
2014-12-29 12:17:40 +01:00
);
/*
* Content elements.
*/
$GLOBALS['TL_CTE']['includes']['leaflet'] = 'Netzmacht\Contao\Leaflet\LeafletMapElement';
/*
* Models.
*/
2015-01-05 12:25:46 +01:00
$GLOBALS['TL_MODELS']['tl_leaflet_control'] = 'Netzmacht\Contao\Leaflet\Model\ControlModel';
2015-01-06 21:30:57 +01:00
$GLOBALS['TL_MODELS']['tl_leaflet_icon'] = 'Netzmacht\Contao\Leaflet\Model\IconModel';
$GLOBALS['TL_MODELS']['tl_leaflet_layer'] = 'Netzmacht\Contao\Leaflet\Model\LayerModel';
$GLOBALS['TL_MODELS']['tl_leaflet_map'] = 'Netzmacht\Contao\Leaflet\Model\MapModel';
2015-01-06 14:54:51 +01:00
$GLOBALS['TL_MODELS']['tl_leaflet_marker'] = 'Netzmacht\Contao\Leaflet\Model\MarkerModel';
2014-12-29 12:17:40 +01:00
/*
* Leaflet mappers.
*
* Mappers do the translations between the database models and the leaflet definition.
*/
$GLOBALS['LEAFLET_MAPPERS'] = array();
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\MapMapper';
2014-12-29 16:23:08 +01:00
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Layer\ProviderLayerMapper';
2015-01-06 14:54:51 +01:00
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Layer\MarkersLayerMapper';
2015-01-07 12:13:26 +01:00
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Layer\GroupLayerMapper';
2015-01-05 12:25:46 +01:00
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\ZoomControlMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\ScaleControlMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\LayersControlMapper';
2015-01-05 14:58:37 +01:00
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\AttributionControlMapper';
2015-01-06 18:49:22 +01:00
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\UI\MarkerMapper';
2015-01-06 21:30:57 +01:00
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Type\ImageIconMapper';
2014-12-29 12:17:40 +01:00
/*
* Leaflet encoders.
*
* The encoders transforms the definitions into javascript. The encoders has to be an implementation of the
* EventDispatcherInterface of the event dispatcher.
*
* You can define the encoders using the syntax of the cca event dispatcher implementation.
*
* @see https://github.com/contao-community-alliance/event-dispatcher#event-subscriber-per-configuration
*/
$GLOBALS['LEAFLET_ENCODERS'] = array();
$GLOBALS['LEAFLET_ENCODERS'][] = 'Netzmacht\Javascript\Subscriber\EncoderSubscriber';
$GLOBALS['LEAFLET_ENCODERS'][] = 'Netzmacht\LeafletPHP\Encoder\MapEncoder';
$GLOBALS['LEAFLET_ENCODERS'][] = 'Netzmacht\LeafletPHP\Encoder\ControlEncoder';
$GLOBALS['LEAFLET_ENCODERS'][] = 'Netzmacht\LeafletPHP\Encoder\GroupEncoder';
$GLOBALS['LEAFLET_ENCODERS'][] = 'Netzmacht\LeafletPHP\Encoder\RasterEncoder';
$GLOBALS['LEAFLET_ENCODERS'][] = 'Netzmacht\LeafletPHP\Encoder\VectorEncoder';
2015-01-06 14:54:51 +01:00
$GLOBALS['LEAFLET_ENCODERS'][] = 'Netzmacht\LeafletPHP\Encoder\UIEncoder';
$GLOBALS['LEAFLET_ENCODERS'][] = 'Netzmacht\LeafletPHP\Encoder\TypeEncoder';
2014-12-29 12:17:40 +01:00
$GLOBALS['LEAFLET_ENCODERS'][] = 'Netzmacht\Contao\Leaflet\Subscriber\EncoderSubscriber';
2015-01-05 12:25:46 +01:00
/*
* Leaflet layer types.
*
* The type is used for the database driven definitions.
*/
2015-01-06 14:54:51 +01:00
$GLOBALS['LEAFLET_LAYERS'] = array
(
'provider' => array
(
'children' => false,
'icon' => 'system/modules/leaflet/assets/img/tile.png',
),
'group' => array
(
'children' => true,
'icon' => 'system/modules/leaflet/assets/img/group.png',
),
'markers' => array
(
'children' => false,
'icon' => 'system/modules/leaflet/assets/img/markers.png',
'markers' => true,
),
'vectors' => array
(
'children' => false,
'icon' => 'system/modules/leaflet/assets/img/vectors.png',
2015-01-06 18:49:22 +01:00
'vectors' => true,
2015-01-06 14:54:51 +01:00
),
);
2015-01-05 12:25:46 +01:00
/*
* leaflet controls.
*
* Supported leaflet control types. Register your type for the database driven definition here.
*/
$GLOBALS['LEAFLET_CONTROLS'] = array();
$GLOBALS['LEAFLET_CONTROLS'][] = 'zoom';
$GLOBALS['LEAFLET_CONTROLS'][] = 'layers';
$GLOBALS['LEAFLET_CONTROLS'][] = 'scale';
$GLOBALS['LEAFLET_CONTROLS'][] = 'attribution';
2015-01-06 21:30:57 +01:00
$GLOBALS['LEAFLET_ICONS'] = array('image', 'div');
2014-12-29 16:23:08 +01:00
/*
* Leaflet tile layer providers.
*/
2015-01-05 12:25:46 +01:00
require_once TL_ROOT . '/system/modules/leaflet/config/leaflet_providers.php';
2014-12-29 12:17:40 +01:00
2015-01-06 14:54:51 +01:00
2014-12-29 12:17:40 +01:00
/*
* Leaflet assets.
*
* The leaflet definition are aware of the required javascript libraries. Register the assets so that they are
* loaded automatically.
*
* Each entry is an array of 2 values. The first is the resource. The second is a type. Supported types are:
* - url: An valid url.
* - file: An file path relative to the Contao Root.
* - source: Inline css/javascript.
*/
2014-12-29 16:23:08 +01:00
$GLOBALS['LEAFLET_ASSETS']['leaflet'] = array(
'css' => array(
2015-01-06 18:49:22 +01:00
array('assets/leaflet/libs/leaflet/leaflet.css', 'file')
2014-12-29 16:23:08 +01:00
),
2014-12-29 12:17:40 +01:00
'javascript' => array(
2015-01-06 18:49:22 +01:00
array('assets/leaflet/libs/leaflet/leaflet.js', 'file')
2014-12-29 12:17:40 +01:00
)
);
2014-12-29 16:23:08 +01:00
$GLOBALS['LEAFLET_ASSETS']['leaflet-providers'] = array(
2014-12-29 12:17:40 +01:00
'javascript' => array(
2015-01-06 18:49:22 +01:00
array('assets/leaflet/libs/leaflet-providers/leaflet-providers.js', 'file')
2014-12-29 12:17:40 +01:00
)
2014-12-27 22:58:58 +01:00
);
2015-01-06 14:57:05 +01:00
$GLOBALS['LEAFLET_ASSETS']['leaflet-ajax'] = array(
'javascript' => array(
2015-01-06 18:49:22 +01:00
array('assets/leaflet/libs/leaflet-ajax/leaflet.ajax.min.js', 'file')
2015-01-06 14:57:05 +01:00
)
);