From: maxious Date: Wed, 20 Jul 2011 11:46:30 +0000 Subject: Fix geositemap X-Git-Url: http://maxious.lambdacomplex.org/git/?p=busui.git&a=commitdiff&h=6a51bda5f70afdfb472e3ed766f0a7a8e4733249 --- Fix geositemap --- --- a/about.php +++ b/about.php @@ -17,6 +17,10 @@ Feedback encouraged; contact maxious@lambdacomplex.org

Some icons by Joseph Wain / glyphish.com
+Native clients also available for iPhone(cbrTimetable by Sandor Kolotenko +, ACT Buses by David Sullivan) +and Android (MyBus 2.0 by Imagine Team) +

Disclaimer: The content of this website is of a general and informative nature. Please check with printed timetables or those available on http://action.act.gov.au before your trip. Whilst every effort has been made to ensure the high quality and accuracy of the Site, the Author makes no warranty, --- a/aws/awsStartup.sh +++ b/aws/awsStartup.sh @@ -26,6 +26,9 @@ #createuser transitdata -SDRP #password transitdata #psql -d transitdata -c \"GRANT SELECT ON TABLE agency,calendar,calendar_dates,routes,stop_times,stops,trips TO transitdata;\" +#psql -d transitdata -c "GRANT SELECT,INSERT ON TABLE myway_observations,myway_routes,myway_stops,myway_timingdeltas TO transitdata;" +#psql -d transitdata -c "GRANT SELECT,INSERT,UPDATE ON TABLE myway_routes,myway_stops TO transitdata;" +##psql -d transitdata -c "GRANT SELECT ON ALL TABLES IN SCHEMA public TO transitdata;" php /var/www/updatedb.php wget http://s3-ap-southeast-1.amazonaws.com/busresources/Graph.obj \ --- /dev/null +++ b/css/local.css.php @@ -1,1 +1,216 @@ - + + --- a/dotcloud/postinstall +++ b/dotcloud/postinstall @@ -3,8 +3,8 @@ curl http://s3-ap-southeast-1.amazonaws.com/busresources/cbrfeed.zip \ -o /home/dotcloud/current/cbrfeed.zip -wget http://s3-ap-southeast-1.amazonaws.com/busresources/Graph.obj \ --O /tmp/Graph.obj +curl http://s3-ap-southeast-1.amazonaws.com/busresources/Graph.obj \ +-o /tmp/Graph.obj #db setup #curl https://github.com/maxious/ACTBus-ui/raw/master/transitdata.cbrfeed.sql.gz -o transitdata.cbrfeed.sql.gz --- a/include/common-geo.inc.php +++ b/include/common-geo.inc.php @@ -1,8 +1,9 @@ $mapPoint) { - $markers.= $mapPoint[0] . "," . $mapPoint[1] . "," . $markerImage . ($index + 1); + if ($twotone && $index == 0) { + $markers.= $mapPoint[0] . "," . $mapPoint[1] . "," . "iconr" . ($index + 1); + $center = "{$mapPoints[0][0]},{$mapPoints[0][1]}"; + } + else { + $markers.= $mapPoint[0] . "," . $mapPoint[1] . "," . $markerImage . ($index + 1); + } if ($index + 1 != sizeof($mapPoints)) $markers.= "|"; - if ($mapPoint[0] < $minlat) $minlat = $mapPoint[0]; - if ($mapPoint[0] > $maxlat) $maxlat = $mapPoint[0]; - if ($mapPoint[1] < $minlon) $minlon = $mapPoint[1]; - if ($mapPoint[1] > $maxlon) $maxlon = $mapPoint[1]; + $dist = distance($mapPoints[0][0], $mapPoint[0][1], $mapPoint[0], $mapPoint[1]); + $mapwidthinmeters = ($dist > $mapwidthinmeters ? $dist : $mapwidthinmeters); $totalLat+= $mapPoint[0]; $totalLon+= $mapPoint[1]; } if ($zoom == 0) { $mapwidthinmeters = distance($minlat, $minlon, $minlat, $maxlon); foreach (array_reverse($metersperpixel, true) as $zoomLevel => $maxdistance) { - if ($zoom == 0 && $mapwidthinmeters < ($maxdistance + 50)) $zoom = $zoomLevel; + if ($zoom == 0 && $mapwidthinmeters * 1.5 < ($maxdistance)) $zoom = $zoomLevel; } } $center = $totalLat / sizeof($mapPoints) . "," . $totalLon / sizeof($mapPoints); } $output = ""; if ($collapsible) $output.= '

Open Map...

'; - $output.= ''; + $output.= ''; if ($collapsible) $output.= '
'; return $output; } @@ -66,11 +67,11 @@ $c = 2 * atan2(sqrt($a) , sqrt(1 - $a)); $km = $r * $c; if ($roundLargeValues) { - if ($km < 1) return floor($km * 1000); - else return round($km,2)."k"; - } else return floor($km * 1000); + if ($km < 1) return floor($km * 1000); + else return round($km, 2) . "k"; + } + else return floor($km * 1000); } - function decodePolylineToArray($encoded) { // source: http://latlongeeks.com/forum/viewtopic.php?f=4&t=5 --- a/include/common-request.inc.php +++ b/include/common-request.inc.php @@ -15,7 +15,7 @@ $nearby = true; } if (isset($_REQUEST['suburb'])) { - $suburb = filter_var($_REQUEST['suburb'], FILTER_SANITIZE_STRING); + $suburb = $_REQUEST['suburb']; } $pageKey = filter_var($_REQUEST['pageKey'], FILTER_SANITIZE_NUMBER_INT); $lat = filter_var($_REQUEST['lat'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); --- a/include/common-template.inc.php +++ b/include/common-template.inc.php @@ -23,26 +23,29 @@ $url.= "&guid=ON"; return str_replace("&", "&", $url); } + function include_header($pageTitle, $pageType, $opendiv = true, $geolocate = false, $datepicker = false) { +global $labsPath; echo ' - ' . $pageTitle . ' + +' . $pageTitle . ' - '; + '; if (isDebugServer()) { - echo ' + echo ' - + - '; + '; } else { echo ' @@ -54,10 +57,10 @@ '; } echo ' - - - - + + + + '; - echo ''; + echo ''; + +echo ''; + + if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPod') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) { echo ' @@ -196,10 +125,6 @@ $(document).ready(function() { $('#here').click(function(event) { $('#geolocate').val(geolocate()); return false;}); $('#here').show(); - /*if ($.mobile.media('screen and (min-width: 768px)')) { - $('map a:first').click(); - $('#settings a:first').click(); - }*/ }); "; if (!isset($_SESSION['lat']) || $_SESSION['lat'] == "") echo "geolocate();"; @@ -224,7 +149,7 @@
Back

' . $pageTitle . '

- Home + Home
'; @@ -243,7 +168,9 @@ } function include_footer() { - echo '