示例#1
0
文件: index.php 项目: ECP-Black/ECP
    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']);
            $api->addGeoPoint((double) $koord['0'], (double) $koord['1'], '<img src="images/flaggen/' . $row['country'] . '.gif" /> <strong><a href="?section=user&id=' . $row['ID'] . '" target="_blank">' . $row['username'] . '</a></strong><br />' . $row['wohnort'] . '<br /><img src="' . ($row['user_pic'] != '' ? 'images/user/' . $row['ID'] . '_' . $row['user_pic'] : 'templates/' . DESIGN . '/images/nopic.png') . '" alt="" title="' . strsave($row['username']) . '" style="max-width: 150px" />', isset($first) ? false : true);
            if ($row['user_pic'] != '') {
                $bilder[] = 'images/user/' . $row['ID'] . '_' . $row['user_pic'];
            }
            $first = false;
        }
    }
    ob_start();
    echo $api->getHeadCode() . '<script type="text/javascript">		
			window.addEvents({
				"domready" : function() { 
					var info = new Element(\'div\', {
示例#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(6);
$api->addControl(GSmallMapControl);
// define points
$points = array(array(50, 10, 'Point1'), array(51, 15, 'Point2'));
// add a point.
for ($i = 0; $i < count($points); $i++) {
    $api->addGeoPoint($points[$i][0], $points[$i][1], $points[$i][2], true);
}
//define addresses
$addresses = array(array('Stuttgart, Germany', 'Stuttgart'), array('Munich, Germany', 'Munich'));
// add the addresses
for ($i = 0; $i < count($addresses); $i++) {
    $api->addAddress($addresses[$i][0], $addresses[$i][1], true);
}
?>
<head>

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

</head>

<body onLoad="<?php 
示例#3
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>
示例#4
0
<html>
<?php 
require "nxgooglemapsapi.php";
$api = new NXGoogleMapsAPI();
// setup the visual design of the control
$api->setWidth(800);
$api->setHeight(600);
$api->setZoomFactor(16);
$api->addControl(GLargeMapControl);
$api->addControl(GMapTypeControl);
$api->addControl(GOverviewMapControl);
// geocode address and add the points to form afterwards.
// if the geocoding fails, longitude and latitude are both set to 0.
$coord1 = $api->geoCodeAddress("10 market st, san francisco");
$coord2 = $api->geoCodeAddress("10 california st, san francisco");
$api->addGeoPoint($coord1['longitude'], $coord1['latitude'], "Market St<br>This is the info for this point", true);
$api->addGeoPoint($coord2['longitude'], $coord2['latitude'], "California St<br>This is the info for this point", false);
?>
<head>

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

</head>

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