Пример #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']);
Пример #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>
Пример #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(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 
Пример #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(10);
$api->addControl(GSmallMapControl);
$api->divId = "mapid";
// center to a point
$api->setCenter(51, 11);
?>
<head>

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

</head>

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

<h1> Getting Geocodes </h1>

<?php 
echo $api->getBodyCode();
?>
Пример #5
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);
// add an address. the address is geocoded in the webbrowser, not by the server!
$api->addAddress("10 market st, san francisco", "Market St<br>This is the info for this point", true);
$api->addAddress("10 california st, san francisco", "California St<br>This is the info for this point", false);
?>
<head>

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

</head>

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

<h1> Adding Addresses to the map </h1>

<?php 
Пример #6
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();
?>
">