summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonSource.java
diff options
context:
space:
mode:
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.java99
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