initWithIdentifier$3 method

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

Returns a shape source with an identifier, an array of shapes, 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.

Any MLNFeature instance passed into this initializer is treated as an ordinary shape, causing any attributes to be inaccessible to an MLNVectorStyleLayer when evaluating a predicate or configuring certain layout or paint attributes. To preserve the attributes associated with each feature, use the -initWithIdentifier:features:options: method instead.

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 shapes An array of shapes; each shape is a member of a concrete subclass of MLNShape. @param options An NSDictionary of options for this source. @return An initialized shape source.

Implementation

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