".$minx." AND x<".$maxx." AND y>".$miny." AND y<".$maxy; error_log("query=" .$query); sleep(3); //Artificial 3 second pause, to help see how the bboxes work } //Icon offset. For some reason this doesn't default to a sensible value for //the default marker graphic, so we output it in the text file. $icon_offset = "-10,-25"; $result = @$db->query($query); if ($result === false) { die("Error during basic query:". $err); } else { print "lat lon title description iconOffset\n"; $count = 0; while ($result->valid()) { $count++; // fetch current row $row = $result->current(); $id = $row[0]; $name = $row[1]; $x = $row[2]; $y = $row[3]; $lon = $x / 10000000; $lat = $y / 10000000; //output text file row which OpenLayers can understand print $lat."\t".$lon."\t".$name."\t".$name."\t".$icon_offset."\n"; // proceed to next row $result->next(); } error_log("Returning " .$count. " points in a text file"); } } else { die($err); } ?>