Exemple #1
0
function displayMap($address)
{
    global $config, $locate;
    $objResponse = new xajaxResponse();
    if ($config['google-map']['key'] == '') {
        $objResponse->addAssign("divMap", "style.visibility", "hidden");
        $objResponse->addScript("alert('" . $locate->Translate("google_map_no_key") . "')");
        return $objResponse;
    }
    if ($address == '') {
        return $objResponse;
    }
    $map = new PhoogleMap();
    $map->setAPIKey($config['google-map']['key']);
    $map->addAddress($address);
    //$map->showMap();
    $js = $map->generateJs();
    $objResponse->addAssign("divMap", "style.visibility", "visible");
    //$objResponse->addScript("alert('".$js."')");
    $objResponse->addScript($js);
    return $objResponse;
}
Exemple #2
0
        break;
}
$title .= " (Generated on " . date("F d Y H:i:s", filectime($cachedatafile)) . " UTC)";
$legend .= "</td></tr></table>\n";
//page_head(tra($title), null, $title, "", true, null, true);
page_head(null, null, null, "", true, null, true);
echo "<h3>" . $title . "</h3>";
echo "<h5>" . $legend . "</h5>";
echo "<ul>\n";
echo "<li><b>Note:</b> locations accurate to ~1 km for privacy (unless participant authorized exact location)<BR>";
echo "<li><b>Navigation:</b></li><ul>\n";
echo "    <li><b>Move Map:</b> Click and drag map on empty region.</li>\n";
echo "    <li><b>Zoom in:</b> Double click on empty region</li>\n";
echo "    <li><b>Zoom out:</b> Left double click (or ctrl-dble-click)</li>\n</ul>\n";
echo "<li>Click <b>'Refresh'</b> on your browser if the map or sensors do not display.<BR>";
$pm = new PhoogleMap();
if ($zoom) {
    $pm->zoomLevel = $zoom;
} else {
    $pm->zoomLevel = 3;
}
if ($mapwidth) {
    $pm->setWidth($mapwidth);
} else {
    $pm->setWidth(1);
}
if ($mapheight) {
    $pm->setHeight($mapheight);
} else {
    $pm->setHeight(1);
}
<?php

include_once "../libs/phoogle.php";
$map = new PhoogleMap();
$map->setAPIKey("ABQIAAAAm7-WgoUcljbjg9lZ826pHxRN4KJJp6EBD1WWP8QcpU_yf0xsLhRxf0cBTQ-sCTPwQutPfmSfAMpghw");
$map->zoomLevel = 3;
$map->setWidth(640);
$map->setHeight(480);
$map->addGeoPoint(19.842264, -90.536951, "Domicilio de la Caja Solidaria");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Geo Localizacion de Vivienda</title>
	<?php 
$map->printGoogleJS();
?>
  </head>
  <body onload="load()" onunload="GUnload()">
    <?php 
$map->showMap();
?>
  </body>
</html>
        $defaultmap = getOption('gmaps_starting_map');
        if (array_search($defaultmap, $MapTypes) === false) {
            // the starting map is not allowed, pick a new one
            $temp = $MapTypes;
            $defaultmap = array_shift($temp);
            setOption('gmaps_starting_map', $defaultmap);
        }
        return array(gettext('Google Maps API key') => array('key' => 'gmaps_apikey', 'type' => 0, 'desc' => gettext('If you are going to be using Google Maps, <a	href="http://www.google.com/apis/maps/signup.html" target="_blank">get an API key</a> and enter it here.')), gettext('All album points') => array('key' => 'gmaps_show_all_album_points', 'type' => 1, 'desc' => gettext('Controls which image points are shown on an album page. Check to show points for all images in the album. If not checked points are shown only for those images whose thumbs are on the page.')), gettext('Map dimensions—width') => array('key' => 'gmaps_width', 'type' => 0, 'desc' => gettext('The default width of the map.')), gettext('Map dimensions—height') => array('key' => 'gmaps_height', 'type' => 0, 'desc' => gettext('The default height of the map.')), gettext('Allowed maps') => array('key' => 'gmaps_allowed_maps', 'type' => 6, 'checkboxes' => array(gettext('Map') => 'gmaps_maptype_map', gettext('Satellite') => 'gmaps_maptype_sat', gettext('Hybrid') => 'gmaps_maptype_hyb', gettext('Terrain') => 'gmaps_maptype_P', gettext('Google Earth') => 'gmaps_maptype_3D'), 'desc' => gettext('Select the map types that are allowed.')), gettext('Map type selector') => array('key' => 'gmaps_control_maptype', 'type' => 4, 'buttons' => array(gettext('Buttons') => 1, gettext('List') => 2), 'desc' => gettext('Use buttons or list for the map type selector.')), gettext('Map controls') => array('key' => 'gmaps_control', 'type' => 4, 'buttons' => array(gettext('None') => 'None', gettext('Small') => 'Small', gettext('Large') => 'Large'), 'desc' => gettext('Select the kind of map controls.')), gettext('Map background') => array('key' => 'gmaps_background', 'type' => 0, 'desc' => gettext('Set the map background color to match the one of your theme. (Use the same <em>color</em> values as in your CSS background statements.)')), gettext('Initial map display selection') => array('key' => 'gmaps_starting_map', 'type' => 5, 'selections' => $MapTypes, 'desc' => gettext('Select the initial type of map to display. <br /><strong>Note:</strong> If <code>Google Earth</code> is selected the <em>toggle</em> function which initially hides the map is ignored. The browser <em>Google Earth Plugin</em> does not initialize properly when the map is hidden.')));
    }
    function handleOption($option, $currentValue)
    {
    }
}
if ($apiKey = getOption('gmaps_apikey')) {
    require_once SERVERPATH . '/' . ZENFOLDER . '/plugins/' . substr(basename(__FILE__), 0, -4) . '/phoogle.php';
    $_zp_phoogle = new PhoogleMap();
    $_zp_phoogle->setAPIkey($apiKey);
} else {
    $_zp_phoogle = NULL;
}
/**
 * Returns true if the current image has EXIF location data
 *
 * @return bool
 */
function hasMapData()
{
    if (getOption('gmaps_apikey') != '') {
        $exif = getImageEXIFData();
        if (!empty($exif['EXIFGPSLatitude']) && !empty($exif['EXIFGPSLongitude'])) {
            return true;