[android] url getter on sources

This commit is contained in:
Ivo van Dongen
2017-05-11 15:01:33 +03:00
committed by Ivo van Dongen
parent 625c2ea527
commit 489f76d3a2
10 changed files with 92 additions and 2 deletions

View File

@@ -227,6 +227,14 @@ public class GeoJsonSource extends Source {
nativeSetUrl(url);
}
/**
* @return The url or null
*/
@Nullable
public String getUrl() {
return nativeGetUrl();
}
/**
* Queries the source for features.
*
@@ -243,6 +251,8 @@ public class GeoJsonSource extends Source {
protected native void nativeSetUrl(String url);
protected native String nativeGetUrl();
private native void nativeSetGeoJsonString(String geoJson);
private native void nativeSetFeatureCollection(FeatureCollection geoJson);

View File

@@ -1,5 +1,7 @@
package com.mapbox.mapboxsdk.style.sources;
import android.support.annotation.Nullable;
import java.net.URL;
/**
@@ -72,8 +74,19 @@ public class RasterSource extends Source {
initialize(id, tileSet.toValueObject(), tileSize);
}
/**
* @return The url or null
*/
@Nullable
public String getUrl() {
return nativeGetUrl();
}
protected native void initialize(String layerId, Object payload, int tileSize);
@Override
protected native void finalize() throws Throwable;
protected native String nativeGetUrl();
}

View File

@@ -76,11 +76,21 @@ public class VectorSource extends Source {
return features != null ? Arrays.asList(features) : new ArrayList<Feature>();
}
/**
* @return The url or null
*/
@Nullable
public String getUrl() {
return nativeGetUrl();
}
protected native void initialize(String layerId, Object payload);
@Override
protected native void finalize() throws Throwable;
protected native String nativeGetUrl();
private native Feature[] querySourceFeatures(String[] sourceLayerId,
Object[] filter);