2124: mark own, found, inactive and oconly caches on map

This commit is contained in:
following
2013-02-21 19:50:44 +01:00
parent 7408ff6933
commit 915eb65f4e
38 changed files with 37 additions and 8 deletions

View File

@ -287,7 +287,7 @@ function output_namesearch($sName, $nLat, $nLon, $nResultId)
function output_searchresult($nResultId, $nLon1, $nLat1, $nLon2, $nLat2)
{
global $opt;
global $opt, $login;
// check if data is available and connect the right slave server
$nSlaveId = sql_value("SELECT `slave_id` FROM `map2_result` WHERE `result_id`='&1' AND DATE_ADD(`date_created`, INTERVAL '&2' SECOND)>NOW()", -2, $nResultId, $opt['map']['maxcacheage']);
@ -313,10 +313,28 @@ function output_searchresult($nResultId, $nLon1, $nLat1, $nLon2, $nLat2)
if ($bMaxRecordReached == false)
{
$rs = sql_slave("SELECT SQL_BUFFER_RESULT `caches`.`wp_oc`, `caches`.`longitude`, `caches`.`latitude`, `caches`.`type` FROM `map2_data` INNER JOIN `caches` ON `map2_data`.`cache_id`=`caches`.`cache_id` WHERE `map2_data`.`result_id`='&1' AND `caches`.`longitude`>'&2' AND `caches`.`longitude`<'&3' AND `caches`.`latitude`>'&4' AND `caches`.`latitude`<'&5' LIMIT " . ($opt['map']['maxrecords']+0), $nResultId, $nLon1, $nLon2, $nLat1, $nLat2);
$rs = sql_slave("SELECT SQL_BUFFER_RESULT
`caches`.`wp_oc`, `caches`.`longitude`, `caches`.`latitude`,
`caches`.`type`,
`caches`.`status`>1 AS `inactive`,
`user`.`user_id`='&6' AS `owned`,
IF(`cache_logs`.`id` IS NULL, 0, 1) AS `found`,
IF(`caches_attributes`.`attrib_id` IS NULL, 0, 1) AS `oconly`
FROM `map2_data`
INNER JOIN `caches` ON `map2_data`.`cache_id`=`caches`.`cache_id`
LEFT JOIN `user` ON `user`.`user_id`=`caches`.`user_id`
LEFT JOIN `cache_logs` ON `cache_logs`.`cache_id`=`caches`.`cache_id` AND `cache_logs`.`user_id`='&6' AND `cache_logs`.`type` IN (1,7)
LEFT JOIN `caches_attributes` ON `caches_attributes`.`cache_id`=`caches`.`cache_id` AND `caches_attributes`.`attrib_id`=6
WHERE `map2_data`.`result_id`='&1' AND `caches`.`longitude`>'&2' AND `caches`.`longitude`<'&3' AND `caches`.`latitude`>'&4' AND `caches`.`latitude`<'&5' LIMIT " . ($opt['map']['maxrecords']+0),
$nResultId, $nLon1, $nLon2, $nLat1, $nLat2, $login->userid);
while ($r = sql_fetch_assoc($rs))
{
echo '<cache wp="' . xmlentities($r['wp_oc']) . '" lon="' . xmlentities($r['longitude']) . '" lat="' . xmlentities($r['latitude']) . '" type="' . xmlentities($r['type']) . '" />' . "\n";
$flags = 0;
if ($r['owned']) $flags |= 1;
if ($r['found']) $flags |= 2;
if ($r['inactive']) $flags |= 4;
if ($r['oconly']) $flags |= 8;
echo '<cache wp="' . xmlentities($r['wp_oc']) . '" lon="' . xmlentities($r['longitude']) . '" lat="' . xmlentities($r['latitude']) . '" type="' . xmlentities($r['type']) . '" flags="' . xmlentities($flags) . '" />' . "\n";
}
sql_free_result($rs);
}

View File

@ -1,8 +1,18 @@
function CacheMarker(latlng, wp, type)
function CacheMarker(latlng, wp, type, flags)
{
this.latlng = latlng;
this.wp_ = wp;
this.image_ = 'resource2/ocstyle/images/map/24x24-cachetype-' + type + '.png';
if (flags & 4) state = '-inactive';
else if (flags & 8) state = '-oconly';
else state = '';
if (flags & 1)
this.image_ = 'resource2/ocstyle/images/map/24x24-owned' + state + '.png';
else if (flags & 2)
this.image_ = 'resource2/ocstyle/images/map/24x24-found' + state + '.png';
else
this.image_ = 'resource2/ocstyle/images/map/24x24-cachetype-' + type + state + '.png';
this.height_ = 24;
this.width_ = 24;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 805 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 681 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 986 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 943 B

View File

@ -1099,8 +1099,9 @@
var nLon = oCachesList[nIndex].getAttribute("lon");
var nLat = oCachesList[nIndex].getAttribute("lat");
var nType = oCachesList[nIndex].getAttribute("type");
var nFlags = oCachesList[nIndex].getAttribute("flags");
addCacheToMap(sWaypoint, nLon, nLat, nType);
addCacheToMap(sWaypoint, nLon, nLat, nType, nFlags);
}
document.getElementById('statCachesCount').firstChild.nodeValue = oCachesList.length;
@ -1121,7 +1122,7 @@
return ((dTime2-dTime1)/1000).toFixed(1);
}
function addCacheToMap(sWaypoint, nLon, nLat, nType)
function addCacheToMap(sWaypoint, nLon, nLat, nType, nFlags)
{
if (sWaypoint == msPopupMarkerWP)
{
@ -1133,7 +1134,7 @@
}
}
var oMarker = new CacheMarker(new GLatLng(nLat, nLon), sWaypoint, nType);
var oMarker = new CacheMarker(new GLatLng(nLat, nLon), sWaypoint, nType, nFlags);
GEvent.addListener(oMarker, "click", function(wp){CacheMarker_click(wp);});
moMap.addOverlay(oMarker);