Created
August 6, 2011 04:19
-
-
Save nrabinowitz/1129009 to your computer and use it in GitHub Desktop.
Mock PHP service for timemap.js progressive loading
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// get timestamps | |
$start = strtotime($_GET['start']); | |
$end = strtotime($_GET['end']); | |
$cb = $_GET['callback']; | |
// start data | |
echo "$cb(["; | |
// make some fake data | |
for ($x=0; $x<20; $x++) { | |
if ($x) echo ','; | |
echo '{'; | |
echo 'title:"Item '.$x.'",'; | |
echo 'start:"'.date('Y-m-d\TH:i:sO', rand($start, $end)).'",'; | |
echo 'point:{lat:'.(43.0 + 10*(float)rand()/(float)getrandmax()) | |
.',lon:'.(11.0 + 10*(float)rand()/(float)getrandmax()).'}'; | |
echo '}'; | |
} | |
// end data | |
echo "])"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment