summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2018-10-24 16:45:53 +0200
committerTobrun <tobrun.van.nuland@gmail.com>2018-10-24 16:45:53 +0200
commit29b37b941bdd9630598dc4c8d7e75cd41246cd12 (patch)
tree1fd5306406cc91740b23fb0cfeb930c2bdb025ae
parentaf69d85f4eed5f496ffa39056c125d75ebf1f25f (diff)
downloadqtlocation-mapboxgl-upstream/tvn-expose-file-constructor.tar.gz
[android] - expose file constructors on geojsonsourceupstream/tvn-expose-file-constructor
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonSource.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonSource.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonSource.java
index 2d9b1c985a..27d9d90bd5 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonSource.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonSource.java
@@ -10,6 +10,7 @@ import com.mapbox.geojson.FeatureCollection;
import com.mapbox.geojson.Geometry;
import com.mapbox.mapboxsdk.style.expressions.Expression;
+import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
@@ -113,6 +114,31 @@ public class GeoJsonSource extends Source {
}
/**
+ * Create a GeoJsonSource from a file
+ *
+ * @param id the source id
+ * @param file file
+ */
+ public GeoJsonSource(String id, File file) {
+ super();
+ initialize(id, null);
+ nativeSetUrl(file.getPath());
+ }
+
+ /**
+ * Create a GeoJsonSource from a file
+ *
+ * @param id the source id
+ * @param file file
+ * @param options options
+ */
+ public GeoJsonSource(String id, File file, GeoJsonOptions options) {
+ super();
+ initialize(id, options);
+ nativeSetUrl(file.getPath());
+ }
+
+ /**
* Create a GeoJsonSource from a FeatureCollection.
*
* @param id the source id