fix handling of null-values for coordinates of Character groups Quest Stations

This commit is contained in:
oliver 2016-01-14 19:19:12 +01:00
parent e03dea0d80
commit 33e1c4d8b5
2 changed files with 19 additions and 34 deletions

View file

@ -6,22 +6,24 @@
// Add points
foreach($stations as &$station)
{
$coordinate = array(
floatval($station['longitude']),
floatval($station['latitude'])
);
$coordinates[] = $coordinate;
$features[] = array(
'type' => 'Feature',
'id' => $station['id'],
'properties' => array(
'name' => $station['title'],
),
'geometry' => array(
'type' => 'Point',
'coordinates' => $coordinate
)
);
if(!is_null($station['longitude']) && !is_null($station['latitude'])) {
$coordinate = array(
floatval($station['longitude']),
floatval($station['latitude'])
);
$coordinates[] = $coordinate;
$features[] = array(
'type' => 'Feature',
'id' => $station['id'],
'properties' => array(
'name' => $station['title'],
),
'geometry' => array(
'type' => 'Point',
'coordinates' => $coordinate
)
);
}
}
// Add lines between points

View file

@ -194,28 +194,11 @@
new ol.layer.Vector({
source: markersSource,
style: styleFunction
/*
style: new ol.style.Style({
text: new ol.style.Text({
text: '\uf041',
//text: '\uf276',
font: 'normal 28px FontAwesome',
textBaseline: 'Bottom',
fill: new ol.style.Fill({
color: '#0F373C'
})
})
})
*/
})/*,
new ol.layer.Vector({
source: pathSource
})
*/
],
target: 'map',
view: new ol.View({
center: ol.proj.transform([<?=$station['longitude']?>, <?=$station['latitude']?>], 'EPSG:4326', 'EPSG:3857'),
center: [0, 0],
zoom: 19,
maxZoom: 19
})