drawRect method
Future<void>
drawRect(
- RectOSM rectOSM
)
inherited
Implementation
Future<void> drawRect(RectOSM rectOSM) async {
final rect = geoPointAsRect(
center: rectOSM.centerPoint,
lengthInMeters: rectOSM.distance,
widthInMeters: rectOSM.distance,
);
final opacity = rectOSM.color.opacity;
final shapeConfig = RectShapeJS(
key: rectOSM.key,
color: rectOSM.color.withOpacity(1).toHexColor(),
strokeWidth: rectOSM.strokeWidth,
opacityFilled: opacity,
borderColor: rectOSM.borderColor?.toHexColor(),
);
await interop
.drawRect(
mapIdMixin.toJS,
shapeConfig,
rect.map((e) => e.toGeoJS()).toList().toJS,
)
.toDart;
}