Fix double rendering of map data.

This commit is contained in:
David Molineus
2015-01-15 12:52:00 +01:00
parent 52186055d9
commit 6d0c533922
2 changed files with 2 additions and 7 deletions

View File

@@ -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));
}

View File

@@ -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));
}