summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2016-06-20 12:32:20 +0200
committerTobrun <tobrun.van.nuland@gmail.com>2016-07-05 15:43:19 +0200
commit2bf4e20052e827a4f69dd718ba659f66edccc6df (patch)
tree5bf07287a206c982f9407c8b5608ab05a8221511 /platform/android/MapboxGLAndroidSDK/src/main/java/com
parenta40953dd71ca4a3c00ff125ca508948bfc1ec4c5 (diff)
downloadqtlocation-mapboxgl-2bf4e20052e827a4f69dd718ba659f66edccc6df.tar.gz
[android] #5104 - make nativePixelForLatLng faster (74ms to 57ms)
[android] #5104 - make nativeLatLngForPix faster (52ms - 45ms). [andriod] #5104 - make nativeSetLatLng faster (117ms to 105ms) [android] #5104 - make nativeFlyTo faster (106ms to 97ms) [android] #5104 - make nativeEaseTo faster (103 to 94ms) [android] #5104 - make nativeJumpTo faster (94 to 86ms) [android] #5104 - make nativeProjectedMetersForLatLng faster (32 to 30ms) [android] #5104 - make nativeLatLngForProjectedMeters faster (32 to 30ms)
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com')
-rwxr-xr-xplatform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java38
1 files changed, 19 insertions, 19 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java
index 9cf464b926..5a1cfa7a6f 100755
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java
@@ -231,7 +231,7 @@ final class NativeMapView {
}
public void setLatLng(LatLng latLng, long duration) {
- nativeSetLatLng(mNativeMapViewPtr, latLng, duration);
+ nativeSetLatLng(mNativeMapViewPtr, latLng.getLatitude(), latLng.getLongitude(), duration);
}
public LatLng getLatLng() {
@@ -344,7 +344,7 @@ final class NativeMapView {
}
public long addMarker(Marker marker) {
- Marker[] markers = { marker };
+ Marker[] markers = {marker};
return nativeAddMarkers(mNativeMapViewPtr, markers)[0];
}
@@ -353,7 +353,7 @@ final class NativeMapView {
}
public long addPolyline(Polyline polyline) {
- Polyline[] polylines = { polyline };
+ Polyline[] polylines = {polyline};
return nativeAddPolylines(mNativeMapViewPtr, polylines)[0];
}
@@ -362,7 +362,7 @@ final class NativeMapView {
}
public long addPolygon(Polygon polygon) {
- Polygon[] polygons = { polygon };
+ Polygon[] polygons = {polygon};
return nativeAddPolygons(mNativeMapViewPtr, polygons)[0];
}
@@ -377,7 +377,7 @@ final class NativeMapView {
}
public void removeAnnotation(long id) {
- long[] ids = { id };
+ long[] ids = {id};
removeAnnotations(ids);
}
@@ -426,15 +426,15 @@ final class NativeMapView {
}
public ProjectedMeters projectedMetersForLatLng(LatLng latLng) {
- return nativeProjectedMetersForLatLng(mNativeMapViewPtr, latLng);
+ return nativeProjectedMetersForLatLng(mNativeMapViewPtr, latLng.getLatitude(), latLng.getLongitude());
}
public LatLng latLngForProjectedMeters(ProjectedMeters projectedMeters) {
- return nativeLatLngForProjectedMeters(mNativeMapViewPtr, projectedMeters);
+ return nativeLatLngForProjectedMeters(mNativeMapViewPtr, projectedMeters.getNorthing(), projectedMeters.getEasting());
}
public PointF pixelForLatLng(LatLng latLng) {
- return nativePixelForLatLng(mNativeMapViewPtr, latLng);
+ return nativePixelForLatLng(mNativeMapViewPtr, latLng.getLatitude(), latLng.getLongitude());
}
public LatLng latLngForPixel(PointF pixel) {
@@ -446,15 +446,15 @@ final class NativeMapView {
}
public void jumpTo(double angle, LatLng center, double pitch, double zoom) {
- nativeJumpTo(mNativeMapViewPtr, angle, center, pitch, zoom);
+ nativeJumpTo(mNativeMapViewPtr, angle, center.getLatitude(), center.getLongitude(), pitch, zoom);
}
public void easeTo(double angle, LatLng center, long duration, double pitch, double zoom, boolean easingInterpolator) {
- nativeEaseTo(mNativeMapViewPtr, angle, center, duration, pitch, zoom, easingInterpolator);
+ nativeEaseTo(mNativeMapViewPtr, angle, center.getLatitude(), center.getLongitude(), duration, pitch, zoom, easingInterpolator);
}
public void flyTo(double angle, LatLng center, long duration, double pitch, double zoom) {
- nativeFlyTo(mNativeMapViewPtr, angle, center, duration, pitch, zoom);
+ nativeFlyTo(mNativeMapViewPtr, angle, center.getLatitude(), center.getLongitude(), duration, pitch, zoom);
}
public void addCustomLayer(CustomLayer customLayer, String before) {
@@ -542,7 +542,7 @@ final class NativeMapView {
private native void nativeMoveBy(long nativeMapViewPtr, double dx,
double dy, long duration);
- private native void nativeSetLatLng(long nativeMapViewPtr, LatLng latLng,
+ private native void nativeSetLatLng(long nativeMapViewPtr, double latitude, double longitude,
long duration);
private native LatLng nativeGetLatLng(long nativeMapViewPtr);
@@ -623,21 +623,21 @@ final class NativeMapView {
private native double nativeGetMetersPerPixelAtLatitude(long nativeMapViewPtr, double lat, double zoom);
- private native ProjectedMeters nativeProjectedMetersForLatLng(long nativeMapViewPtr, LatLng latLng);
+ private native ProjectedMeters nativeProjectedMetersForLatLng(long nativeMapViewPtr, double latitude, double longitude);
- private native LatLng nativeLatLngForProjectedMeters(long nativeMapViewPtr, ProjectedMeters projectedMeters);
+ private native LatLng nativeLatLngForProjectedMeters(long nativeMapViewPtr, double northing, double easting);
- private native PointF nativePixelForLatLng(long nativeMapViewPtr, LatLng latLng);
+ private native PointF nativePixelForLatLng(long nativeMapViewPtr, double lat, double lon);
private native LatLng nativeLatLngForPixel(long nativeMapViewPtr, PointF pixel);
private native double nativeGetTopOffsetPixelsForAnnotationSymbol(long nativeMapViewPtr, String symbolName);
+
+ private native void nativeJumpTo(long nativeMapViewPtr, double angle, double latitude, double longitude, double pitch, double zoom);
- private native void nativeJumpTo(long nativeMapViewPtr, double angle, LatLng center, double pitch, double zoom);
+ private native void nativeEaseTo(long nativeMapViewPtr, double angle, double latitude, double longitude, long duration, double pitch, double zoom, boolean easingInterpolator);
- private native void nativeEaseTo(long nativeMapViewPtr, double angle, LatLng center, long duration, double pitch, double zoom, boolean easingInterpolator);
-
- private native void nativeFlyTo(long nativeMapViewPtr, double angle, LatLng center, long duration, double pitch, double zoom);
+ private native void nativeFlyTo(long nativeMapViewPtr, double angle, double latitude, double longitude, long duration, double pitch, double zoom);
private native void nativeAddCustomLayer(long nativeMapViewPtr, CustomLayer customLayer, String before);