* Requires configuring this source as a cluster by calling {@link GeoJsonOptions#withCluster(boolean)}. *
* * @param cluster cluster from which to retrieve children from * @return a list of features for the underlying children */ @NonNull public FeatureCollection getClusterChildren(@NonNull Feature cluster) { checkThread(); return FeatureCollection.fromFeatures(nativeGetClusterChildren(cluster)); } /** * Returns all the leaves of a cluster (given its cluster_id), with pagination support: limit is the number of leaves * to return (set to Infinity for all points), and offset is the amount of points to skip (for pagination). ** Requires configuring this source as a cluster by calling {@link GeoJsonOptions#withCluster(boolean)}. *
* * @param cluster cluster from which to retrieve leaves from * @param limit limit is the number of points to return * @param offset offset is the amount of points to skip (for pagination) * @return a list of features for the underlying leaves */ @NonNull public FeatureCollection getClusterLeaves(@NonNull Feature cluster, long limit, long offset) { checkThread(); return FeatureCollection.fromFeatures(nativeGetClusterLeaves(cluster, limit, offset)); } /** * Returns the zoom on which the cluster expands into several children (useful for "click to zoom" feature) * given the cluster's cluster_id (cluster_id value from feature properties). ** Requires configuring this source as a cluster by calling {@link GeoJsonOptions#withCluster(boolean)}. *
* * @param cluster cluster from which to retrieve the expansion zoom from * @return the zoom on which the cluster expands into several children */ public int getClusterExpansionZoom(@NonNull Feature cluster) { checkThread(); return nativeGetClusterExpansionZoom(cluster); } @Keep protected native void initialize(String layerId, Object options); @Keep protected native void nativeSetUrl(String url); @NonNull @Keep protected native String nativeGetUrl(); @Keep private native void nativeSetGeoJsonString(String geoJson); @Keep private native void nativeSetFeatureCollection(FeatureCollection geoJson); @Keep private native void nativeSetFeature(Feature feature); @Keep private native void nativeSetGeometry(Geometry geometry); @NonNull @Keep private native Feature[] querySourceFeatures(Object[] filter); @Keep private native Feature[] nativeGetClusterChildren(Feature feature); @Keep private native Feature[] nativeGetClusterLeaves(Feature feature, long limit, long offset); @Keep private native int nativeGetClusterExpansionZoom(Feature feature); @Override @Keep protected native void finalize() throws Throwable; }