mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-11-30 12:03:44 +01:00
Ongoing development.
This commit is contained in:
@@ -54,7 +54,7 @@ class ContaoAssets implements Assets
|
||||
break;
|
||||
|
||||
case static::TYPE_FILE:
|
||||
$stylesheet .= '||static';
|
||||
$stylesheet .= '|all|static';
|
||||
// no break
|
||||
|
||||
default:
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace Netzmacht\Contao\Leaflet\Dca;
|
||||
|
||||
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
|
||||
use Netzmacht\Contao\Leaflet\Mapper\MapMapper;
|
||||
use Netzmacht\Contao\Leaflet\Model\LayerModel;
|
||||
use Netzmacht\Contao\Leaflet\Model\MapModel;
|
||||
use Netzmacht\LeafletPHP\Definition\Type\LatLng;
|
||||
|
||||
@@ -60,4 +61,17 @@ class Leaflet
|
||||
return $template->parse();
|
||||
}
|
||||
|
||||
public function getLayers()
|
||||
{
|
||||
$options = array();
|
||||
$collection = LayerModel::findBy('pid', '0', array('order' => 'title'));
|
||||
|
||||
if ($collection) {
|
||||
foreach ($collection as $model) {
|
||||
$options[$model->id] = $model->title;
|
||||
}
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,6 @@ class BootSubscriber implements EventSubscriberInterface
|
||||
*/
|
||||
public function loadAssets()
|
||||
{
|
||||
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/leaflet/assets/js/contao-leaflet.js';
|
||||
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/leaflet/assets/js/contao-leaflet.js|static';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,14 +47,11 @@ class EncoderSubscriber implements EventSubscriberInterface
|
||||
|
||||
if ($object instanceof Map) {
|
||||
$attribution = <<<HTML
|
||||
map.attributionControl.addAttribution(
|
||||
map.map.attributionControl.addAttribution(
|
||||
'<a href="http://www.netzmacht.de/contao-leaflet">netzmacht <em>creative</em></a>'
|
||||
);
|
||||
HTML;
|
||||
$event->getOutput()->addLine($attribution);
|
||||
|
||||
$event->getOutput()->addLine("var tileLayer = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: \"test\"});
|
||||
tileLayer.addTo(map);");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user