diff --git a/packages/polygon/src/usePolygon.tsx b/packages/polygon/src/usePolygon.tsx index 181e03c96..2e947956a 100644 --- a/packages/polygon/src/usePolygon.tsx +++ b/packages/polygon/src/usePolygon.tsx @@ -26,8 +26,8 @@ export const usePolygon = (props = {} as UsePolygon) => { // // 暂不使用这个 API,这个不兼容 v1.4.xx,改用 map.remove API // map && map.removeLayer(instance); // } + setPolygon(undefined); } - setPolygon(undefined); }; }, [map, polygon]);