如何更新所有项目的坐标而又不从图层中删除项目并重新渲染?

问题描述 投票:0回答:1

我正在将CAD工程图转换为arcGis,我需要缩放(仿射变换)地图上的图层。是否可以通过编程方式重写节点的坐标而无需重新渲染?

类似这样的东西(伪代码):

stateGraphicsLayer.graphics.items.forEach(item => item.geometry.path = newPath)
javascript arcgis
1个回答
0
投票

是,可以在javascript中更新数组

使用数组映射

例如enter link description here

const array1 = [path:{..},path:{..}];  //lets assume its your array variable 

// pass a function to map
const map1 = array1.map(path => newPath);

console.log(map1);
© www.soinside.com 2019 - 2024. All rights reserved.