--- a/busui/common.inc.php +++ b/busui/common.inc.php @@ -12,16 +12,16 @@ return true; } -function include_header($pageTitle) { +function include_header($pageTitle, $opendiv = true, $geolocate = false) { // if (isDebug()) // set php error level high echo ' <!DOCTYPE html> <html> <head> <title>bus.lambdacomplex.org - '.$pageTitle.'</title> - <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.css" /> + <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.css" /> <script src="http://code.jquery.com/jquery-1.4.3.min.js"></script><script type="text/javascript" -src="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.js"></script> +src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script> <script type="text/javascript" src="docs/docs.js"></script> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black" /> @@ -29,11 +29,12 @@ <link rel="apple-touch-icon" href="apple-touch-icon.png" /> </head> <body> - -<div data-role="page"> + '; +if ($opendiv) echo '<div data-role="page"> <div data-role="header"> - <h1>'.$pageTitle.'</h1> + <h1>'.$pageTitle.'</h1> + <a href="index.php" data-icon="back" class="ui-btn-right">Home</a> </div><!-- /header --> <div data-role="content"> '; } @@ -85,6 +86,24 @@ } return $f; } + +function staticmap($mapPoints) +{ +$width = 300; +$height = 300; + if (sizeof($mapPoints) < 1) return ""; + if (sizeof($mapPoints) === 1) $center = "{$mapPoints[0][0]},{$mapPoints[0][1]}"; + if (sizeof($mapPoints) > 1) $center = "{$mapPoints[0][0]},{$mapPoints[0][1]}"; //TODO average points + $markers = ""; + foreach ($mapPoints as $index => $mapPoint) { + if (sizeof($mapPoints) === 1) { + $markers .= $mapPoint[0].",".$mapPoint[1].",ol-marker"; + } else { + $markers .= $mapPoint[0].",".$mapPoint[1].",lightblue".($index+1); + } + } + return '<img src="staticmaplite/staticmap.php?center='.$center.'&zoom=14&size='.$width.'x'.$height.'&maptype=mapnik&markers='.$markers.'" width=$width height=$height>'; +} ?>