Skip to content

Commit

Permalink
chore: format code.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 22, 2021
1 parent 8076230 commit 50a4f68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ export interface MapProps extends BMap.MapOptions, BMap.MapEvents {
* 将全景实例与Map类进行绑定
*/
panorama?: BMap.Panorama;
viewport?:(view: Array<BMap.Point> | BMap.Viewport, viewportOptions: BMap.ViewportOptions)=>void;

viewport?: (view: Array<BMap.Point> | BMap.Viewport, viewportOptions: BMap.ViewportOptions) => void;
}

export type MapChildRenderProps =
Expand Down
3 changes: 2 additions & 1 deletion src/Polygon/usePolygon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function usePolygon(props = {} as UsePolygon) {
enableClicking,
};

useEffect(function () {
useEffect(() => {
if (!BMap || !map) return noop;
const points = (path || []).map((item) => new BMap.Point(item.lng, item.lat));
const instance = new BMap.Polygon(points, opts);
Expand All @@ -42,6 +42,7 @@ export default function usePolygon(props = {} as UsePolygon) {
return function () {
map.removeOverlay(instance);
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [map, props.path]);

useEffect(() => {
Expand Down

0 comments on commit 50a4f68

Please sign in to comment.