From 9e0fe6a0b6fa4a1dcce67b483f9e1f0d6f7e797c Mon Sep 17 00:00:00 2001 From: David Molineus Date: Tue, 27 Jan 2015 11:43:19 +0100 Subject: [PATCH] Fix bounds mode handling. --- assets/maps/contao-leaflet.js | 2 +- assets/maps/src/Mixin.Map.js | 4 +++- module/dca/tl_leaflet_marker.php | 4 ++-- .../Contao/Leaflet/Mapper/Layer/MarkersLayerMapper.php | 2 +- src/Netzmacht/Contao/Leaflet/Subscriber/GeoJsonSubscriber.php | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/assets/maps/contao-leaflet.js b/assets/maps/contao-leaflet.js index 027245d..d5cff72 100644 --- a/assets/maps/contao-leaflet.js +++ b/assets/maps/contao-leaflet.js @@ -1 +1 @@ -L.Contao=L.Class.extend({includes:L.Mixin.Events,statics:{ATTRIBUTION:' | netzmacht creative'},maps:{},icons:{},initialize:function(){L.Icon.Default.imagePath="assets/leaflet/libs/leaflet/images",this.setGeoJsonListeners(L.GeoJSON)},addMap:function(t,e){return this.maps[t]=e,this.fire("map:added",{id:t,map:e}),this},getMap:function(t){return"undefined"==typeof this.maps[t]?null:this.maps[t]},addIcon:function(t,e){return this.icons[t]=e,this.fire("icon:added",{id:t,icon:e}),this},loadIcons:function(t){for(var e=0;er&&(i[i.length]=[n,t].join("=")),t=document.location.pathname+i.join("&")}return e&&e.options.dynamicLoad&&(o=e.getBounds(),t+="&f=bbox&v=",t+=o.getSouth()+","+o.getWest(),t+=","+o.getNorth()+","+o.getEast()),t}}),L.Contao.Attribution={setPrefix:function(t){return-1===t.indexOf(L.Contao.ATTRIBUTION)&&(t+=L.Contao.ATTRIBUTION),this.options.prefix=t,this._update(),this}},L.Control.Attribution.addInitHook(function(){this.options.prefix+=L.Contao.ATTRIBUTION}),L.Control.Attribution.include(L.Contao.Attribution),L.contao=new L.Contao,L.GeoJSON.include({refreshData:function(t){var e=L.geoJson(),o=this;e.on("ready",function(){var t,e=o.getLayers();for(t=0;tnetzmacht creative'},maps:{},icons:{},initialize:function(){L.Icon.Default.imagePath="assets/leaflet/libs/leaflet/images",this.setGeoJsonListeners(L.GeoJSON)},addMap:function(t,e){return this.maps[t]=e,this.fire("map:added",{id:t,map:e}),this},getMap:function(t){return"undefined"==typeof this.maps[t]?null:this.maps[t]},addIcon:function(t,e){return this.icons[t]=e,this.fire("icon:added",{id:t,icon:e}),this},loadIcons:function(t){for(var e=0;er&&(i[i.length]=[n,t].join("=")),t=document.location.pathname+i.join("&")}return e&&e.options.dynamicLoad&&(o=e.getBounds(),t+="&f=bbox&v=",t+=o.getSouth()+","+o.getWest(),t+=","+o.getNorth()+","+o.getEast()),t}}),L.Contao.Attribution={setPrefix:function(t){return-1===t.indexOf(L.Contao.ATTRIBUTION)&&(t+=L.Contao.ATTRIBUTION),this.options.prefix=t,this._update(),this}},L.Control.Attribution.addInitHook(function(){this.options.prefix+=L.Contao.ATTRIBUTION}),L.Control.Attribution.include(L.Contao.Attribution),L.contao=new L.Contao,L.GeoJSON.include({refreshData:function(t){var e=L.geoJson(),o=this;e.on("ready",function(){var t,e=o.getLayers();for(t=0;t true, 'inputType' => 'text', 'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'), - 'sql' => "DECIMAL(10, 8)" + 'sql' => "decimal(10,8) NULL" ), 'longitude' => array ( @@ -206,7 +206,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_marker'] = array 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'), - 'sql' => "DECIMAL(11, 8)" + 'sql' => "decimal(11,8) NULL" ), 'altitude' => array ( diff --git a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/MarkersLayerMapper.php b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/MarkersLayerMapper.php index d0244ef..27936d3 100644 --- a/src/Netzmacht/Contao/Leaflet/Mapper/Layer/MarkersLayerMapper.php +++ b/src/Netzmacht/Contao/Leaflet/Mapper/Layer/MarkersLayerMapper.php @@ -108,7 +108,7 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper $point = $mapper->convertToGeoJsonFeature($marker, $item); if ($point) { - $definition->addData($point); + $definition->addData($point, true); } } } diff --git a/src/Netzmacht/Contao/Leaflet/Subscriber/GeoJsonSubscriber.php b/src/Netzmacht/Contao/Leaflet/Subscriber/GeoJsonSubscriber.php index 0dfe18d..0d005bd 100644 --- a/src/Netzmacht/Contao/Leaflet/Subscriber/GeoJsonSubscriber.php +++ b/src/Netzmacht/Contao/Leaflet/Subscriber/GeoJsonSubscriber.php @@ -194,7 +194,7 @@ class GeoJsonSubscriber implements EventSubscriberInterface } else { $parent = LayerModel::findByPk($model->pid); - if ($parent && !$parent->affectBounds) { + if ($parent && $parent->boundsMode !== 'extend') { $feature->setProperty('ignoreForBounds', true); } }