merge branch ?charactergroupsqueststations?
This commit is contained in:
parent
476c18b6a9
commit
538e1aa8b0
75 changed files with 19305 additions and 959 deletions
45
views/ajax/charactergroupsqueststations/index.tpl
Normal file
45
views/ajax/charactergroupsqueststations/index.tpl
Normal 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
|
||||
))?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue