Commit dc9a5488 authored by 田翔's avatar 田翔

fix: 地图值修改为按钮

parent 3ef4d574
import React, { useState, useRef } from 'react'
import React, { useState, useRef, useMemo } from 'react'
import styles from './index.less'
import { Button } from 'antd'
import {
ArcGISSceneMap,
ClickQuery,
......@@ -10,11 +11,11 @@ import {
SimpleLineSymbol,
SimpleFillSymbol,
} from '@wisdom-map/arcgismap/lib'
import { CompassOutlined } from '@ant-design/icons'
import Drag from '../../../../../components/Drag'
import { isJson } from '../../../../../../utils/index'
import point from '../../../../../../assets/images/cood/point.png'
let geometrystr = ''
let gisInfo = {}
let layer = 0
......@@ -27,6 +28,16 @@ const CoordView = (props) => {
let clickref = useRef(null)
let view = useRef(null)
const btnText = useMemo(() => {
switch (widget) {
case 'Coordinate': return '查看位置'
case 'Device': return '查看设备'
case 'DrawPath': return '查看路径'
case 'DrawArea': return '查看区域'
default: return
}
}, [widget])
const getMapInfo = (mapObj, Map) => {
setTimeout(() => {
if (widget === 'Device') {
......@@ -145,7 +156,17 @@ const CoordView = (props) => {
return (
<div className={styles.coordView}>
<span onClick={() => setVisible(true)}>{value}</span>
{
value ? (
<Button
size='small'
icon={<CompassOutlined />}
onClick={() => setVisible(true)}
>
{btnText}
</Button>
) : null
}
<Drag
visible={visible}
title={title}
......
.coordView {
display: flex;
justify-content: center;
align-items: center;
&:hover {
cursor: pointer;
color: #1890ff;
......
......@@ -106,7 +106,7 @@ const DrawArea = (props) => {
<Input
disabled={disabled}
placeholder={placeholder}
value={value}
value={isJson(value) ? '已绘制' : ''}
addonAfter={disabled ? null : <CompassOutlined style={{ color: 'rgba(0, 0, 0, 0.25)' }} onClick={showMap} />}
style={{ width: '100%' }}
onClick={showMap}
......
......@@ -105,7 +105,7 @@ const DrawPath = (props) => {
<Input
disabled={disabled}
placeholder={placeholder}
value={value}
value={isJson(value) ? '已绘制' : ''}
addonAfter={disabled ? null : <CompassOutlined style={{ color: 'rgba(0, 0, 0, 0.25)' }} onClick={showMap} />}
style={{ width: '100%' }}
onClick={showMap}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment