initWithIdentifier$1 method

MLNShapeSource initWithIdentifier$1(
  1. NSString identifier, {
  2. MLNShape? shape,
  3. NSDictionary? options,
})

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

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

To specify attributes about the shape, use an instance of an MLNShape subclass that conforms to the MLNFeature protocol, such as MLNFeature. To include multiple shapes in the source, use an MLNShapeCollection or MLNShapeCollectionFeature object, or use the -initWithIdentifier:features:options: or -initWithIdentifier:shapes:options: methods.

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 shape A concrete subclass of MLNShape @param options An NSDictionary of options for this source. @return An initialized shape source.

TODO: Animate a line, learn how to animate line data by continously updating an MLNShapeSource's shape attribute.

Implementation

MLNShapeSource initWithIdentifier$1(objc.NSString identifier, {MLNShape? shape,objc.NSDictionary? options}) {
  final _ret = _objc_msgSend_11spmsz(this.ref.retainAndReturnPointer(), _sel_initWithIdentifier_shape_options_, identifier.ref.pointer, shape?.ref.pointer ?? ffi.nullptr, options?.ref.pointer ?? ffi.nullptr);
  return MLNShapeSource.castFromPointer(_ret, retain: false, release: true);
}