fix handling of null-values for coordinates of Character groups Quest Stations
This commit is contained in:
parent
c582156377
commit
23c212e145
2 changed files with 19 additions and 34 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue