parent
4bc3b5c80f
commit
9f3bf572fd
|
|
@ -20,19 +20,14 @@ export default function usePeoplePosition(mapMethods, currentBranchOffice, portA
|
||||||
const peopleList = Array.isArray(data) ? data : [data];
|
const peopleList = Array.isArray(data) ? data : [data];
|
||||||
for (let i = 0; i < peopleList.length; i++) {
|
for (let i = 0; i < peopleList.length; i++) {
|
||||||
const item = peopleList[i];
|
const item = peopleList[i];
|
||||||
if (!item?.locationRawJson)
|
|
||||||
continue;
|
|
||||||
const location = JSON.parse(item.locationRawJson).position;
|
|
||||||
if (!location || !location.lon || !location.lat)
|
|
||||||
continue;
|
|
||||||
const id = item.terminalNo || item.staffNo;
|
const id = item.terminalNo || item.staffNo;
|
||||||
if (!id)
|
if (!id)
|
||||||
continue;
|
continue;
|
||||||
const index = points.current.findIndex(
|
const index = points.current.findIndex(
|
||||||
item1 => item1.id.toString() === id.toString(),
|
item1 => item1.id.toString() === id.toString(),
|
||||||
);
|
);
|
||||||
const x = location.lon;
|
const x = item.lon;
|
||||||
const y = location.lat;
|
const y = item.lat;
|
||||||
// 封闭区域模式只保留围栏内人员;人员离开围栏后立即移除已有点位。
|
// 封闭区域模式只保留围栏内人员;人员离开围栏后立即移除已有点位。
|
||||||
if (filterAreas.current.length > 0 && !isPointInAreas(filterAreas.current, x, y)) {
|
if (filterAreas.current.length > 0 && !isPointInAreas(filterAreas.current, x, y)) {
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue