drawRect method

Future<void> drawRect(
  1. RectOSM rectOSM
)
inherited

Implementation

Future<void> drawRect(RectOSM rectOSM) async {
  final rect = geoPointAsRect(
    center: rectOSM.centerPoint,
    lengthInMeters: rectOSM.distance,
    widthInMeters: rectOSM.distance,
  );
  await promiseToFuture(interop.drawRect(
    mapIdMixin,
    RectShapeJS(
      key: rectOSM.key,
      color: rectOSM.color.toHexColor(),
      strokeWidth: rectOSM.strokeWidth,
    ),
    rect.map((e) => e.toGeoJS()).toList(),
  ));
}