NTLocalVectorDataSource
@interface NTLocalVectorDataSource : NTVectorDataSource
A modifiable vector data source that keeps all the elements in the local memory. Optionally vector elements can be kept in a spatial index and only the visible elements get rendered. There can be a small delay before previously invisible elements become visible after view changes. This makes it suitable for cases where there are a large number of static vector elements.
The draw order of vector elements within the data source is undefined.
-
Constructs an LocalVectorDataSource object with no spatial index.
Declaration
Objective-C
- (id)initWithProjection:(NTProjection *)projection;
Parameters
projection
The projection used by this data source.
-
Constructs an LocalVectorDataSource object with specified spatial index.
Declaration
Objective-C
- (id)initWithProjection:(NTProjection *)projection spatialIndexType:(enum NTLocalSpatialIndexType)spatialIndexType;
Parameters
projection
The projection used by this data source.
spatialIndexType
The spatial index type to use.
-
Clear the data source by removing all elements.
Declaration
Objective-C
- (void)clear;
-
Returns all vector elements added to this data source using add() and addAll() methods.
Declaration
Objective-C
- (NTVectorElementVector *)getAll;
Return Value
A vector containing all the vector elements in this data source.
-
Replaces all vector elements in the data source with the given list of vector elements.
Declaration
Objective-C
- (void)setAll:(NTVectorElementVector *)elements;
Parameters
elements
The list of new vector elements
-
Adds a vector element to the data source. The vector element’s coordinates are expected to be in the data source’s projection’s coordinate system. The order in which the elements are added has no effect on the order they get rendered.
Declaration
Objective-C
- (void)add:(NTVectorElement *)element;
Parameters
element
The vector element to be added.
-
Adds multiple vector elements to the data source. The vector elements’ coordinates are expected to be in the data source’s projection’s coordinate system. The order in which the elements are added has no effect on the order they get rendered.
Declaration
Objective-C
- (void)addAll:(NTVectorElementVector *)elements;
Parameters
elements
A list of vector elements to be added.
-
Removes a vector element from the data source.
Declaration
Objective-C
- (BOOL)remove:(NTVectorElement *)element;
Parameters
element
The vector element to be removed.
Return Value
True if the vector element existed in the data source.
-
Removes multiple vector elements from the data source.
Declaration
Objective-C
- (BOOL)removeAll:(NTVectorElementVector *)elements;
Parameters
elements
A list of vector elements to be removed.
Return Value
True if all listed elements were removed. False otherwise.
-
Returns the active geometry simplifier of the data source.
Declaration
Objective-C
- (NTGeometrySimplifier *)getGeometrySimplifier;
Return Value
The current geometry simplifier (can be null)
-
Attaches geometry simplifier to the data source. If the specified simplifier is null, detaches any active simplifier.
Declaration
Objective-C
- (void)setGeometrySimplifier:(NTGeometrySimplifier *)simplifier;
Parameters
simplifier
The new geometry simplifier to use (can be null).
-
Returns the elements of this data source as a feature collection. The feature collection can be then serialized as a GeoJSON, for example.
Declaration
Objective-C
- (NTFeatureCollection *)getFeatureCollection;
Return Value
The feature collection containing all data source elements.
-
Loads all vector elements from specified feature collection by applying specified style.
Declaration
Objective-C
- (void)addFeatureCollection:(NTFeatureCollection *)featureCollection style:(NTStyle *)style;
Parameters
featureCollection
The feature collection to load elements from.
style
The geometry collection style to use. Only elements compatible with style are created.
-
Undocumented
Declaration
Objective-C
- (NTMapBounds *)getDataExtent;
-
Undocumented
Declaration
Objective-C
-(NTMapBounds*)getDataExtentSwigExplicitNTLocalVectorDataSource;
-
Undocumented
Declaration
Objective-C
- (NTVectorData *)loadElements:(NTCullState *)cullState;
-
Undocumented
Declaration
Objective-C
-(NTVectorData*)loadElementsSwigExplicitNTLocalVectorDataSource: (NTCullState*)cullState;
-
Undocumented
Declaration
Objective-C
-(void)dealloc;