Skip to content
Permalink
Browse files

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

  • Loading branch information...
following
following committed Feb 21, 2013
1 parent 7408ff6 commit 915eb65f4e3474fbd6cbc1030b3d3da44264ad3b
Showing with 37 additions and 8 deletions.
  1. +21 −3 htdocs/map2.php
  2. +12 −2 htdocs/resource2/misc/map/CacheMarker.js
  3. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-1-inactive.png
  4. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-1-oconly.png
  5. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-10-inactive.png
  6. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-10-oconly.png
  7. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-11-inactive.png
  8. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-11-oconly.png
  9. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-12-inactive.png
  10. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-12-oconly.png
  11. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-13-inactive.png
  12. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-13-oconly.png
  13. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-14-inactive.png
  14. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-14-oconly.png
  15. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-15-inactive.png
  16. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-15-oconly.png
  17. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-2-inactive.png
  18. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-2-oconly.png
  19. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-3-inactive.png
  20. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-3-oconly.png
  21. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-4-inactive.png
  22. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-4-oconly.png
  23. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-5-inactive.png
  24. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-5-oconly.png
  25. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-6-inactive.png
  26. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-6-oconly.png
  27. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-7-inactive.png
  28. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-7-oconly.png
  29. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-8-inactive.png
  30. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-8-oconly.png
  31. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-9-inactive.png
  32. BIN htdocs/resource2/ocstyle/images/map/24x24-cachetype-9-oconly.png
  33. BIN htdocs/resource2/ocstyle/images/map/24x24-found-inactive.png
  34. BIN htdocs/resource2/ocstyle/images/map/24x24-found-oconly.png
  35. BIN htdocs/resource2/ocstyle/images/map/24x24-owned-inactive.png
  36. BIN htdocs/resource2/ocstyle/images/map/24x24-owned-oconly.png
  37. BIN htdocs/resource2/ocstyle/images/map/24x24-owned.png
  38. +4 −3 htdocs/templates2/ocstyle/map2.tpl
@@ -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);
}
@@ -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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
@@ -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);

0 comments on commit 915eb65

Please sign in to comment.
You can’t perform that action at this time.