// Based on the size of the final image, we work out the
// amount we will need to add/subtract from the screen
// coordinate that will be calculated later to center our point
// on the final image.<br>
// Lets now draw out inital background .. the mighty ocean.
// You could also use a drawn "sea scape" image if you
// wanted things to look a little different.
// Now we loop through the array of arrays getting each polygon
// in turn
foreach($polygons as $poly)
{
$converted_points = array();
// Each vector objects is stored as a space delimited string
// {long} {lat} {long} {lat} etc etc.
// So we explode these points into a temporary array for
// easy conversion to screen coordinates.
// Get each long/lat in turn. Convert it to screen coordinates
// Then subtract the "world screen" coordindate of our base object
// ( our house ) so the polygon will be centered around it.