diff options
author | tobrun <tobrun.van.nuland@gmail.com> | 2019-05-27 15:50:15 +0200 |
---|---|---|
committer | Tobrun <tobrun.van.nuland@gmail.com> | 2019-05-27 19:21:18 +0200 |
commit | 1e974804adf8cadcb3b90fb5658e054c080889e6 (patch) | |
tree | 5b3b4e18679b60f4f1c4fbdba9b62da001bccfe6 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonSource.java | |
parent | 2be07041fd84c8c70bd39e24473a06d0ab062f3e (diff) | |
download | qtlocation-mapboxgl-1e974804adf8cadcb3b90fb5658e054c080889e6.tar.gz |
[android] - add javadoc URI supported protocols
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonSource.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonSource.java | 99 |
1 files changed, 91 insertions, 8 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 a8b9de62eb..f2de07bdd0 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 @@ -118,7 +118,25 @@ public class GeoJsonSource extends Source { } /** - * Create a GeoJsonSource from a geo json file + * Create a GeoJsonSource from a geo json URI + * <p> + * An URI is a combination of a protocol and a resource path. + * The following URI protocol schemes are supported: + * </p> + * <ul> + * <li>http://</li> + * <ul> + * <li>load resources using HyperText Transfer Protocol</li> + * </ul> + * <li>file://</li> + * <ul> + * <li>load resources from the Android file system</li> + * </ul> + * <li>asset://</li> + * <ul> + * <li>load resources from the binary packaged assets folder</li> + * </ul> + * </ul> * * @param id the source id * @param uri unique resource identifier @@ -130,7 +148,25 @@ public class GeoJsonSource extends Source { } /** - * Create a GeoJsonSource from a geo json file and non-default GeoJsonOptions + * Create a GeoJsonSource from a geo json URI and non-default GeoJsonOptions + * <p> + * An URI is a combination of a protocol and a resource path. + * The following URI protocol schemes are supported: + * </p> + * <ul> + * <li>http://</li> + * <ul> + * <li>load resources using HyperText Transfer Protocol</li> + * </ul> + * <li>file://</li> + * <ul> + * <li>load resources from the Android file system</li> + * </ul> + * <li>asset://</li> + * <ul> + * <li>load resources from the binary packaged assets folder</li> + * </ul> + * </ul> * * @param id the source id * @param uri remote json file @@ -286,13 +322,30 @@ public class GeoJsonSource extends Source { } /** - * Updates the uri + * Updates the URI of the source. + * <p> + * An URI is a combination of a protocol and a resource path. + * The following URI protocol schemes are supported: + * </p> + * <ul> + * <li>http://</li> + * <ul> + * <li>load resources using HyperText Transfer Protocol</li> + * </ul> + * <li>file://</li> + * <ul> + * <li>load resources from the Android file system</li> + * </ul> + * <li>asset://</li> + * <ul> + * <li>load resources from the binary packaged assets folder</li> + * </ul> + * </ul> * - * @param url the GeoJSON FeatureCollection uri + * @param uri the GeoJSON FeatureCollection uri */ - public void setUri(@NonNull URI url) { - checkThread(); - setUrl(url.toString()); + public void setUri(@NonNull URI uri) { + setUri(uri.toString()); } /** @@ -308,7 +361,25 @@ public class GeoJsonSource extends Source { } /** - * Updates the url + * Updates the URI of the source. + * <p> + * An URI is a combination of a protocol and a resource path. + * The following URI protocol schemes are supported: + * </p> + * <ul> + * <li>http://</li> + * <ul> + * <li>load resources using HyperText Transfer Protocol</li> + * </ul> + * <li>file://</li> + * <ul> + * <li>load resources from the Android file system</li> + * </ul> + * <li>asset://</li> + * <ul> + * <li>load resources from the binary packaged assets folder</li> + * </ul> + * </ul> * * @param uri the GeoJSON FeatureCollection uri */ @@ -319,6 +390,7 @@ public class GeoJsonSource extends Source { /** * @return The url or null + * @deprecated use {@link #getUri()} instead */ @Nullable public String getUrl() { @@ -327,6 +399,17 @@ public class GeoJsonSource extends Source { } /** + * Get the URI of the source. + * + * @return The uri or null + */ + @Nullable + public String getUri() { + checkThread(); + return nativeGetUrl(); + } + + /** * Queries the source for features. * * @param filter an optional filter expression to filter the returned Features |