pub struct GeoJsonSource {
pub data: FeatureCollection,
/* private fields */
}Expand description
In-memory vector feature source with optional point clustering.
Fields§
§data: FeatureCollectionFeatures exposed by the source.
Implementations§
Source§impl GeoJsonSource
impl GeoJsonSource
Sourcepub fn new(data: FeatureCollection) -> Self
pub fn new(data: FeatureCollection) -> Self
Create a new in-memory vector source.
Sourcepub fn with_clustering(self, options: ClusterOptions) -> Self
pub fn with_clustering(self, options: ClusterOptions) -> Self
Enable point clustering on this source.
Builds the cluster index immediately from the current data.
Layers that reference this source will receive clustered features
at the appropriate zoom level instead of the raw point data.
Sourcepub fn is_clustered(&self) -> bool
pub fn is_clustered(&self) -> bool
Returns true if this source has clustering enabled.
Sourcepub fn features_at_zoom(&self, zoom: u8) -> Cow<'_, FeatureCollection>
pub fn features_at_zoom(&self, zoom: u8) -> Cow<'_, FeatureCollection>
Resolve features for a given zoom level.
If clustering is enabled, returns zoom-appropriate clustered features. Otherwise returns a borrowed reference to the raw data.
Trait Implementations§
Source§impl Clone for GeoJsonSource
impl Clone for GeoJsonSource
Source§fn clone(&self) -> GeoJsonSource
fn clone(&self) -> GeoJsonSource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GeoJsonSource
impl RefUnwindSafe for GeoJsonSource
impl Send for GeoJsonSource
impl Sync for GeoJsonSource
impl Unpin for GeoJsonSource
impl UnsafeUnpin for GeoJsonSource
impl UnwindSafe for GeoJsonSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more