<?php
$d = ezcDbFactory::create( 'sqlite://' . dirname( __FILE__ ) . '/presentations/slides/map/examples/photos.sqlite' );
$q = $d->createSelectQuery();
$q->select('*')->from('photo')->orderBy( 'date_taken', ezcQuerySelect::DESC )->limit(100);
$s = $q->prepare();
$s->execute();
$items = array();
foreach ( $s as $photo )
{
$items[] = array(
'lon' => $photo['lon'],
'lat' => $photo['lat'],
'url' => $photo['thumb_url']
);
}
echo json_encode(array( 'items' => $items ) );
Output