const query = async (options: ClickQuerylistConfig[], geometoey: any) => { if (views) { message.destroy(); message.loading('查询中,请稍后', 0); const result = await queryMap(views, options, geometoey); const arr: any[] = []; if (result && result.length) { const data: IdentifyResult[] = []; const areasAndLengthParams = new AreasAndLengthsParameters({ areaUnit: 'square-meters', lengthUnit: 'meters', polygons: [geometoey], }); let total = 0; //图形面积 const totalRes = await geometryService.areasAndLengths(window.geometryServer1, areasAndLengthParams); if (totalRes && totalRes.areas && totalRes.areas.length) { total = totalRes.areas[0]; } const metorys: any[] = []; result.forEach(item => { item.results.forEach((c: any) => { const { feature, layerName } = c; const { geometry, attributes } = feature; attributes.layerName = layerName; const intersecting = geometryEngine.intersect(geometry, geometoey) as any; const symbol = symbolIcon.polygon; const graphic = new Graphic({ geometry: intersecting, symbol, attributes, }); metorys.push(intersecting); arr.push(attributes); ydfxLayer.current.add(graphic); data.push(c); }); }); const areasAndLengthParams1 = new AreasAndLengthsParameters({ areaUnit: 'square-meters', lengthUnit: 'meters', polygons: metorys, }); const metoryArea = await geometryService.areasAndLengths(window.geometryServer1, areasAndLengthParams1); if (metoryArea && metoryArea.areas && metoryArea.areas.length) { const area = metoryArea.areas; arr.forEach((item, index) => { const currentArea = area[index]; if (currentArea) { item.interArea = currentArea; item.totalArea = total; } }); } setYdfxData(arr); } else { message.destroy(); message.warning('暂无数据'); setYdfxData(null); } message.destroy(); } };
正文
arcgis api裁剪与面积测量
文章版权声明:除非注明,否则均为
譬如朝露博客原创文章,转载或复制请以超链接形式并注明出处。
发表评论
侧栏公告
寄语
譬如朝露博客是一个分享前端知识的网站,联系方式11523518。
热评文章
标签列表
热门文章
友情链接