Commit 1e1c53b3 authored by 田翔's avatar 田翔

fix: 搜索位置选择选中

parent 3362a8e5
{
"name": "panda-xform",
"version": "6.7.6",
"description": "6.7.6 区域任务列表实现照片预览",
"version": "6.7.8",
"description": "6.7.8 搜索位置选择选中",
"keywords": [
"panda-xform"
],
......
......@@ -11,7 +11,7 @@ import {
geomUtils,
} from '@wisdom-map/arcgismap'
import Drag from '../../../components/Drag'
import { isJson, isObject, mercatorToLngLat } from '../../../../utils'
import { isJson, isObject, mercatorToLngLat, lngmkt } from '../../../../utils'
import { getLocation, getLocationV5, GetAreaNameByCoordinate, placeAroundRelay } from '../../../../apis/process'
import styles from './index.less'
......@@ -83,9 +83,7 @@ const Coordinate = (props) => {
if (coordGetLayer) {
viewObject.map.remove(coordGetLayer);
} else {
coordGetLayer = new GraphicsLayer({
id: 'coordGet',
});
coordGetLayer = new GraphicsLayer({ id: 'coordGet' })
}
viewObject.map.add(coordGetLayer);
if (value) {
......@@ -217,6 +215,16 @@ const Coordinate = (props) => {
}
}
const callback = (value) => {
console.log('value', value)
if (value.location && view) {
let array = value.location.split(',')
let point = lngmkt({ lng: Number(array[0]), lat: Number(array[1]) })
console.log('point', point)
onChange(`${point.x},${point.y}`)
}
}
useEffect(() => {
if (value) {
let _temp = value && value.split(',') || []
......@@ -353,7 +361,7 @@ const Coordinate = (props) => {
/>
{
view ? <div style={{ width: '400px', position: 'absolute', right: '0', top: '25px' }}>
<AutoCompleteSearch areaName={getCityName()} view={view} />
<AutoCompleteSearch areaName={getCityName()} view={view} callback={callback} />
</div> : ''
}
</div>
......
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