From cd237d118408edf9aa6dc70050975ce004f7a74c Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 28 Jul 2016 23:08:38 +0200 Subject: [PATCH] Update transport stops --- .../osmand/plus/activities/MapActivity.java | 7 -- .../plus/resources/AsyncLoadingThread.java | 113 +----------------- .../plus/resources/ResourceManager.java | 73 +++++------ .../resources/TransportIndexRepository.java | 20 +--- .../TransportIndexRepositoryBinary.java | 47 +------- .../net/osmand/plus/views/MapInfoLayer.java | 4 - .../plus/views/TransportStopsLayer.java | 101 +++++++++------- 7 files changed, 97 insertions(+), 268 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index c17c88390b..8a337f780d 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -560,12 +560,6 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven mapLayers.getMapControlsLayer().startNavigation(); } } - - View progress = mapLayers.getMapInfoLayer().getProgressBar(); - if (progress != null) { - app.getResourceManager().setBusyIndicator(new BusyIndicator(this, progress)); - } - mapView.refreshMap(true); if (atlasMapRendererView != null) { atlasMapRendererView.handleOnResume(); @@ -938,7 +932,6 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven settings.MAP_ACTIVITY_ENABLED.set(false); getMyApplication().getAppCustomization().pauseActivity(MapActivity.class); app.getResourceManager().interruptRendering(); - app.getResourceManager().setBusyIndicator(null); OsmandPlugin.onMapActivityPause(this); } diff --git a/OsmAnd/src/net/osmand/plus/resources/AsyncLoadingThread.java b/OsmAnd/src/net/osmand/plus/resources/AsyncLoadingThread.java index 445f4c403e..08e4f69ca0 100644 --- a/OsmAnd/src/net/osmand/plus/resources/AsyncLoadingThread.java +++ b/OsmAnd/src/net/osmand/plus/resources/AsyncLoadingThread.java @@ -5,26 +5,18 @@ import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; import java.util.Stack; import net.osmand.PlatformUtil; import net.osmand.ResultMatcher; import net.osmand.data.RotatedTileBox; -import net.osmand.data.TransportStop; import net.osmand.map.ITileSource; import net.osmand.map.MapTileDownloader.DownloadRequest; -import net.osmand.map.MapTileDownloader.IMapDownloaderCallback; -import net.osmand.plus.BusyIndicator; import net.osmand.plus.SQLiteTileSource; import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; -import android.os.Handler; -import android.os.HandlerThread; - /** * Thread to load map objects (POI, transport stops )async */ @@ -34,75 +26,25 @@ public class AsyncLoadingThread extends Thread { private static final Log log = PlatformUtil.getLog(AsyncLoadingThread.class); - private Handler asyncLoadingTransport; - Stack requests = new Stack(); - TransportLoadRequest transportLoadRequest = null; - - private final ResourceManager resourceManger; public AsyncLoadingThread(ResourceManager resourceManger) { super("Loader map objects (synchronizer)"); //$NON-NLS-1$ this.resourceManger = resourceManger; } - - - - private void startTransportLoadingThread() { - HandlerThread h = new HandlerThread("Loading transport"); - h.start(); - asyncLoadingTransport = new Handler(h.getLooper()); - } - - private int calculateProgressStatus() { - int progress = 0; - if (resourceManger.getMapTileDownloader() != null && resourceManger.getMapTileDownloader().isSomethingBeingDownloaded()) { - progress = BusyIndicator.STATUS_GREEN; - } else if (resourceManger.getContext().getRoutingHelper().isRouteBeingCalculated()) { - progress = BusyIndicator.STATUS_ORANGE; - } else if (resourceManger.isSearchAmenitiesInProgress()) { - progress = BusyIndicator.STATUS_BLACK; - } else if (!requests.isEmpty()) { - progress = BusyIndicator.STATUS_BLACK; - } else if (transportLoadRequest != null && transportLoadRequest.isRunning()) { - progress = BusyIndicator.STATUS_BLACK; - } - return progress; - } @Override public void run() { while (true) { try { boolean tileLoaded = false; - boolean amenityLoaded = false; - boolean transportLoaded = false; boolean mapLoaded = false; - - int progress = calculateProgressStatus(); - synchronized (resourceManger) { - if (resourceManger.getBusyIndicator() != null) { - resourceManger.getBusyIndicator().updateStatus(progress); - } - } while (!requests.isEmpty()) { Object req = requests.pop(); if (req instanceof TileLoadDownloadRequest) { TileLoadDownloadRequest r = (TileLoadDownloadRequest) req; tileLoaded |= resourceManger.getRequestedImageTile(r) != null; - } else if (req instanceof TransportLoadRequest) { - if (!transportLoaded) { - if (transportLoadRequest == null || asyncLoadingTransport == null) { - startTransportLoadingThread(); - transportLoadRequest = (TransportLoadRequest) req; - asyncLoadingTransport.post(transportLoadRequest.prepareToRun()); - } else if (transportLoadRequest.recalculateRequest((TransportLoadRequest) req)) { - transportLoadRequest = (TransportLoadRequest) req; - asyncLoadingTransport.post(transportLoadRequest.prepareToRun()); - } - transportLoaded = true; - } } else if (req instanceof MapLoadRequest) { if (!mapLoaded) { MapLoadRequest r = (MapLoadRequest) req; @@ -111,18 +53,10 @@ public class AsyncLoadingThread extends Thread { } } } - if (tileLoaded || amenityLoaded || transportLoaded || mapLoaded) { + if (tileLoaded || mapLoaded) { // use downloader callback resourceManger.getMapTileDownloader().fireLoadCallback(null); } - int newProgress = calculateProgressStatus(); - if (progress != newProgress) { - synchronized (resourceManger) { - if (resourceManger.getBusyIndicator() != null) { - resourceManger.getBusyIndicator().updateStatus(newProgress); - } - } - } sleep(750); } catch (InterruptedException e) { log.error(e, e); @@ -140,9 +74,6 @@ public class AsyncLoadingThread extends Thread { requests.push(req); } - public void requestToLoadTransport(TransportLoadRequest req) { - requests.push(req); - } public boolean isFilePendingToDownload(File fileToSave) { return resourceManger.getMapTileDownloader().isFilePendingToDownload(fileToSave); @@ -251,48 +182,6 @@ public class AsyncLoadingThread extends Thread { } - - - protected class TransportLoadRequest extends MapObjectLoadRequest { - private final List repos; - private int zoom; - - public TransportLoadRequest(List repos, int zoom) { - super(); - this.repos = repos; - this.zoom = zoom; - } - - public Runnable prepareToRun() { - final double ntopLatitude = topLatitude + (topLatitude - bottomLatitude) / 2; - final double nbottomLatitude = bottomLatitude - (topLatitude - bottomLatitude) / 2; - final double nleftLongitude = leftLongitude - (rightLongitude - leftLongitude) / 2; - final double nrightLongitude = rightLongitude + (rightLongitude - leftLongitude) / 2; - setBoundaries(ntopLatitude, nleftLongitude, nbottomLatitude, nrightLongitude); - return new Runnable() { - @Override - public void run() { - start(); - try { - for (TransportIndexRepository repository : repos) { - repository.evaluateCachedTransportStops(ntopLatitude, nleftLongitude, nbottomLatitude, nrightLongitude, zoom, - LIMIT_TRANSPORT, TransportLoadRequest.this); - } - } finally { - finish(); - } - } - }; - } - - public boolean recalculateRequest(TransportLoadRequest req) { - if (this.zoom != req.zoom) { - return true; - } - return !isContains(req.topLatitude, req.leftLongitude, req.bottomLatitude, req.rightLongitude); - } - - } protected static class MapLoadRequest { public final RotatedTileBox tileBox; diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index 776cdebcfd..5d0ab30a90 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -1,15 +1,20 @@ package net.osmand.plus.resources; -import android.content.Context; -import android.content.res.AssetManager; -import android.database.sqlite.SQLiteException; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.os.HandlerThread; -import android.text.format.DateFormat; -import android.util.DisplayMetrics; -import android.view.WindowManager; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import net.osmand.AndroidUtils; import net.osmand.GeoidAltitudeCorrection; @@ -32,7 +37,6 @@ import net.osmand.osm.MapPoiTypes; import net.osmand.osm.PoiCategory; import net.osmand.plus.AppInitializer; import net.osmand.plus.AppInitializer.InitEvents; -import net.osmand.plus.BusyIndicator; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; @@ -42,7 +46,6 @@ import net.osmand.plus.render.MapRenderRepositories; import net.osmand.plus.render.NativeOsmandLibrary; import net.osmand.plus.resources.AsyncLoadingThread.MapLoadRequest; import net.osmand.plus.resources.AsyncLoadingThread.TileLoadDownloadRequest; -import net.osmand.plus.resources.AsyncLoadingThread.TransportLoadRequest; import net.osmand.plus.srtmplugin.SRTMPlugin; import net.osmand.plus.views.OsmandMapLayer.DrawSettings; import net.osmand.util.Algorithms; @@ -53,20 +56,15 @@ import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.RandomAccessFile; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; +import android.content.Context; +import android.content.res.AssetManager; +import android.database.sqlite.SQLiteException; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.os.HandlerThread; +import android.text.format.DateFormat; +import android.util.DisplayMetrics; +import android.view.WindowManager; /** * Resource manager is responsible to work with all resources @@ -98,8 +96,6 @@ public class ResourceManager { private final OsmandApplication context; - private BusyIndicator busyIndicator; - public interface ResourceWatcher { @@ -916,20 +912,21 @@ public class ResourceManager { } - public void searchTransportAsync(double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, int zoom, List toFill){ + public List searchTransportSync(double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, ResultMatcher matcher){ List repos = new ArrayList(); + List stops = new ArrayList<>(); for (TransportIndexRepository index : transportRepositories.values()) { if (index.checkContains(topLatitude, leftLongitude, bottomLatitude, rightLongitude)) { - if (!index.checkCachedObjects(topLatitude, leftLongitude, bottomLatitude, rightLongitude, zoom, toFill, true)) { - repos.add(index); - } + repos.add(index); } } if(!repos.isEmpty()){ - TransportLoadRequest req = asyncLoadingThread.new TransportLoadRequest(repos, zoom); - req.setBoundaries(topLatitude, leftLongitude, bottomLatitude, rightLongitude); - asyncLoadingThread.requestToLoadTransport(req); + for (TransportIndexRepository repository : repos) { + repository.searchTransportStops(topLatitude, leftLongitude, bottomLatitude, rightLongitude, + -1, stops, matcher); + } } + return stops; } ////////////////////////////////////////////// Working with map //////////////////////////////////////////////// @@ -1002,13 +999,9 @@ public class ResourceManager { transportRepositories.clear(); } - public BusyIndicator getBusyIndicator() { - return busyIndicator; - } - public synchronized void setBusyIndicator(BusyIndicator busyIndicator) { - this.busyIndicator = busyIndicator; - } + + public synchronized void close(){ imagesOnFS.clear(); diff --git a/OsmAnd/src/net/osmand/plus/resources/TransportIndexRepository.java b/OsmAnd/src/net/osmand/plus/resources/TransportIndexRepository.java index 6559b68c15..e228f24eca 100644 --- a/OsmAnd/src/net/osmand/plus/resources/TransportIndexRepository.java +++ b/OsmAnd/src/net/osmand/plus/resources/TransportIndexRepository.java @@ -13,25 +13,13 @@ public interface TransportIndexRepository { public boolean checkContains(double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude); - public boolean checkCachedObjects(double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, int zoom, List toFill); - - public boolean checkCachedObjects(double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, int zoom, List toFill, boolean fillFound); - public boolean acceptTransportStop(TransportStop stop); - /** - * - * @param stop - * @param format {0} - ref, {1} - type, {2} - name, {3} - name_en - * @return - */ + public void searchTransportStops(double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, + int limit, List stops, ResultMatcher matcher); + public List getRouteDescriptionsForStop(TransportStop stop, String format); - - - public void evaluateCachedTransportStops(double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, int zoom, int limit, - ResultMatcher matcher); - - + public List searchTransportRouteStops(double latitude, double longitude, LatLon locationToGo, int zoom); public void close(); diff --git a/OsmAnd/src/net/osmand/plus/resources/TransportIndexRepositoryBinary.java b/OsmAnd/src/net/osmand/plus/resources/TransportIndexRepositoryBinary.java index f272c8affa..fb521a0812 100644 --- a/OsmAnd/src/net/osmand/plus/resources/TransportIndexRepositoryBinary.java +++ b/OsmAnd/src/net/osmand/plus/resources/TransportIndexRepositoryBinary.java @@ -24,12 +24,6 @@ public class TransportIndexRepositoryBinary implements TransportIndexRepository private static final Log log = PlatformUtil.getLog(TransportIndexRepositoryBinary.class); private final BinaryMapIndexReader file; - protected List cachedObjects = new ArrayList(); - protected double cTopLatitude; - protected double cBottomLatitude; - protected double cLeftLongitude; - protected double cRightLongitude; - private int cZoom; public TransportIndexRepositoryBinary(BinaryMapIndexReader file) { this.file = file; @@ -45,28 +39,7 @@ public class TransportIndexRepositoryBinary implements TransportIndexRepository } @Override - public boolean checkCachedObjects(double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, int zoom, List toFill){ - return checkCachedObjects(topLatitude, leftLongitude, bottomLatitude, rightLongitude, zoom, toFill, false); - } - - @Override - public synchronized boolean checkCachedObjects(double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, int zoom, List toFill, boolean fillFound){ - boolean inside = cTopLatitude >= topLatitude && cLeftLongitude <= leftLongitude && cRightLongitude >= rightLongitude - && cBottomLatitude <= bottomLatitude && cZoom == zoom; - boolean noNeedToSearch = inside; - if((inside || fillFound) && toFill != null){ - for(TransportStop a : cachedObjects){ - LatLon location = a.getLocation(); - if (location.getLatitude() <= topLatitude && location.getLongitude() >= leftLongitude && location.getLongitude() <= rightLongitude - && location.getLatitude() >= bottomLatitude) { - toFill.add(a); - } - } - } - return noNeedToSearch; - } - - public List searchTransportStops(double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, + public void searchTransportStops(double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, int limit, List stops, ResultMatcher matcher) { long now = System.currentTimeMillis(); try { @@ -80,7 +53,6 @@ public class TransportIndexRepositoryBinary implements TransportIndexRepository } catch (IOException e) { log.error("Disk error ", e); //$NON-NLS-1$ } - return stops; } @@ -115,23 +87,6 @@ public class TransportIndexRepositoryBinary implements TransportIndexRepository return res; } - @Override - public void evaluateCachedTransportStops(double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, - int zoom, int limit, ResultMatcher matcher) { - cTopLatitude = topLatitude ; - cBottomLatitude = bottomLatitude ; - cLeftLongitude = leftLongitude ; - cRightLongitude = rightLongitude ; - cZoom = zoom; - // first of all put all entities in temp list in order to not freeze other read threads - ArrayList tempList = new ArrayList(); - searchTransportStops(cTopLatitude, cLeftLongitude, cBottomLatitude, cRightLongitude, limit, tempList, matcher); - synchronized (this) { - cachedObjects.clear(); - cachedObjects.addAll(tempList); - } - - } @Override diff --git a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java index 135e5a3392..06bbeb06f5 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java @@ -329,10 +329,6 @@ public class MapInfoLayer extends OsmandMapLayer { return true; } - public View getProgressBar() { - // currently no progress on info layer - return null; - } public static String getStringPropertyName(Context ctx, String propertyName, String defValue) { try { diff --git a/OsmAnd/src/net/osmand/plus/views/TransportStopsLayer.java b/OsmAnd/src/net/osmand/plus/views/TransportStopsLayer.java index e8d6051790..5b69c6055a 100644 --- a/OsmAnd/src/net/osmand/plus/views/TransportStopsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/TransportStopsLayer.java @@ -8,6 +8,8 @@ import android.graphics.Paint; import android.graphics.PointF; import android.util.DisplayMetrics; import android.view.WindowManager; +import net.osmand.ResultMatcher; +import net.osmand.data.Amenity; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.data.QuadRect; @@ -15,26 +17,26 @@ import net.osmand.data.QuadTree; import net.osmand.data.RotatedTileBox; import net.osmand.data.TransportStop; import net.osmand.plus.R; -import net.osmand.plus.resources.TransportIndexRepository; +import net.osmand.plus.poi.PoiUIFilter; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.List; public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLayer.IContextMenuProvider { private static final int startZoom = 12; private OsmandMapTileView view; - private List objects = new ArrayList<>(); private Paint paintIcon; private Bitmap stopBus; - private Bitmap stopTram; private Bitmap stopSmall; + private MapLayerData> data; - @SuppressWarnings("deprecation") @Override - public void initLayer(OsmandMapTileView view) { + public void initLayer(final OsmandMapTileView view) { this.view = view; DisplayMetrics dm = new DisplayMetrics(); WindowManager wmgr = (WindowManager) view.getContext().getSystemService(Context.WINDOW_SERVICE); @@ -42,12 +44,59 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa paintIcon = new Paint(); stopBus = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_transport_stop_bus); - stopTram = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_transport_stop_tram); stopSmall = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_transport_stop_small); + + data = new OsmandMapLayer.MapLayerData>() { + { + ZOOM_THRESHOLD = 0; + } + + @Override + public boolean isInterrupted() { + return super.isInterrupted(); + } + + @Override + public void layerOnPostExecute() { + view.refreshMap(); + } + + @Override + protected List calculateResult(RotatedTileBox tileBox) { + QuadRect latLonBounds = tileBox.getLatLonBounds(); + if (latLonBounds == null) { + return new ArrayList<>(); + } + int z = (int) Math.floor(tileBox.getZoom() + Math.log(view.getSettings().MAP_DENSITY.get()) / Math.log(2)); + + List res = view.getApplication().getResourceManager().searchTransportSync(latLonBounds.top, latLonBounds.left, + latLonBounds.bottom, latLonBounds.right, new ResultMatcher() { + + @Override + public boolean publish(TransportStop object) { + return true; + } + + @Override + public boolean isCancelled() { + return isInterrupted(); + } + }); + Collections.sort(res, new Comparator() { + @Override + public int compare(TransportStop lhs, TransportStop rhs) { + return lhs.getId() < rhs.getId() ? -1 : (lhs.getId().longValue() == rhs.getId().longValue() ? 0 : 1); + } + }); + + return res; + } + }; } public void getFromPoint(RotatedTileBox tb,PointF point, List res) { - if (objects != null) { + if (data.getResults() != null) { + List objects = data.getResults(); int ex = (int) point.x; int ey = (int) point.y; final int rp = getRadiusPoi(tb); @@ -72,35 +121,6 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa } - - - private String getStopDescription(TransportStop n, boolean useName) { - StringBuilder text = new StringBuilder(250); - text.append(view.getContext().getString(R.string.transport_Stop)) - .append(" : ").append(n.getName(view.getSettings().MAP_PREFERRED_LOCALE.get())); //$NON-NLS-1$ - text.append("\n").append(view.getContext().getString(R.string.transport_Routes)).append(" : "); //$NON-NLS-1$ //$NON-NLS-2$ - List reps = view.getApplication().getResourceManager().searchTransportRepositories( - n.getLocation().getLatitude(), n.getLocation().getLongitude()); - - for (TransportIndexRepository t : reps) { - if (t.acceptTransportStop(n)) { - List l; - if (!useName) { - l = t.getRouteDescriptionsForStop(n, "{1} {0}"); //$NON-NLS-1$ - } else if (view.getSettings().usingEnglishNames()) { - l = t.getRouteDescriptionsForStop(n, "{1} {0} - {3}"); //$NON-NLS-1$ - } else { - l = t.getRouteDescriptionsForStop(n, "{1} {0} - {2}"); //$NON-NLS-1$ - } - if (l != null) { - for (String s : l) { - text.append("\n").append(s); //$NON-NLS-1$ - } - } - } - } - return text.toString(); - } public int getRadiusPoi(RotatedTileBox tb){ final double zoom = tb.getZoom(); @@ -124,16 +144,11 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tileBox, DrawSettings settings) { if (tileBox.getZoom() >= startZoom) { - objects.clear(); - + data.queryNewData(tileBox);; float iconSize = stopBus.getWidth() * 3 / 2.5f; QuadTree boundIntersections = initBoundIntersections(tileBox); - - final QuadRect latLonBounds = tileBox.getLatLonBounds(); - view.getApplication().getResourceManager().searchTransportAsync(latLonBounds.top, latLonBounds.left, - latLonBounds.bottom, latLonBounds.right, tileBox.getZoom(), objects); List fullObjects = new ArrayList<>(); - for (TransportStop o : objects) { + for (TransportStop o : data.getResults()) { float x = tileBox.getPixXFromLatLon(o.getLocation().getLatitude(), o.getLocation().getLongitude()); float y = tileBox.getPixYFromLatLon(o.getLocation().getLatitude(), o.getLocation().getLongitude());