summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2016-08-12 22:15:38 -0400
committerTobrun <tobrun.van.nuland@gmail.com>2016-08-12 23:54:09 -0400
commit112789a76111d4dd38e50c73ae1e81e5c53dd59c (patch)
tree4ba6fb9b737b7a40eb54dc8442664f3e109ef4a0 /platform
parentc57a54d9207198a925334b319f8fc0032053d045 (diff)
downloadqtlocation-mapboxgl-112789a76111d4dd38e50c73ae1e81e5c53dd59c.tar.gz
[android] - make query source features depend on screendensity
Diffstat (limited to 'platform')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
index 1c2f8e59c5..3cb28ed395 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
@@ -77,7 +77,6 @@ import com.mapbox.mapboxsdk.constants.MyLocationTracking;
import com.mapbox.mapboxsdk.constants.Style;
import com.mapbox.mapboxsdk.exceptions.IconBitmapChangedException;
import com.mapbox.mapboxsdk.geometry.LatLng;
-import com.mapbox.mapboxsdk.geometry.LatLngBounds;
import com.mapbox.mapboxsdk.location.LocationListener;
import com.mapbox.mapboxsdk.location.LocationServices;
import com.mapbox.mapboxsdk.maps.widgets.CompassView;
@@ -1156,7 +1155,6 @@ public class MapView extends FrameLayout {
return new ArrayList<>();
}
- // TODO: filter in JNI using C++ parameter to queryPointAnnotations
long[] ids = mNativeMapView.queryPointAnnotations(rect);
List<Long> idsList = new ArrayList<>(ids.length);
@@ -1182,7 +1180,6 @@ public class MapView extends FrameLayout {
return new ArrayList<>();
}
- // TODO: filter in JNI using C++ parameter to queryPointAnnotations
long[] ids = mNativeMapView.queryPointAnnotations(rect);
List<Long> idsList = new ArrayList<>(ids.length);
@@ -1727,11 +1724,12 @@ public class MapView extends FrameLayout {
PointF tapPoint = new PointF(e.getX(), e.getY());
float toleranceSides = 4 * mScreenDensity;
float toleranceTopBottom = 10 * mScreenDensity;
- RectF tapRect = new RectF(tapPoint.x - mAverageIconWidth / 2 - toleranceSides,
- tapPoint.y - mAverageIconHeight / 2 - toleranceTopBottom,
- tapPoint.x + mAverageIconWidth / 2 + toleranceSides,
- tapPoint.y + mAverageIconHeight / 2 + toleranceTopBottom);
+ RectF tapRect = new RectF((tapPoint.x - mAverageIconWidth / 2 - toleranceSides) / mScreenDensity,
+ (tapPoint.y - mAverageIconHeight / 2 - toleranceTopBottom) / mScreenDensity,
+ (tapPoint.x + mAverageIconWidth / 2 + toleranceSides) / mScreenDensity,
+ (tapPoint.y + mAverageIconHeight / 2 + toleranceTopBottom) / mScreenDensity);
+
List<Marker> nearbyMarkers = getMarkersInRect(tapRect);
long newSelectedMarkerId = -1;