qa-regulatory-gwj-vue/static/map/cesium91/CesiumUnminified/Workers/PolygonBuffer.js

2 lines
595 B
JavaScript
Raw Permalink Normal View History

2023-11-07 10:04:37 +08:00
define(["./turf.min","./Cartesian3-e0307675","./Check-741c5f3c","./defaultValue-81eec7ed","./Math-e73894ab"],(function(e,t,r,o,n){"use strict";class l{static buffer(t,r){for(let o in t){t[o].map((t=>{for(let o=0;o<t.geometrys.length;o++){if(t.geometrys[o].length<8)continue;let n=l.convertGeometory(t.geometrys[o]),s=e.polygon(n),f=e.buffer(s,r,{units:"kilometers"});t.geometrys[o]=f.geometry.coordinates[0].flat()}}))}}static convertGeometory(e){e[0]==e[e.length-2]&&e[1]==e[e.length-1]||e.push(e[0],e[1]);let t=[];for(let r=0;r<e.length;r+=2)e[r],t.push([e[r],e[r+1]]);return[t]}}return l}));