diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2018-10-24 16:45:53 +0200 |
---|---|---|
committer | Tobrun <tobrun.van.nuland@gmail.com> | 2018-10-24 16:45:53 +0200 |
commit | 29b37b941bdd9630598dc4c8d7e75cd41246cd12 (patch) | |
tree | 1fd5306406cc91740b23fb0cfeb930c2bdb025ae | |
parent | af69d85f4eed5f496ffa39056c125d75ebf1f25f (diff) | |
download | qtlocation-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.java | 26 |
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 |