diff --git a/src/pages/components/editor.tsx b/src/pages/components/editor.tsx index 01f5eab..5d66184 100644 --- a/src/pages/components/editor.tsx +++ b/src/pages/components/editor.tsx @@ -57,7 +57,11 @@ export const Editor: React.FC = (props) => { )) as string | null; if (newEditorText && scene && !props.features) { try { - const errors = hint(JSON.parse(newEditorText)); + const errors = hint(JSON.parse(newEditorText)).filter( + (item: { message: string }) => + item.message !== + 'Polygons and MultiPolygons should follow the right-hand rule', + ); if (errors.length > 0) { message.error(t('import_btn.file_upload.qingJianChaShuJu')); } else { diff --git a/src/recoil/feature.ts b/src/recoil/feature.ts index 9667c37..19db9d7 100644 --- a/src/recoil/feature.ts +++ b/src/recoil/feature.ts @@ -73,7 +73,11 @@ export default function useFeature() { let newFeatures: Feature[] = []; if (editorText || value) { try { - const errors = hint(JSON.parse(value ?? editorText)); + const errors = hint(JSON.parse(value ?? editorText)).filter( + (item: { message: string }) => + item.message !== + 'Polygons and MultiPolygons should follow the right-hand rule', + ); if (errors.length > 0) { message.warning(t('recoil.feature.shuJuJiaZaiYou')); } else { @@ -84,9 +88,7 @@ export default function useFeature() { setSavedText(value ?? editorText); setFeatures(newFeatures as IFeatures); } - } catch (error) { - message.warning(t('recoil.feature.shuJuJiaZaiYou')); - } + } catch (error) {} } else { setEditorText(emptyFeatures); setSavedText(emptyFeatures);