Пример #1
0
 * Bus map
 * 2015-12-01 K.OHWADA
 */
/**
 * prefecture
 */
include_once "config.php";
include_once "class/BusDb.php";
include_once "class/BusUtil.php";
$util = new BusUtil();
$db = new BusDb();
$db->connect();
$SEARCH_FORM = $util->makeSearchForm();
// prefs default:東京
$id = isset($_GET["id"]) ? intval($_GET["id"]) : 13;
$pref = $db->getPrefById($id);
$pref_name = $pref["name"];
$node_num = $pref["node_num"];
$route_num = $pref["route_num"];
list($map_lat, $map_lon, $map_zoom) = $util->calcMapCenter($pref["max_lat"], $pref["min_lat"], $pref["max_lon"], $pref["min_lon"]);
// companies
$list = "";
$companies = $db->getCompaniesByPrefId($id);
foreach ($companies as $com) {
    $url = "<a href=\"company.php?id=" . $com["id"] . "\">" . $com["name"] . "</a>";
    $list .= "<li>" . $url . "</li>\n";
}
$com_num = count($companies);
$map_use_cluster = "true";
$use_caution = $node_num > 990 ? true : false;
?>
Пример #2
0
include_once "class/BusUtil.php";
$util = new BusUtil();
$db = new BusDb();
$db->connect();
$SEARCH_FORM = $util->makeSearchForm();
$map_zoom = "14";
$map_use_cluster = "false";
$use_caution = false;
// node
$id = isset($_GET["id"]) ? intval($_GET["id"]) : 1;
$node = $db->getNodeById($id);
$node_name = $node["name"];
$map_lat = $node["lat"];
$map_lon = $node["lon"];
$pref_id = $node["pref_id"];
$pref = $db->getPrefById($pref_id);
$pref_title = "<a href=\"prefecture.php?id=" . $pref_id . "\">" . $pref["name"] . "</a>";
// routes
$routes = $db->getRoutesByNodeId($id);
list($list_route, $list_route_navi, $list_height) = $util->makeRouteList($routes, true);
$map_corves = $db->getMapCorvesByRoutes($routes);
$map_lines = $util->makeLines($map_corves);
$route_num = count($routes);
// nodes
$nodes = $db->searchNodesPoint($map_lat, $map_lon, 5);
$map_markers = $util->makeNodeMarkers($nodes);
$list_node = $util->makeNodeListExcept($nodes, $id);
$node_count = count($nodes);
$node_num = $node_count > 0 ? $node_count - 1 : 0;
?>
<!doctype html>