mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-12-02 04:53:56 +01:00
Fix double rendering of map data.
This commit is contained in:
@@ -19,7 +19,6 @@ use Netzmacht\Javascript\Type\Value\Expression;
|
|||||||
use Netzmacht\LeafletPHP\Definition;
|
use Netzmacht\LeafletPHP\Definition;
|
||||||
use Netzmacht\LeafletPHP\Definition\GeoJson\FeatureCollection;
|
use Netzmacht\LeafletPHP\Definition\GeoJson\FeatureCollection;
|
||||||
use Netzmacht\LeafletPHP\Definition\Group\GeoJson;
|
use Netzmacht\LeafletPHP\Definition\Group\GeoJson;
|
||||||
use Netzmacht\LeafletPHP\Definition\Group\LayerGroup;
|
|
||||||
use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds;
|
use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds;
|
||||||
use Netzmacht\LeafletPHP\Definition\UI\Marker;
|
use Netzmacht\LeafletPHP\Definition\UI\Marker;
|
||||||
|
|
||||||
@@ -93,7 +92,7 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
|
|||||||
DefinitionMapper $mapper,
|
DefinitionMapper $mapper,
|
||||||
LatLngBounds $bounds = null
|
LatLngBounds $bounds = null
|
||||||
) {
|
) {
|
||||||
if ($definition instanceof LayerGroup) {
|
if ($definition instanceof GeoJson) {
|
||||||
$collection = $this->loadMarkerModels($model);
|
$collection = $this->loadMarkerModels($model);
|
||||||
|
|
||||||
if ($collection) {
|
if ($collection) {
|
||||||
@@ -101,9 +100,7 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
|
|||||||
$definition->addLayer($mapper->handle($item));
|
$definition->addLayer($mapper->handle($item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($definition instanceof GeoJson) {
|
|
||||||
if ($model->pointToLayer) {
|
if ($model->pointToLayer) {
|
||||||
$definition->setPointToLayer(new Expression($model->pointToLayer));
|
$definition->setPointToLayer(new Expression($model->pointToLayer));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
|
|||||||
DefinitionMapper $mapper,
|
DefinitionMapper $mapper,
|
||||||
LatLngBounds $bounds = null
|
LatLngBounds $bounds = null
|
||||||
) {
|
) {
|
||||||
if ($definition instanceof LayerGroup) {
|
if ($definition instanceof GeoJson) {
|
||||||
$collection = $this->loadVectorModels($model);
|
$collection = $this->loadVectorModels($model);
|
||||||
|
|
||||||
if ($collection) {
|
if ($collection) {
|
||||||
@@ -113,9 +113,7 @@ class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($definition instanceof GeoJson) {
|
|
||||||
if ($model->pointToLayer) {
|
if ($model->pointToLayer) {
|
||||||
$definition->setPointToLayer(new Expression($model->pointToLayer));
|
$definition->setPointToLayer(new Expression($model->pointToLayer));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user