initWithIdentifier$2 method

MLNShapeSource initWithIdentifier$2(
  1. NSString identifier, {
  2. required NSArray features,
  3. NSDictionary? options,
})

Returns a shape source with an identifier, an array of features, and a dictionary of options for the source.

This class supports the following options: MLNShapeSourceOptionClustered, MLNShapeSourceOptionClusterRadius, MLNShapeSourceOptionMaximumZoomLevelForClustering, MLNShapeSourceOptionMinimumZoomLevel, MLNShapeSourceOptionMinimumZoomLevel, MLNShapeSourceOptionBuffer, and MLNShapeSourceOptionSimplificationTolerance. Shapes provided by a shape source are not clipped or wrapped automatically.

Unlike -initWithIdentifier:shapes:options:, this method accepts MLNFeature instances, such as MLNPointFeature objects, whose attributes you can use when applying a predicate to MLNVectorStyleLayer or configuring a style layer’s appearance.

To create a shape from GeoJSON source code, use the MLNShape/shapeWithData:encoding:error: method.

@param identifier A string that uniquely identifies the source. @param features An array of objects that conform to the MLNFeature protocol. @param options An NSDictionary of options for this source. @return An initialized shape source.

Implementation

MLNShapeSource initWithIdentifier$2(objc.NSString identifier, {required objc.NSArray features,objc.NSDictionary? options}) {
  final _ret = _objc_msgSend_11spmsz(this.ref.retainAndReturnPointer(), _sel_initWithIdentifier_features_options_, identifier.ref.pointer, features.ref.pointer, options?.ref.pointer ?? ffi.nullptr);
  return MLNShapeSource.castFromPointer(_ret, retain: false, release: true);
}