All files / circle/src index.tsx

75% Statements 3/4
100% Branches 0/0
50% Functions 1/2
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24                                      1x 1x 1x    
/// <reference types="@uiw/react-baidu-map-types" />
 
import React, { useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { useCircle } from './useCircle';
export * from './useCircle';
 
export interface CircleProps extends OverlayProps, BMap.CircleOptions, BMap.CircleEvents {
  /**
   * 设置折线的点数组
   */
  center: BMap.Point;
  /**
   * 设置圆形的半径,单位为米
   */
  radius: number;
}
 
export default React.forwardRef<CircleProps & { circle?: BMap.Circle }, CircleProps>((props, ref) => {
  const { circle } = useCircle(props);
  useImperativeHandle(ref, () => ({ ...props, circle }));
  return null;
});