CanvasAdapter: add getScale method #92

This commit is contained in:
Emux
2017-09-11 13:05:22 +03:00
parent 5c2b404b3f
commit f81dff2365
13 changed files with 23 additions and 19 deletions

View File

@@ -86,7 +86,7 @@ public class ReverseGeocodeActivity extends MapsforgeMapActivity {
GeoPoint p = mMap.viewport().fromScreenPoint(e.getX(), e.getY());
// Read all labeled POI and ways for the area covered by the tiles under touch
float touchRadius = TOUCH_RADIUS * CanvasAdapter.dpi / CanvasAdapter.DEFAULT_DPI;
float touchRadius = TOUCH_RADIUS * CanvasAdapter.getScale();
long mapSize = MercatorProjection.getMapSize((byte) mMap.getMapPosition().getZoomLevel());
double pixelX = MercatorProjection.longitudeToPixelX(p.getLongitude(), mapSize);
double pixelY = MercatorProjection.latitudeToPixelY(p.getLatitude(), mapSize);