summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java
index 1c59bb468e..0895096f6e 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java
@@ -82,7 +82,7 @@ public class MapSnapshotter {
* MapSnapshotter options
*/
public static class Options {
- private int pixelRatio = 1;
+ private float pixelRatio = 1;
private int width;
private int height;
private String styleUrl = Style.MAPBOX_STREETS;
@@ -95,6 +95,9 @@ public class MapSnapshotter {
* @param height the height of the image
*/
public Options(int width, int height) {
+ if (width == 0 || height == 0) {
+ throw new IllegalArgumentException("Unable to create a snapshot with width or height set to 0");
+ }
this.width = width;
this.height = height;
}
@@ -122,7 +125,7 @@ public class MapSnapshotter {
* @param pixelRatio the pixel ratio to use (default: 1)
* @return the mutated {@link Options}
*/
- public Options withPixelRatio(int pixelRatio) {
+ public Options withPixelRatio(float pixelRatio) {
this.pixelRatio = pixelRatio;
return this;
}
@@ -164,7 +167,7 @@ public class MapSnapshotter {
/**
* @return the pixel ratio
*/
- public int getPixelRatio() {
+ public float getPixelRatio() {
return pixelRatio;
}