The GoogleMaps plugin provides a way to display geographic data culled
from your CWIS installation on a google map.

There are three parts to using the plugin:
1. Creating a LocationProvider which gives the Lat/Long coordinates of
   the points that you want displayed on your map.
2. Creating a DetailProvider which provides detail text that will pop
   up over a point when the user clicks its marker.
3. SIgnaling the event GoogleMaps_EVENT_HTML_TAGS in your UI code
   where you want the map to be displayed.

The LocationProvider is a PHP file which must reside in the
local/pages folder. It should print out CSV data for each point to
display in the map, with each line in the form:

Latitude, Longitude, Identifier

The identifiers that you assign will be passed back into the
DetailProvider when it is called.  Some unique integer value makes
sense here, like a ResourceId.

When the LocationProvider is run, it will have access to all of the
standard parts of CWIS.  Therefore, it can query Metadata fields, look
up user information, and so forth.  Four variables will be defined
before running the LP: XMin, XMax, YMin, and YMax.  These gives the
extremes of the map window being displayed.

The DetailProvider is a PHP file which also msut reside in
local/pages. It will be loaded with an ID= in the _GET parameters,
corresponding to the identifier given to the LocationProvider. It
should print an HTML fragment to dispaly in the popup associated with
that identifier's map marker.

When the GoogleMaps_EVENT_HTML_TAGS is signaled, it should be provided
with the names of the Location and Detail providers as parameters.

For example, a location provider which pulls from a Metadata field of type point
called Lat/Long would look like:

---- FILE BEGINS ----
<?php
global $DB;
$MetadataField = "Lat/Long";

# Figure out what our field calls itself in the DB
$Schema = new MetadataSchema();
$Field = $Schema->GetFieldByName($MetadataField);
$DBFieldName = $Field->DBFieldName();

$DB->Query(
    "SELECT ResourceId, "
    ."`".$DBFieldName."X` AS Y,"
    ."`".$DBFieldName."Y` AS X FROM Resources "
    ."WHERE "
    ."`".$DBFieldName."Y` BETWEEN ".$XMin." AND ".$XMax." AND "
    ."`".$DBFieldName."X` BETWEEN ".$YMin." AND ".$YMax);
$Points = $DB->FetchRows();

foreach ($Points as $Point){
  print($Point["X"] .",".$Point["Y"].",".$Point["ResourceId"]."\n");
}
?>
---- FILE ENDS ----

A DetailProvider which shows a thumbnail and the resource description
would look like:
---- FILE BEGINS ----
<?PHP
if (isset($_GET["ID"]) )
{       
    $ResourceId = intval($_GET["ID"]);
    $Resource = new Resource($ResourceId);

    $Schema = new MetadataSchema();
    $Field = $Schema->GetFieldByName("Lat/Long");

    ?>
    <div style="width: 300px;">
        <span><b><?PHP  print($Resource->Get("Exposure Name"));  ?></b></span>
        <table border="0"><tr valign="center">
            <td><?PHP
            $Image = $Resource->Get("Exposure Photo", TRUE);
            if ($Image)
            {
                ?><p><img src="<?PHP  print($Image->ThumbnailUrl());  
                        ?>" height="<?PHP  print($Image->ThumbnailHeight());  
                        ?>" width="<?PHP  print($Image->ThumbnailWidth());  
                        ?>" border="0"></p><?PHP
            }
            ?></td>
        </tr></table>
        <p><?PHP  print($Resource->Get("Description"));  ?></p>
        <span class="smalleditbutton"><a href="index.php?P=FullRecord&ID=<?PHP  
                print($ResourceId);  ?>">View More Information</a></span>
        <br />
    </div>
    <?PHP
}
else
{
    print("ERROR: No resource ID specified\n");
}
$AF->SuppressHTMLOutput();
?>
---- FILE ENDS ----