diff options
Diffstat (limited to 'main/src/cgeo/geocaching/CacheCache.java')
| -rw-r--r-- | main/src/cgeo/geocaching/CacheCache.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/main/src/cgeo/geocaching/CacheCache.java b/main/src/cgeo/geocaching/CacheCache.java index 95b8b19..7f6f67e 100644 --- a/main/src/cgeo/geocaching/CacheCache.java +++ b/main/src/cgeo/geocaching/CacheCache.java @@ -85,7 +85,7 @@ public class CacheCache { return cachesCache.get(geocode); } - public Set<String> getInViewport(final Long centerLat, final Long centerLon, final Long spanLat, final Long spanLon, final CacheType cacheType) { + public Set<String> getInViewport(final Viewport viewport, final CacheType cacheType) { final Set<String> geocodes = new HashSet<String>(); for (final cgCache cache : cachesCache.values()) { if (cache.getCoords() == null) { @@ -94,8 +94,7 @@ public class CacheCache { Log.e("CacheCache.getInViewport: got cache with null coordinates: " + cache.getGeocode()); continue; } - if ((CacheType.ALL == cacheType || cache.getType() == cacheType) && - Viewport.isCacheInViewPort(centerLat.intValue(), centerLon.intValue(), spanLat.intValue(), spanLon.intValue(), cache.getCoords())) { + if ((CacheType.ALL == cacheType || cache.getType() == cacheType) && viewport.contains(cache)) { geocodes.add(cache.getGeocode()); } } |
