Browse Source

fix: 修复不能重复上传GeoJSON的问题

master
Cmen 3 years ago
parent
commit
c52be46f57
  1. 4
      src/editor/Property/index.tsx
  2. 4
      src/editor/index.tsx
  3. 12
      src/utils/covert.js
  4. 1
      src/utils/upload.ts

4
src/editor/Property/index.tsx

@ -43,7 +43,7 @@ const Property = () => {
}
const categoryPane = (
<Form.Item label="类型">
<Form.Item label="地理类型">
<Select
value={overlay.category}
onChange={(category) =>
@ -77,7 +77,7 @@ const Property = () => {
<>
<div className="pane-title"></div>
<div className="property-area">
<Form size="small">
<Form size="small" labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
<Form.Item label="名称">
<FineInput
value={overlay.name}

4
src/editor/index.tsx

@ -8,7 +8,7 @@ import Property from "./Property";
import "./index.less";
const { Header, Footer, Sider, Content } = Layout;
const { Header, Sider, Content } = Layout;
export const Editor = () => {
return (
@ -23,7 +23,7 @@ export const Editor = () => {
<Content className="editor-body-center">
<Plot />
</Content>
<Sider className="editor-body-right">
<Sider className="editor-body-right" width={240}>
<Property />
</Sider>
</Layout>

12
src/utils/covert.js

@ -1,3 +1,9 @@
var pi = 3.1415926535897932384626;
var a = 6378245.0;
var ee = 0.00669342162296594323;
var x_pi = (pi * 3000.0) / 180.0;
var R = 6378137;
export const bd09_To_gps84 = function (lng, lat) {
var gcj02 = bd09_To_gcj02(lng, lat);
var map84 = gcj02_To_gps84(gcj02.lng, gcj02.lat);
@ -65,12 +71,6 @@ export const bd09_To_gcj02 = function (bd_lng, bd_lat) {
return newCoord;
};
var pi = 3.1415926535897932384626;
var a = 6378245.0;
var ee = 0.00669342162296594323;
var x_pi = (pi * 3000.0) / 180.0;
var R = 6378137;
function transform(lng, lat) {
var dLat = transformLat(lng - 105.0, lat - 35.0);
var dLng = transformLng(lng - 105.0, lat - 35.0);

1
src/utils/upload.ts

@ -7,6 +7,7 @@ type UploadProps = {
};
export function openUpload(props: UploadProps) {
(fileInput as any).value = null;
fileInput.accept = props.accept;
fileInput.onchange = () => {
const { files } = fileInput;

Loading…
Cancel
Save