mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-11-30 20:13:49 +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\GeoJson\FeatureCollection;
|
||||
use Netzmacht\LeafletPHP\Definition\Group\GeoJson;
|
||||
use Netzmacht\LeafletPHP\Definition\Group\LayerGroup;
|
||||
use Netzmacht\LeafletPHP\Definition\Type\LatLngBounds;
|
||||
use Netzmacht\LeafletPHP\Definition\UI\Marker;
|
||||
|
||||
@@ -93,7 +92,7 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
|
||||
DefinitionMapper $mapper,
|
||||
LatLngBounds $bounds = null
|
||||
) {
|
||||
if ($definition instanceof LayerGroup) {
|
||||
if ($definition instanceof GeoJson) {
|
||||
$collection = $this->loadMarkerModels($model);
|
||||
|
||||
if ($collection) {
|
||||
@@ -101,9 +100,7 @@ class MarkersLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
|
||||
$definition->addLayer($mapper->handle($item));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($definition instanceof GeoJson) {
|
||||
if ($model->pointToLayer) {
|
||||
$definition->setPointToLayer(new Expression($model->pointToLayer));
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
|
||||
DefinitionMapper $mapper,
|
||||
LatLngBounds $bounds = null
|
||||
) {
|
||||
if ($definition instanceof LayerGroup) {
|
||||
if ($definition instanceof GeoJson) {
|
||||
$collection = $this->loadVectorModels($model);
|
||||
|
||||
if ($collection) {
|
||||
@@ -113,9 +113,7 @@ class VectorsLayerMapper extends AbstractLayerMapper implements GeoJsonMapper
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($definition instanceof GeoJson) {
|
||||
if ($model->pointToLayer) {
|
||||
$definition->setPointToLayer(new Expression($model->pointToLayer));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user