Exemplo n.º 1
0
<?php

if (@$_SESSION['rights']['public']['membermap']['view'] or @$_SESSION['rights']['superadmin']) {
    $api = new NXGoogleMapsAPI();
    // setup the visual design of the control
    $api->setWidth(GOOGLE_MAP_WIDTH);
    $api->setHeight(GOOGLE_MAP_HEIGHT);
    $api->setZoomFactor(6);
    $api->addControl(GLargeMapControl);
    $api->addControl(GMapTypeControl);
    $api->addControl(GOverviewMapControl);
    // add an address. the address is geocoded in the webbrowser, not by the server!
    global $db;
    $result = $db->query('SELECT wohnort, country, username, user_pic, koord, ID, COUNT( koord ) as anzahl FROM ' . DB_PRE . 'ecp_user WHERE koord != "" AND wohnort != "" GROUP BY koord ORDER BY ID ASC ');
    while ($row = mysql_fetch_assoc($result)) {
        if ($row['anzahl'] > 1) {
            $db->query('SELECT wohnort, country, username, user_pic, koord, ID FROM ' . DB_PRE . 'ecp_user WHERE koord = "' . $row['koord'] . '" ORDER BY ID ASC');
            $html = '';
            $anzahl = 0;
            while ($subrow = $db->fetch_assoc()) {
                $html .= ($anzahl != 0 ? '<hr />' : '') . '<img src="images/flaggen/' . $subrow['country'] . '.gif" /> <strong><a href="?section=user&id=' . $subrow['ID'] . '" target="_blank">' . $subrow['username'] . '</a></strong><br />' . $subrow['wohnort'] . '<br /><img src="' . ($subrow['user_pic'] != '' ? 'images/user/' . $subrow['ID'] . '_' . $subrow['user_pic'] : 'templates/' . DESIGN . '/images/nopic.png') . '" alt="" title="' . strsave($subrow['username']) . '" style="max-width: 150px" />';
                $anzahl++;
                if ($subrow['user_pic'] != '') {
                    $bilder[] = 'images/user/' . $subrow['ID'] . '_' . $subrow['user_pic'];
                }
            }
            $koord = explode(',', $row['koord']);
            $api->addGeoPoint((double) $koord['0'], (double) $koord['1'], $html, isset($first) ? false : true);
            $first = false;
        } else {
            $koord = explode(',', $row['koord']);
Exemplo n.º 2
0
<html>
<?php 
require "nxgooglemapsapi.php";
$api = new NXGoogleMapsAPI();
// setup the visual design of the control
$api->setWidth(800);
$api->setHeight(600);
$api->setZoomFactor(5);
$api->addControl(GSmallMapControl);
// add a point.
$api->addGeoPoint(50, 10, "Somewhere in Germany", false);
// center to a point
$api->setCenter(51, 11);
// set to hybrid mode
$api->setMapType(VTHybrid);
?>
<head>

<?php 
echo $api->getHeadCode();
?>

</head>

<body onLoad="<?php 
echo $api->getOnLoadCode();
?>
">

<h1> Adding Geopoints to the map and view map in hybrid mode</h1>