# map-point-config

> npm i --save map-point-config

Latest version **0.0.9** (published 2023-01-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install map-point-config
pnpm add map-point-config
yarn add map-point-config
bun add map-point-config
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2023-01-13 |
| First published | 2022-12-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 4 |
| Unpacked size | 4.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | zhenxing |
| Maintainers | zhenxing1999 |

## Links

- npm: https://www.npmjs.com/package/map-point-config
- npm.io page: https://npm.io/package/map-point-config

## Dependencies (4)

- [antd](https://npm.io/package/antd.md) ^4.24.6
- [axios](https://npm.io/package/axios.md) ^1.1.2
- [react-ol-map](https://npm.io/package/react-ol-map.md) ^0.1.8
- [pages-loading](https://npm.io/package/pages-loading.md) ^2.0.0

## Recent versions

- 0.0.9 (latest) — 2023-01-13
- 0.0.8 — 2023-01-13
- 0.0.7 — 2022-12-27
- 0.0.6 — 2022-12-27
- 0.0.5 — 2022-12-27
- 0.0.4 — 2022-12-27
- 0.0.3 — 2022-12-27
- 0.0.2 — 2022-12-27
- 0.0.1 — 2022-12-27

## README

# 安装依赖

npm i --save map-point-config

需手动导入 inputNumber 样式 在全局 less 文件中
@import '~antd/es/input-number/style/index.less';

```javascript
import MapPointConfig from 'map-point-config';

// 详情
<MapPointConfig mode="DETAIL" value={pointLngLat} />
//
  /**
   * 表单提交
   * @param 提交的数据
   * @description 处理数据注意接口约束
   */
  const handleOk = useDebounceFn(async () => {
    const info: CurrentItem & { machineType?: any, plantPicture?: any, oid?: any } & Record<string, any> = await form?.validateFields();

    info.lng = info?.lnglat?.[0];
    info.lat = info?.lnglat?.[1];
    delete info?.lnglat;

    onOk({
      ...info!,
    });
  });

  /** 基础信息 */
  const formViewProps1: FormViewProps = {
    onCancel: modalProps?.onCancel,
    footerVisible: false,
    type: 2,
    list: [
      {
        label: '经纬度',
        name: 'lnglat',
        view: <MapPointConfig keepDecimalNum={6} onChange={(info) => {
          form?.setFieldsValue({
            lnglat: info,
            address: info?.[2],
          })
        }} />
      },
    ],
  }

  // 回显
  return (
    <Form form={form} onFinish={handleOk} initialValues={{
      lnglat: currentItem?.lng && currentItem?.lat ? [currentItem?.lng, currentItem?.lat, currentItem?.address] : defaultPoint,
    }}>
      <FormView {...formViewProps1} />
    </Form>
  )
```

---
_Source: https://npm.io/package/map-point-config · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
