コード例 #1
0
ファイル: window.routenet.php プロジェクト: guancio/Runalyze
$minLng = 180;
$maxLng = -180;
while ($RouteData = $Routes->fetch()) {
    $Route = new Model\Route\Entity($RouteData);
    $MinCoordinate = (new League\Geotools\Geohash\Geohash())->decode($RouteData['min'])->getCoordinate();
    $MaxCoordinate = (new League\Geotools\Geohash\Geohash())->decode($RouteData['max'])->getCoordinate();
    $minLat = $MinCoordinate->getLatitude() != 0 ? min($minLat, $MinCoordinate->getLatitude()) : $minLat;
    $minLng = $MinCoordinate->getLongitude() != 0 ? min($minLng, $MinCoordinate->getLongitude()) : $minLng;
    $maxLat = $MaxCoordinate->getLatitude() != 0 ? max($maxLat, $MaxCoordinate->getLatitude()) : $maxLat;
    $maxLng = $MaxCoordinate->getLongitude() != 0 ? max($maxLng, $MaxCoordinate->getLongitude()) : $maxLng;
    $Path = new Leaflet\Activity('route-' . $RouteData['id'], $Route, null, false);
    $Path->addOption('hoverable', false);
    $Path->addOption('autofit', false);
    $Map->addRoute($Path);
}
if (!isset($Route)) {
    echo HTML::error(__('There are no routes matching the criterias.'));
}
$Map->setBounds(array('lat.min' => $minLat, 'lat.max' => $maxLat, 'lng.min' => $minLng, 'lng.max' => $maxLng));
$Map->display();
?>

<p class="info">
	<?php 
echo sprintf(__('The map contains your %s most recent routes matching the criterias.'), RunalyzePluginStat_Strecken::MAX_ROUTES_ON_NET);
?>
	<?php 
_e('More routes are not possible at the moment due to performance issues.');
?>
</p>
</div>