Compare commits

..
40 Commits
Author SHA1 Message Date
David Molineus 6054def7aa Prepare release 2020-08-28 17:19:04 +02:00
David Molineus 86026a473b Add support for hofff/contao-consent-bridge #81 2020-08-28 17:14:33 +02:00
David Molineus 90c4621918 Prepare release 2020-08-28 16:57:52 +02:00
David Molineus e5263a6315 Copy map layer relations (Fix #89) 2020-08-28 16:56:11 +02:00
David Molineus 515a191a66 Bump npm dependencies and recompile js 2020-08-28 16:46:58 +02:00
David Molineus f2f7e87fd3 Merge pull request #88 from fritzmg/patch-1
Use template_legend instead of templates_legend
2020-08-10 16:56:58 +02:00
Fritz Michael Gschwantner 4198b2b6cd add author 2020-05-04 09:12:00 +01:00
Fritz Michael Gschwantner fbd1ef81b0 use template_legend instead of templates_legend 2020-05-03 16:19:16 +01:00
Fritz Michael Gschwantner 92a376a307 use template_legend instead of template_legend 2020-05-03 16:18:33 +01:00
David Molineus bf6a1f9db0 Add funding information 2020-01-03 09:21:09 +01:00
David Molineus c523aed70d Merge tag '3.1.6' 2020-01-03 09:09:21 +01:00
David Molineus 4795767a8b Prepare the release 2020-01-03 09:08:59 +01:00
David Molineus c0efdb058e Fix potential security issue 2020-01-03 09:08:52 +01:00
David Molineus a4547ffb17 Use relative icon path for the backend group icon (#83) 2020-01-03 08:53:47 +01:00
David Molineus a63c836535 Fix labels (See #83) 2020-01-03 08:49:07 +01:00
David Molineus 711b06c6d3 Do not apply options which value is null 2020-01-03 08:43:21 +01:00
David Molineus 70b7d0ab9c Fix release date 2019-08-26 09:04:19 +02:00
David Molineus ea59841d6e Merge tag '3.1.5' 2019-08-26 09:03:57 +02:00
David Molineus 64c332bc25 Update node packages and recompile 2019-08-26 09:03:32 +02:00
David Molineus 3db5aad6d3 Fix composer.json 2019-08-21 13:29:08 +02:00
David Molineus cef9d7ff44 Use twig instead of templating engine to render about page
This restores compatibility with Contao 4.8 without changing default
configuration of the symfony framework bundle.
2019-08-21 13:27:11 +02:00
David Molineus 06dd3655c0 Merge tag '3.1.4' 2019-02-13 12:56:00 +01:00
David Molineus 3b066dfeb7 Prepare release. 2019-02-13 12:53:50 +01:00
David Molineus 697e8d2f5e Drop unused function use statements. 2019-02-13 12:50:59 +01:00
David Molineus a6c08ae8e5 Fix #71: Using multiple edit to copy entities leads to invalid aliases. Do not copy aliases at all. 2019-02-13 12:46:19 +01:00
David Molineus bb8f9e42dc Fix #76: Urls to packagist used packagist.com instead of packagist.org. 2019-02-13 12:35:00 +01:00
David Molineus 3be5da9176 Fix #75: A non existing image of an image icon throws an exception. 2019-02-13 12:33:44 +01:00
David Molineus 55e4ed0702 Fix #74: Markers with negative coordinates aren't displayed on the map. 2019-02-13 12:09:40 +01:00
David Molineus d42e0e122f Fix order changes in layer control element aren't applied (#72). 2019-02-13 12:06:30 +01:00
David Molineus ac05d103f1 Normalize composer.json, add user documentation link to support section and to the readme (See #9). 2019-02-13 12:01:42 +01:00
David Molineus cc9990cf4d Test against PHP 7.4snapshot. 2019-02-13 11:54:33 +01:00
David Molineus 9643b2c196 Link version number to the github compare link. 2019-02-13 11:27:32 +01:00
David Molineus 4d55b012fd Merge branch 'master' of github.com:netzmacht/contao-leaflet-maps 2019-01-10 16:42:31 +01:00
David Molineus 39a7207e23 Merge tag '3.1.3' 2019-01-10 16:41:33 +01:00
David Molineus c4feeb1b38 Add missing error block. 2019-01-10 16:41:03 +01:00
David Molineus cb3e9bc8b4 Make controller public as it's required by Symfony 4. 2019-01-10 16:39:43 +01:00
David Molineus 6a88ed380b Update travis configuration for compatibility issues with phpcq v1.2.0. Test against PHP 7.3 as well. 2018-12-18 10:56:29 +01:00
David Molineus 59e671f8ea Update CHANGELOG.md 2018-12-18 09:55:36 +01:00
David Molineus b0df34b86e Update CHANGELOG.md 2018-12-18 09:55:18 +01:00
David Molineus 4ea2adbb85 Merge tag '3.1.2' 2018-12-18 09:26:49 +01:00
35 changed files with 741 additions and 1005 deletions

No files matched your search

+1
View File
@@ -0,0 +1 @@
github: [dmolineus]
+16 -4
View File
@@ -1,8 +1,18 @@
dist: xenial
addons:
apt:
packages:
- ant-optional
language: php
php:
- "7.1"
- "7.3"
- "7.2"
- "7.1"
- "7.4snapshot"
- "nightly"
env:
- CONTAO_VERSION=contao/core-bundle ~4.4.0
@@ -11,10 +21,12 @@ env:
matrix:
exclude:
allow_failures:
- php: "nightly"
- php: "7.4snapshot"
sudo: false
install:
before_script:
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- travis_retry composer self-update && composer --version
- travis_retry composer require $CONTAO_VERSION --no-update
- travis_retry composer update --prefer-dist --no-interaction
+75 -26
View File
@@ -6,9 +6,58 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 3.1.2 - TBD
## [Unreleased]
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.1...hotfix/3.1.2)
## [3.2.0] - 2020-08-28
### Added
- Add support for consent tools based on `hofff/contao-consent-bridge`
## [3.1.7] - 2020-08-28
### Fixed
- Duplicate map layer relations ([#89](https://github.com/netzmacht/contao-leaflet-maps/issues/89))
## [3.1.6] - 2020-01-03
### Fixed
- Do not add options which value is `NULL`
- Fix button labels ([#83](https://github.com/netzmacht/contao-leaflet-maps/issues/83))
- Fix potential security issue of symfony/dependency-injection (https://github.com/advisories/GHSA-pgwj-prpq-jpc2)
### Changed
- Use relative path for backend icon ([#82](https://github.com/netzmacht/contao-leaflet-maps/issues/82))
## [3.1.5] - 2019-08-26
### Fixed
- Use twig directly instead of templating component to restore Contao 4.8
## [3.1.4] - 2019-02-13
### Fixed
- Fix ordering changes in layer control element aren't recognized ([#72](https://github.com/netzmacht/contao-leaflet-maps/issues/72))
- Fix markers with negative coordinates aren't displayed ([#74](https://github.com/netzmacht/contao-leaflet-maps/issues/74))
- Fix image icon with non existing image throws exception ([#75](https://github.com/netzmacht/contao-leaflet-maps/issues/75))
- Fix invalid alias then using multiple edit. Aliases aren't copied anymore. ([#71](https://github.com/netzmacht/contao-leaflet-maps/issues/71))
## [3.1.3] - 2019-01-10
### Fixed
- Fix broken api routes in Contao 4.6/Symfony 4 (#69)
- Fix broken about.html.twig template. Error block was missing
## 3.1.2 - 2018-12-18
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.1...3.1.2)
### Fixed
@@ -29,9 +78,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add missing GeoportailFrance of leaflet-providers
- Add missing OneMapSG of leaflet-providers
## 3.1.1 - 2018-12-07
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.0...3.1.1)
## [3.1.1] - 2018-12-07
### Fixed
@@ -65,43 +112,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix broken marker cluster layer (#60).
## 3.0.4 - 2018-10-08
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.3...3.0.4)
## [3.0.4] - 2018-10-08
### Fixed
- Fix broken content element attributes (Missing class and custom id).
## 3.0.3 - 2018-09-18
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.2...3.0.3)
## [3.0.3] - 2018-09-18
### Fixed
- Make alias generator services public for Contao 4.6/Symfony 4.0 compatibility.
## 3.0.2 - 2018-08-23
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.1...3.0.2)
## [3.0.2] - 2018-08-23
- Run composer require checker and solve issues.
## 3.0.1 - 2018-06-20
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0...3.0.1)
## [3.0.1] - 2018-06-20
- Fix broken dynamic bbox related data loading (#57)
## 3.0.0 - 2018-01-05
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0-beta1...3.0.0)
## [3.0.0] - 2018-01-05
- Make hook/dca listener services public
## 3.0.0-beta1 - 2017-11-15
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0-alpha2...3.0.0-beta1)
## [3.0.0-beta1] - 2017-11-15
Enhancements
@@ -112,9 +147,7 @@ Bugfixes
- Broken service definitions
- Broken file layer id
## 3.0.0-alpha1 - 2017-10-19
[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0-alpha1...3.0.0-alpha2)
## [3.0.0-alpha2] - 2017-10-19
Implemented enhancements
@@ -123,3 +156,19 @@ Implemented enhancements
- New file layer for gpx,kml,wkt,topojson,geojson files added
- Bypass filesystem cache in debug mode
- Changelog added
[Unreleased]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.2.0...hotfix/3.2.1
[3.2.0]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.7...3.2.0
[3.1.7]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.6...3.1.7
[3.1.6]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.5...3.1.6
[3.1.5]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.4...3.1.5
[3.1.4]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.3...3.1.4
[3.1.3]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.2...3.1.3
[3.1.1]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.0...3.1.1
[3.0.4]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.3...3.0.4
[3.0.3]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.2...3.0.3
[3.0.2]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.1...3.0.2
[3.0.1]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0...3.0.1
[3.0.0]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0-beta1...3.0.0
[3.0.0-beta1]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0-alpha2...3.0.0-beta1
[3.0-0-alpha2]: https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.0-alpha1...3.0.0-alpha2
+9 -3
View File
@@ -2,9 +2,9 @@ Leaflet integration into Contao CMS
===================================
[![Build Status](http://img.shields.io/travis/netzmacht/contao-leaflet-maps/master.svg?style=flat-square)](https://travis-ci.org/netzmacht/contao-leaflet-maps)
[![Version](http://img.shields.io/packagist/v/netzmacht/contao-leaflet-maps.svg?style=flat-square)](http://packagist.com/packages/netzmacht/contao-leaflet-maps)
[![License](http://img.shields.io/packagist/l/netzmacht/contao-leaflet-maps.svg?style=flat-square)](http://packagist.com/packages/netzmacht/contao-leaflet-maps)
[![Downloads](http://img.shields.io/packagist/dt/netzmacht/contao-leaflet-maps.svg?style=flat-square)](http://packagist.com/packages/netzmacht/contao-leaflet-maps)
[![Version](http://img.shields.io/packagist/v/netzmacht/contao-leaflet-maps.svg?style=flat-square)](http://packagist.org/packages/netzmacht/contao-leaflet-maps)
[![License](http://img.shields.io/packagist/l/netzmacht/contao-leaflet-maps.svg?style=flat-square)](http://packagist.org/packages/netzmacht/contao-leaflet-maps)
[![Downloads](http://img.shields.io/packagist/dt/netzmacht/contao-leaflet-maps.svg?style=flat-square)](http://packagist.org/packages/netzmacht/contao-leaflet-maps)
[![Contao Community Alliance coding standard](http://img.shields.io/badge/cca-coding_standard-red.svg?style=flat-square)](https://github.com/contao-community-alliance/coding-standard)
This extension provides a backend gui for integrating [Leaflet](http://leafletjs.com/) into the Contao CMS.
@@ -38,6 +38,12 @@ Features
- Autoloading of required assets.
- [Layer for MetaModels](https://github.com/netzmacht/contao-leaflet-metamodels)
Documentation
-------------
A basic [user documentation](http://leaflet-maps-for-contao.readthedocs.org/) written in German is available.
Changelog
---------
+41 -36
View File
@@ -1,12 +1,12 @@
{
"name": "netzmacht/contao-leaflet-maps",
"type": "contao-bundle",
"description": "Contao Leaflet maps integration",
"keywords": [
"contao",
"maps",
"leaflet"
],
"type": "contao-bundle",
"license": "LGPL-3.0-or-later",
"authors": [
{
@@ -16,38 +16,53 @@
"role": "Developer"
}
],
"support": {
"email": "mail@netzmacht.de",
"issues": "https://github.com/netzmacht/contao-leaflet-maps/issues",
"source": "https://github.com/netzmacht/contao-leaflet-maps"
},
"require": {
"php": ">=7.1",
"ext-json": "*",
"ext-pdo": "*",
"contao-community-alliance/meta-palettes": "^2.0 || ^1.11",
"contao/core-bundle": "~4.4",
"doctrine/cache": "^1.0",
"doctrine/dbal": "^2.5",
"symfony/config": "~3.3 || ~4.0",
"symfony/event-dispatcher": "~3.3 || ~4.0",
"symfony/dependency-injection": "~3.3 || ~4.0",
"symfony/filesystem": "~3.3 || ~4.0",
"symfony/http-kernel": "~3.3 || ~4.0",
"symfony/translation": "~3.3 || ~4.0",
"symfony/templating": "~3.3 || ~4.0",
"netzmacht/contao-leaflet-libraries": "^1.3.4",
"menatwork/contao-multicolumnwizard": "^3.3",
"netzmacht/contao-leaflet-geocode-widget": "^1.2",
"netzmacht/contao-leaflet-libraries": "^1.3.4",
"netzmacht/contao-page-context": "~1.0",
"netzmacht/contao-toolkit": "~3.0",
"netzmacht/php-javascript-builder": "^1.0",
"netzmacht/php-leaflet": "^1.1.0",
"netzmacht/contao-toolkit": "~3.0",
"netzmacht/contao-page-context": "~1.0",
"contao-community-alliance/meta-palettes": "^2.0 || ^1.5",
"menatwork/contao-multicolumnwizard": "^3.2",
"doctrine/cache": "^1.0"
"symfony/config": "~3.3 || ~4.0",
"symfony/dependency-injection": "^3.4.26 || ^4.1.12",
"symfony/event-dispatcher": "~3.3 || ~4.0",
"symfony/filesystem": "~3.3 || ~4.0",
"symfony/http-kernel": "~3.3 || ~4.0",
"symfony/twig-bundle": "~3.3 || ~4.0",
"symfony/translation": "~3.3 || ~4.0",
"twig/twig": "^1.3.35 || ^2.0"
},
"require-dev": {
"phpcq/all-tasks": "^1.2",
"contao/manager-plugin": "^2.1",
"phpstan/phpstan": "^0.10.3"
"hofff/contao-consent-bridge": "^1.0",
"phpcq/all-tasks": "^1.2"
},
"conflict": {
"hofff/contao-consent-bridge": "<1.0 || >= 2.0"
},
"extra": {
"branch-alias": {
"dev-master": "3.2.x-dev",
"dev-develop": "3.3.x-dev",
"dev-support/2.x": "2.0.x-dev"
},
"contao": {
"transifex": {
"project": "contao-leaflet-maps",
"prefix": "core-",
"languages_cto": "src/Bundle/Resources/contao/languages",
"languages_tx": ".tx"
}
},
"contao-manager-plugin": "Netzmacht\\Contao\\Leaflet\\Bundle\\ContaoManager\\Plugin"
},
"autoload": {
"psr-4": {
@@ -59,20 +74,10 @@
"vendor/phpcq/autoload-validation/hacks/contao-hack.php"
]
},
"extra": {
"branch-alias": {
"dev-master": "3.1.x-dev",
"dev-develop": "3.2.x-dev",
"dev-support/2.x": "2.0.x-dev"
},
"contao-manager-plugin": "Netzmacht\\Contao\\Leaflet\\Bundle\\ContaoManager\\Plugin",
"contao": {
"transifex": {
"project": "contao-leaflet-maps",
"prefix": "core-",
"languages_cto": "src/Bundle/Resources/contao/languages",
"languages_tx": ".tx"
}
}
"support": {
"email": "mail@netzmacht.de",
"issues": "https://github.com/netzmacht/contao-leaflet-maps/issues",
"source": "https://github.com/netzmacht/contao-leaflet-maps",
"docs": "http://leaflet-maps-for-contao.readthedocs.org/"
}
}
+429 -885
View File
File diff suppressed because it is too large. Load diff
+3 -3
View File
@@ -4,10 +4,10 @@
"description": "Leaflet maps for Contao",
"main": "gulpfile.js",
"dependencies": {
"gulp": "^4.0.0",
"gulp-cli": "^2.0.1",
"gulp": "^4.0.2",
"gulp-cli": "^2.2.0",
"gulp-concat": "^2.6.1",
"gulp-uglify": "^3.0.1",
"gulp-uglify": "^3.0.2",
"promised-del": "^1.0.2"
},
"devDependencies": {},
+12 -10
View File
@@ -5,15 +5,15 @@
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @copyright 2014-2019 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
namespace Netzmacht\Contao\Leaflet\Backend\Action;
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface as Engine;
use Symfony\Component\HttpFoundation\Response;
use Twig\Environment;
/**
* Credits backend module.
@@ -23,11 +23,11 @@ use Symfony\Component\HttpFoundation\Response;
final class AboutAction
{
/**
* Templating engine.
* Twig environment.
*
* @var Engine
* @var Environment
*/
private $engine;
private $twig;
/**
* Project directory.
@@ -39,12 +39,12 @@ final class AboutAction
/**
* AboutAction constructor.
*
* @param Engine $engine Templating engine.
* @param string $projectDir Project directory.
* @param Environment $twig Twig environment.
* @param string $projectDir Project directory.
*/
public function __construct(Engine $engine, string $projectDir)
public function __construct(Environment $twig, string $projectDir)
{
$this->engine = $engine;
$this->twig = $twig;
$this->projectDir = $projectDir;
}
@@ -62,7 +62,9 @@ final class AboutAction
[$data['version'], $data['dependencies']] = $this->extractFromComposer();
return $this->engine->renderResponse('@NetzmachtContaoLeaflet/backend/about.html.twig', $data);
return new Response(
$this->twig->render('@NetzmachtContaoLeaflet/backend/about.html.twig', $data)
);
}
/**
+37
View File
@@ -0,0 +1,37 @@
<?php
/**
* Leaflet maps for Contao CMS.
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
*/
declare(strict_types=1);
namespace Netzmacht\Contao\Leaflet\Bundle\ConsentBridge;
use Hofff\Contao\Consent\Bridge\Bridge;
use Hofff\Contao\Consent\Bridge\Plugin as ConsentBridgePlugin;
use Hofff\Contao\Consent\Bridge\Render\RenderInformation;
/**
* Consent Bridge plugin for leaflet.
*/
final class Plugin implements ConsentBridgePlugin
{
/**
* {@inheritDoc}
*/
public function load(Bridge $bridge): void
{
$renderInformation = RenderInformation::autoRenderWithPlaceholder('leaflet_consent_bridge_placeholder');
$bridge
->supportContentElement('leaflet', $renderInformation)
->supportFrontendModule('leaflet', $renderInformation);
}
}
+7 -1
View File
@@ -128,11 +128,17 @@ services:
- { name: Netzmacht\Contao\PageContext\Request\PageIdDeterminator }
Netzmacht\Contao\Leaflet\Frontend\Action\LayerDataAction:
public: true
arguments:
- '@netzmacht.contao_leaflet.map.provider'
- '@netzmacht.contao_leaflet.filter_factory'
Netzmacht\Contao\Leaflet\Backend\Action\AboutAction:
public: true
arguments:
- '@templating'
- '@twig'
- '%kernel.project_dir%'
Netzmacht\Contao\Leaflet\Bundle\ConsentBridge\Plugin:
tags:
- { name: hofff_contao_consent_bridge.plugin }
@@ -5,6 +5,7 @@
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @author Fritz Michael Gschwantner <fmg@inspiredminds.at>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
@@ -13,7 +14,7 @@
$GLOBALS['TL_DCA']['tl_content']['metapalettes']['leaflet'] = [
'type' => ['type', 'headline'],
'leaflet' => ['leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height'],
'templates' => [':hide', 'customTpl', 'leaflet_template'],
'template' => [':hide', 'customTpl', 'leaflet_template'],
'protected' => [':hide', 'protected'],
'expert' => [':hide', 'guests', 'cssID', 'space'],
'invisible' => [':hide', 'invisible', 'start', 'start'],
@@ -164,6 +164,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = [
'maxlength' => 255,
'tl_class' => 'w50',
'nullIfEmpty' => true,
'doNotCopy' => true,
],
'toolkit' => [
'alias_generator' => [
@@ -179,7 +179,14 @@ $GLOBALS['TL_DCA']['tl_leaflet_icon'] = [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
'eval' => [
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50',
'unique' => true,
'doNotCopy' => true,
'nullIfEmpty' => true,
],
'toolkit' => [
'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',
@@ -278,7 +278,14 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
'eval' => [
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50',
'unique' => true,
'nullIfEmpty' => true,
'doNotCopy' => true,
],
'toolkit' => [
'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',
@@ -28,6 +28,9 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = [
'onsubmit_callback' => [
['netzmacht.contao_leaflet.listeners.dca.leaflet', 'clearCache'],
],
'oncopy_callback' => [
['netzmacht.contao_leaflet.listeners.dca.map', 'copyLayerRelations'],
],
],
'list' => [
@@ -157,7 +160,14 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
'eval' => [
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50',
'unique' => true,
'doNotCopy' => true,
'nullIfEmpty' => true,
],
'toolkit' => [
'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',
@@ -160,7 +160,14 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
'eval' => [
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50',
'unique' => true,
'doNotCopy' => true,
'nullIfEmpty' => true,
],
'toolkit' => [
'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',
@@ -151,7 +151,14 @@ $GLOBALS['TL_DCA']['tl_leaflet_popup'] = [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
'eval' => [
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50',
'unique' => true,
'doNotCopy' => true,
'nullIfEmpty' => true,
],
'toolkit' => [
'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',
@@ -145,7 +145,14 @@ $GLOBALS['TL_DCA']['tl_leaflet_style'] = [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
'eval' => [
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50',
'unique' => true,
'doNotCopy' => true,
'nullIfEmpty' => true,
],
'toolkit' => [
'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',
@@ -185,7 +185,14 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = [
['netzmacht.contao_toolkit.dca.listeners.alias_generator', 'handleSaveCallback'],
['netzmacht.contao_leaflet.listeners.dca.validator', 'validateAlias'],
],
'eval' => ['mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50', 'unique' => true],
'eval' => [
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50',
'unique' => true,
'doNotCopy' => true,
'nullIfEmpty' => true,
],
'toolkit' => [
'alias_generator' => [
'factory' => 'netzmacht.contao_leaflet.definition.alias_generator.factory_default',
@@ -5,6 +5,7 @@
*
* @package contao-leaflet-maps
* @author David Molineus <david.molineus@netzmacht.de>
* @author Fritz Michael Gschwantner <fmg@inspiredminds.at>
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
* @filesource
@@ -13,7 +14,7 @@
$GLOBALS['TL_DCA']['tl_module']['metapalettes']['leaflet'] = [
'type' => ['name', 'type', 'headline'],
'leaflet' => ['leaflet_map', 'leaflet_mapId', 'leaflet_width', 'leaflet_height', 'leaflet_template'],
'templates' => [':hide', 'customTpl'],
'template' => [':hide', 'customTpl'],
'protected' => [':hide', 'protected'],
'expert' => [':hide', 'guests', 'cssID', 'space'],
'invisible' => [':hide', 'invisible', 'start', 'start'],
@@ -58,7 +58,7 @@ $GLOBALS['TL_LANG']['tl_leaflet_layer']['groupTypes']['layer']['1'] = 'Ba
$GLOBALS['TL_LANG']['tl_leaflet_layer']['iconCreateFunction']['0'] = 'Cluster-Icon-Funktion erstellen';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['iconCreateFunction']['1'] = 'Diese Funktion wird zum Erstellen des Cluster-Icons benutzt.';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons']['0'] = 'Icons verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons']['1'] = 'Stile verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons']['1'] = 'Icon-Stile verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['map']['0'] = 'Karten verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['map']['1'] = 'Leaflet-Karten verwalten.';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['markerCluster']['0'] = 'Marker-Cluster';
@@ -83,7 +83,7 @@ $GLOBALS['TL_LANG']['tl_leaflet_layer']['pasteafter']['1'] = 'Na
$GLOBALS['TL_LANG']['tl_leaflet_layer']['pasteinto']['1'] = 'In Layer %s einfügen';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['polygonOptions']['0'] = 'Polygon-Optionen';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups']['0'] = 'Popups verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups']['1'] = 'Popup-Icons verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups']['1'] = 'Marker Popups verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['reference']['0'] = 'Referenz';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['reference']['1'] = 'Wählen Sie den Referenzlayer aus. Ansonsten wird dasselbe JavaScript-Objekt benutzt.';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['removeOutsideVisibleBounds']['0'] = 'Entfernen, wenn außerhalb der sichtbaren Begrenzung';
@@ -35,8 +35,8 @@ $GLOBALS['TL_LANG']['tl_leaflet_popup']['delete']['0'] = 'Popup löschen
$GLOBALS['TL_LANG']['tl_leaflet_popup']['delete']['1'] = 'Popup ID %s löschen';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['edit']['0'] = 'Popup bearbeiten';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['edit']['1'] = 'Popup ID %s bearbeiten';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons']['0'] = 'Popups verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons']['1'] = 'Marker-Popups verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons']['0'] = 'Icons verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons']['1'] = 'Marker-Icons verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['keepInView']['0'] = 'Im Sichtfeld behalten';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['keepInView']['1'] = 'Aktivieren Sie diese Einstellung um ein herausschieben des Popups aus dem sichbaren Bereich zu verhindern.';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['layersBtn']['0'] = 'Layer verwalten';
@@ -44,7 +44,7 @@ $GLOBALS['TL_LANG']['tl_leaflet_style']['new']['1'] = 'Neuen Stil erstel
$GLOBALS['TL_LANG']['tl_leaflet_style']['opacity']['0'] = 'Linientransparenz';
$GLOBALS['TL_LANG']['tl_leaflet_style']['opacity']['1'] = 'Die Transparenz des Striches kann einen Wert zwischen 0 und 1 annehmen.';
$GLOBALS['TL_LANG']['tl_leaflet_style']['popups']['0'] = 'Popups verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_style']['popups']['1'] = 'Popup-Icons verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_style']['popups']['1'] = 'Popup-Stile verwalten';
$GLOBALS['TL_LANG']['tl_leaflet_style']['show']['0'] = 'Details anzeigen';
$GLOBALS['TL_LANG']['tl_leaflet_style']['show']['1'] = 'Details des Stils ID %s anzeigen';
$GLOBALS['TL_LANG']['tl_leaflet_style']['stroke']['0'] = 'Linie ziehen';
@@ -21,7 +21,7 @@ $GLOBALS['TL_LANG']['tl_leaflet_layer']['map'][1] = 'Manage leaflet maps';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons'][0] = 'Manage icons';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['icons'][1] = 'Manage marker icons';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups'][0] = 'Manage popups';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups'][1] = 'Manage popups icons';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['popups'][1] = 'Manage popups styles';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['styles'][0] = 'Manage styles';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['styles'][1] = 'Manage vector styles';
$GLOBALS['TL_LANG']['tl_leaflet_layer']['new'][0] = 'Create layer';
@@ -19,8 +19,8 @@ $GLOBALS['TL_LANG']['tl_leaflet_popup']['layersBtn'][0] = 'Manage layers';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['layersBtn'][1] = 'Manage leaflet layers';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['styles'][0] = 'Manage styles';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['styles'][1] = 'Manage vector styles';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons'][0] = 'Manage popups';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons'][1] = 'Manage marker popups';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons'][0] = 'Manage icons';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['icons'][1] = 'Manage marker icons';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['new'][0] = 'Create popup';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['new'][1] = 'Create new popup';
$GLOBALS['TL_LANG']['tl_leaflet_popup']['edit'][0] = 'Edit popup';
@@ -19,7 +19,7 @@ $GLOBALS['TL_LANG']['tl_leaflet_style']['layersBtn'][1] = 'Manage leaflet layers
$GLOBALS['TL_LANG']['tl_leaflet_style']['icons'][0] = 'Manage icons';
$GLOBALS['TL_LANG']['tl_leaflet_style']['icons'][1] = 'Manage marker icons';
$GLOBALS['TL_LANG']['tl_leaflet_style']['popups'][0] = 'Manage popups';
$GLOBALS['TL_LANG']['tl_leaflet_style']['popups'][1] = 'Manage popups icons';
$GLOBALS['TL_LANG']['tl_leaflet_style']['popups'][1] = 'Manage popups styles';
$GLOBALS['TL_LANG']['tl_leaflet_style']['new'][0] = 'Create style';
$GLOBALS['TL_LANG']['tl_leaflet_style']['new'][1] = 'Create new style';
$GLOBALS['TL_LANG']['tl_leaflet_style']['edit'][0] = 'Edit style';
@@ -1,6 +1,6 @@
#tl_navigation .tl_level_1_group .group-leaflet {
background: url(/bundles/netzmachtcontaoleaflet/img/leaflet.svg) 3px 2px no-repeat;
background: url(../img/leaflet.svg) 3px 2px no-repeat;
}
.tl_help_table a {
@@ -1 +1 @@
!function(t){var r,e,n=function(){try{return!!Symbol.iterator}catch(t){return!1}}(),o=function(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t},i=function(t){return encodeURIComponent(t).replace(/%20/g,"+")},s=function(t){return decodeURIComponent(t).replace(/\+/g," ")};"URLSearchParams"in t&&"a=1"===new URLSearchParams("?a=1").toString()||((e=(r=function(t){if(Object.defineProperty(this,"_entries",{writable:!0,value:{}}),"string"==typeof t)""!==t&&this._fromString(t);else if(t instanceof r){var n=this;t.forEach(function(t,e){n.append(e,t)})}else{if(null===t||"object"!=typeof t)throw new TypeError("Unsupported input's type for URLSearchParams");if("[object Array]"===Object.prototype.toString.call(t))for(var e=0;e<t.length;e++){var o=t[e];if("[object Array]"!==Object.prototype.toString.call(o)&&2===o.length)throw new TypeError("Expected [string, any] as entry at index "+e+" of URLSearchParams's input");this.append(o[0],o[1])}else for(var i in t)t.hasOwnProperty(i)&&this.append(i,t[i])}}).prototype).append=function(t,e){t in this._entries?this._entries[t].push(String(e)):this._entries[t]=[String(e)]},e.delete=function(t){delete this._entries[t]},e.get=function(t){return t in this._entries?this._entries[t][0]:null},e.getAll=function(t){return t in this._entries?this._entries[t].slice(0):[]},e.has=function(t){return t in this._entries},e.set=function(t,e){this._entries[t]=[String(e)]},e.forEach=function(t,e){var n;for(var o in this._entries)if(this._entries.hasOwnProperty(o)){n=this._entries[o];for(var i=0;i<n.length;i++)t.call(e,n[i],o,this)}},e.keys=function(){var n=[];return this.forEach(function(t,e){n.push(e)}),o(n)},e.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),o(e)},e.entries=function(){var n=[];return this.forEach(function(t,e){n.push([e,t])}),o(n)},n&&(e[Symbol.iterator]=e.entries),e.toString=function(){var n=[];return this.forEach(function(t,e){n.push(i(e)+"="+i(t))}),n.join("&")},t.URLSearchParams=r);var a=URLSearchParams.prototype;"function"!=typeof a.sort&&(a.sort=function(){var n=this,o=[];this.forEach(function(t,e){o.push([e,t]),n._entries||n.delete(e)}),o.sort(function(t,e){return t[0]<e[0]?-1:t[0]>e[0]?1:0}),n._entries&&(n._entries={});for(var t=0;t<o.length;t++)this.append(o[t][0],o[t][1])}),"function"!=typeof a._fromString&&Object.defineProperty(a,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(t){if(this._entries)this._entries={};else{var n=this;this.searchParams.forEach(function(t,e){n.delete(e)})}for(var e,o=(t=t.replace(/^\?/,"")).split("&"),i=0;i<o.length;i++)e=o[i].split("="),this.append(s(e[0]),1<e.length?s(e[1]):"")}})}("undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:this),function(h){var e,t,n;if(function(){try{var t=new URL("b","http://a");return t.pathname="c%20d","http://a/c%20d"===t.href&&t.searchParams}catch(t){return!1}}()||(e=h.URL,n=(t=function(t,e){"string"!=typeof t&&(t=String(t));var n,o=document;if(e&&(void 0===h.location||e!==h.location.href)){(n=(o=document.implementation.createHTMLDocument("")).createElement("base")).href=e,o.head.appendChild(n);try{if(0!==n.href.indexOf(e))throw new Error(n.href)}catch(t){throw new Error("URL unable to set base "+e+" due to "+t)}}var i=o.createElement("a");if(i.href=t,n&&(o.body.appendChild(i),i.href=i.href),":"===i.protocol||!/:/.test(i.href))throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:i});var r=new URLSearchParams(this.search),s=!0,a=!0,p=this;["append","delete","set"].forEach(function(t){var e=r[t];r[t]=function(){e.apply(r,arguments),s&&(a=!1,p.search=r.toString(),a=!0)}}),Object.defineProperty(this,"searchParams",{value:r,enumerable:!0});var u=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==u&&(u=this.search,a&&(s=!1,this.searchParams._fromString(this.search),s=!0))}})}).prototype,["hash","host","hostname","port","protocol"].forEach(function(t){var e;e=t,Object.defineProperty(n,e,{get:function(){return this._anchorElement[e]},set:function(t){this._anchorElement[e]=t},enumerable:!0})}),Object.defineProperty(n,"search",{get:function(){return this._anchorElement.search},set:function(t){this._anchorElement.search=t,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(n,{toString:{get:function(){var t=this;return function(){return t.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(t){this._anchorElement.href=t,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(t){this._anchorElement.pathname=t},enumerable:!0},origin:{get:function(){var t={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],e=this._anchorElement.port!=t&&""!==this._anchorElement.port;return this._anchorElemenLine truncated
L.Contao=L.Evented.extend({statics:{ATTRIBUTION:' | <a href="https://netzmacht.de/contao-leaflet" title="Powered by Leaflet extension for Contao CMS developed by netzmacht David Molineus">netzmacht</a>'},maps:{},icons:{},initialize:function(){L.Icon.Default.imagePath="assets/leaflet/libs/leaflet/images/",this.setGeoJsonListeners(L.GeoJSON)},addMap:function(t,o){return this.maps[t]=o,this.fire("map:added",{id:t,map:o}),this},getMap:function(t){return void 0===this.maps[t]?null:this.maps[t]},addIcon:function(t,o){return this.icons[t]=o,this.fire("icon:added",{id:t,icon:o}),this},loadIcons:function(t){for(var o=0;o<t.length;o++){var e="extraMarkers.icon"===t[o].type?L.ExtraMarkers.icon(t[o].options):L[t[o].type](t[o].options);this.addIcon(t[o].id,e)}},getIcon:function(t){return void 0===this.icons[t]?null:this.icons[t]},load:function(t,o,e,n,i){var s=this.createRequestUrl(t,i);return this.loadFile(s,o,e,n,i)},loadUrl:function(t,o,e,n,i){t=this.applyFilterToUrl(t,i);var s=omnivore[o](t,e,n);return i&&(L.stamp(s),i.options.dynamicLoad&&"fit"==s.options.boundsMode&&(s.options.requestUrl=t,i.on("moveend",s.refreshData,s),i.on("layerremove",function(t){t.layer===s&&i.off("moveend",s.updateBounds,s)})),i.fire("dataloading",{layer:s}),s.on("ready",function(){i.calculateFeatureBounds(s),i.fire("dataload",{layer:s})}),s.on("error",function(){i.fire("dataload",{layer:s})})),s},loadFile:function(t,o,e,n,i){return this.loadUrl(t,o,e,n,i)},pointToLayer:function(t,o){var e,n="marker",i=null;return t.properties&&(t.properties.bounds=!0,t.properties.type&&(n=t.properties.type),t.properties.arguments&&(i=L[n].apply(L[n],t.properties.arguments),L.Util.setOptions(i,t.properties.options))),null===i&&(i=L[n](o,t.properties.options)),t.properties&&(t.properties.radius&&i.setRadius(t.properties.radius),!t.properties.icon||(e=this.getIcon(t.properties.icon))&&i.setIcon(e),this.bindPopupFromFeature(i,t)),this.fire("point:added",{marker:i,feature:t,latlng:o,type:n}),i},onEachFeature:function(t,o){t.properties&&(L.Util.setOptions(o,t.properties.options),this.bindPopupFromFeature(o,t),this.fire("feature:added",{feature:t,layer:o}))},bindPopupFromFeature:function(t,o){o.properties&&(o.properties.popup?t.bindPopup(o.properties.popup,o.properties.popupOptions):o.properties.popupContent&&t.bindPopup(o.properties.popupContent,o.properties.popupOptions))},setGeoJsonListeners:function(t){t&&t.prototype&&(t.prototype.options={pointToLayer:this.pointToLayer.bind(this),onEachFeature:this.onEachFeature.bind(this)})},createRequestUrl:function(t,o){var e,n="leaflet",i=document.location.search.substr(1).split("&");if(t=encodeURIComponent(t),""==i)t=document.location.pathname+"?"+[n,t].join("=");else{for(var s,r=i.length;r--;)if((s=i[r].split("="))[0]==n){s[1]=t,i[r]=s.join("=");break}r<0&&(i[i.length]=[n,t].join("=")),t=document.location.pathname+"?"+i.join("&")}return o&&o.options.dynamicLoad&&(t+="&f=bbox&v=",t+=(e=o.getBounds()).getSouth()+","+e.getWest(),t+=","+e.getNorth()+","+e.getEast()),t},applyFilterToUrl:function(t,o){var e,n,i;return o&&o.options.dynamicLoad?(t=new URL(t),n=new URLSearchParams(t.search),e=(i=o.getBounds()).getSouth()+","+i.getWest(),e+=","+i.getNorth()+","+i.getEast(),n.set("filter","bbox"),n.set("values",e),t.search=n.toString(),t.toString()):t}}),L.contao=new L.Contao,L.Control.Attribution.addInitHook(function(){this.options.prefix+=L.Contao.ATTRIBUTION}),L.Control.Attribution.include({setPrefix:function(t){return-1===t.indexOf(L.Contao.ATTRIBUTION)&&(t+=L.Contao.ATTRIBUTION),this.options.prefix=t,this._update(),this}}),L.GeoJSON.include({refreshData:function(t){var o=L.geoJson(),e=this;o.on("ready",function(){for(var t=e.getLayers(),o=0;o<t.length;o++)e.removeLayer(t[o]);for(t=this.getLayers(),o=0;o<t.length;o++)this.removeLayer(t[o]),e.addLayer(t[o])}),omnivore.geojson(L.contao.applyFilterToUrl(this.options.requestUrl,t.target),null,o)}}),L.Map.include({_dynamicBounds:null,calculateFeatureBounds:function(t,o){if(t){if(!this.options.adjustBounds&&!o)return;this._scanForBounds(t)}else this.eachLayer(this._scanForBounds,this);this._dynamicBounds&&this.fitBounds(this._dynamicBounds,this.getBoundsOptions())},getBoundsOptions:function(){return options={},this.options.boundsPadding?options.padding=this.options.boundsPadding:(this.options.boundsPaddingTopLeft&&(options.paddingTopLeft=this.options.boundsPaddingTopLeft),this.options.boundsPaddingBottomRight&&(options.paddingBottomRight=this.options.boundsPaddingBottomRight)),options},_scanForBounds:function(t){var o;!t.feature||t.feature.properties&&t.feature.properties.ignoreForBounds?L.MarkerClusterGroup&&t instanceof L.MarkerClusterGroup&&t.options.boundsMode&&"extend"==t.options.boundsMode?(o=t.getBounds()).isValid()&&(this._dynamicBounds?this._dynamicBounds.extend(o):this._dynamicBounds=L.latLngBounds(o.getSouthWest(),o.getNorthEast())):(!t.options||t.options&&t.options.boundsMode&&!t.options.ignoreForBounds)&&t.eachLayer&&t.eachLayer(this._scanForBounds,this):t.getBounds?(Line truncated
@@ -2,6 +2,8 @@
{% block headline %}{{ "MOD.leaflet_about.1"|trans({}, 'contao_modules') }}{% endblock %}
{% block error %}{% endblock %}
{% block main %}
<div class="netzmacht-leaflet-credits">
<div class="header">
+22 -2
View File
@@ -25,10 +25,8 @@ use Netzmacht\Contao\Toolkit\Dca\Listener\AbstractListener;
use Netzmacht\Contao\Toolkit\Dca\Manager;
use Netzmacht\Contao\Toolkit\Dca\Options\OptionsBuilder;
use PDO;
use function strlen;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\Translation\TranslatorInterface as Translator;
use function var_dump;
/**
* Class Map is the helper class for the tl_leaflet_map dca.
@@ -228,4 +226,26 @@ class MapDcaListener extends AbstractListener
->asTree()
->getOptions();
}
/**
* Copy layer relations if a map is duplicated.
*
* @param string|int $insertId Insert id of the new map.
* @param DataContainer $dataContainer Data container driver.
*
* @return void
*/
public function copyLayerRelations($insertId, DataContainer $dataContainer): void
{
$statement = $this->connection->prepare('SELECT * FROM tl_leaflet_map_layer WHERE mid=:mid order BY sorting');
$statement->bindValue('mid', $dataContainer->id);
$statement->execute();
while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
unset($row['id']);
$row['tstamp'] = time();
$row['mid'] = $insertId;
$this->connection->insert('tl_leaflet_map_layer', $row);
}
}
}
+4
View File
@@ -210,6 +210,10 @@ class OptionsBuilder
foreach ($options as $option => $mapping) {
$default = static::getDefaultOption($option, $definition);
if ($model->$mapping === null) {
continue;
}
if ($model->$mapping === '1' || $model->$mapping === '') {
if (((bool) $model->$mapping) !== $default) {
static::applyOption($option, $model->$mapping, $definition);
+4 -12
View File
@@ -71,16 +71,10 @@ class ImageIconMapper extends AbstractIconMapper
Request $request = null,
$elementId = null
) {
$arguments = parent::buildConstructArguments($model, $mapper, $request, $elementId);
if ($model->iconImage) {
$repository = $this->repositoryManager->getRepository(FilesModel::class);
$file = $repository->findByUuid($model->iconImage);
if ($file) {
$arguments[] = $file->path;
}
}
$arguments = parent::buildConstructArguments($model, $mapper, $request, $elementId);
$repository = $this->repositoryManager->getRepository(FilesModel::class);
$file = $repository->findByUuid($model->iconImage);
$arguments[] = $file ? $file->path : '';
return $arguments;
}
@@ -117,8 +111,6 @@ class ImageIconMapper extends AbstractIconMapper
$file = $repository->findByUuid($model->iconImage);
if ($file) {
$definition->setIconUrl($file->path);
$file = new File($file->path);
$definition->setIconSize([$file->width, $file->height]);
+2
View File
@@ -41,6 +41,7 @@ SELECT l.*, c.mode as controlMode
FROM tl_leaflet_layer l
LEFT JOIN tl_leaflet_control_layer c ON l.id = c.lid
WHERE c.cid=?
ORDER BY c.sorting
SQL;
$result = Database::getInstance()
@@ -67,6 +68,7 @@ FROM tl_leaflet_layer l
LEFT JOIN tl_leaflet_control_layer
c ON l.id = c.lid
WHERE c.cid=? AND l.active=1
ORDER BY c.sorting
SQL;
$result = Database::getInstance()
+2 -3
View File
@@ -17,7 +17,6 @@ use Netzmacht\Contao\Leaflet\Filter\BboxFilter;
use Netzmacht\Contao\Leaflet\Filter\DistanceFilter;
use Netzmacht\Contao\Leaflet\Filter\Filter;
use Netzmacht\LeafletPHP\Value\LatLngBounds;
use function var_dump;
/**
* Class MarkerModel for the tl_leaflet_marker table.
@@ -50,8 +49,8 @@ class MarkerModel extends AbstractActiveModel
[
$table . '.active=1',
$table . '.pid=?',
$table . '.latitude>0',
$table . '.longitude>0',
$table . '.latitude IS NOT NULL',
$table . '.longitude IS NOT NULL',
],
[$pid],
['order' => 'sorting']