merge branch ?charactergroupsqueststations?

This commit is contained in:
oliver 2016-01-15 23:01:30 +01:00
commit 538e1aa8b0
75 changed files with 19305 additions and 959 deletions

View file

@ -0,0 +1,45 @@
<?php
$features = array();
$coordinates = array();
// Add points
foreach($stations as &$station)
{
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
if($hasgroup) {
$features[] = array(
'type' => 'Feature',
'name' => 'Line',
'geometry' => array(
'type' => 'LineString',
'coordinates' => $coordinates
)
);
}
?>
<?=json_encode(array(
'type' => 'FeatureCollection',
'features' => $features
))?>