summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonOptions.java
diff options
context:
space:
mode:
authorIvo van Dongen <ivovandongen@users.noreply.github.com>2016-09-21 11:04:32 +0200
committerGitHub <noreply@github.com>2016-09-21 11:04:32 +0200
commiteb97dbe383ca7697feab5860995b97181c39c607 (patch)
tree70bdd7b6ebea32aec132413fa703e92a2a0f63d0 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonOptions.java
parent3b546b964609d0f596dac32e155b1489bb85645e (diff)
downloadqtlocation-mapboxgl-eb97dbe383ca7697feab5860995b97181c39c607.tar.gz
[android] Sources: peer model, mutability (#6054)
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonOptions.java')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonOptions.java63
1 files changed, 63 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonOptions.java
new file mode 100644
index 0000000000..d7a9282371
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonOptions.java
@@ -0,0 +1,63 @@
+package com.mapbox.mapboxsdk.style.sources;
+
+import java.util.HashMap;
+
+/**
+ * Options for the <a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson">GeoJsonSource</a>
+ */
+public class GeoJsonOptions extends HashMap<String, Object> {
+
+ /**
+ * Defaults to 18.
+ * Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels).
+ */
+ public GeoJsonOptions withMaxZoom(int maxZoom) {
+ this.put("maxzoom", maxZoom);
+ return this;
+ }
+
+ /**
+ * Defaults to 128.
+ * Tile buffer size on each side (measured in 1/512ths of a tile; higher means fewer rendering artifacts near tile edges but slower performance).
+ */
+ public GeoJsonOptions withBuffer(int buffer) {
+ this.put("buffer", buffer);
+ return this;
+ }
+
+ /**
+ * Defaults to 0.375.
+ * Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance).
+ */
+ public GeoJsonOptions withTolerance(float tolerance) {
+ this.put("tolerance", tolerance);
+ return this;
+ }
+
+ /**
+ * Defaults to false.
+ * If the data is a collection of point features, setting this to true clusters the points by radius into groups.
+ */
+ public GeoJsonOptions withCluster(boolean cluster) {
+ this.put("cluster", cluster);
+ return this;
+ }
+
+ /**
+ * Defaults to 50.
+ * Radius of each cluster when clustering points, measured in 1/512ths of a tile.
+ */
+ public GeoJsonOptions withClusterMaxZoom(int clusterMaxZoom) {
+ this.put("clusterMaxZoom", clusterMaxZoom);
+ return this;
+ }
+
+ /**
+ * Max zoom to cluster points on. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered).
+ */
+ public GeoJsonOptions withClusterRadius(int clusterRadius) {
+ this.put("clusterRadius", clusterRadius);
+ return this;
+ }
+
+}