Yep did it using this method..

Ended up using a half hours worth of work in php.

Next, what I'll do is create a kml on the fly in this same php script
and update this on the user side via. ajax when the kml has been
created.

PHP script included below in case anyone ever has teh same problem
(unlikely - but you never know)

<?php
$x = $_GET['x'];
$y = $_GET['y'];

$xml = simplexml_load_file("doc.kml");
foreach($xml->Document->Folder->Placemark as $child)
{
        $coordinates = explode(" ",$child->Polygon->outerBoundaryIs-
>LinearRing->coordinates);
        $i = 0;
        foreach($coordinates as $coordinate)
        {
                $individual = explode(",",$coordinate);
                $current[$i] = $individual;
                $i++;
        }

        if($x > $current[0][0] && $y > $current[0][1])
        {
                if($x < $current[1][0] && $y > $current[1][1])
                {
                        if($x < $current[2][0] && $y < $current[2][1])
                        {
                                if($x > $current[3][0] && $y < $current[3][1])
                                {
                                        echo $child->name . "<br />";
                                }
                        }
                }
        }
}
?>

On Jan 28, 8:26 pm, Rossko <[email protected]> wrote:
> I''d suggest a completely different approach, since you're using a
> regular grid.
> Display the grid lines if you like, but don't fill in the boxes to
> obscure the map.
> When a user clicks, analyse the coordinates and calculate the grid
> square the click falls in.  It's only a case of dividing and checking
> remainders.
> This is simple enough to do client-side, or you can transmit the
> coordinates as-is for server side analysis.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to