createVectorTilePoints.js 1.8 KB

1234567891011121314151617181920212223
  1. /**
  2. * Cesium - https://github.com/CesiumGS/cesium
  3. *
  4. * Copyright 2011-2020 Cesium Contributors
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. *
  18. * Columbus View (Pat. Pend.)
  19. *
  20. * Portions licensed separately.
  21. * See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
  22. */
  23. define(["./when-8d13db60","./Check-70bec281","./Math-61ede240","./Cartographic-f27b0939","./Cartesian2-09435a6c","./AttributeCompression-75ce15eb","./createTaskProcessorWorker"],function(a,e,v,y,A,M,r){var R=32767,x=new y.Cartographic,D=new y.Cartesian3,E=new A.Rectangle,F=new A.Ellipsoid,T={min:void 0,max:void 0};return r(function(a,e){var r=new Uint16Array(a.positions);!function(a){a=new Float64Array(a);var e=0;T.min=a[e++],T.max=a[e++],A.Rectangle.unpack(a,e,E),e+=A.Rectangle.packedLength,A.Ellipsoid.unpack(a,e,F)}(a.packedBuffer);var t=E,n=F,i=T.min,o=T.max,s=r.length/3,c=r.subarray(0,s),u=r.subarray(s,2*s),p=r.subarray(2*s,3*s);M.AttributeCompression.zigZagDeltaDecode(c,u,p);for(var h=new Float64Array(r.length),l=0;l<s;++l){var f=c[l],C=u[l],d=p[l],g=v.CesiumMath.lerp(t.west,t.east,f/R),m=v.CesiumMath.lerp(t.south,t.north,C/R),b=v.CesiumMath.lerp(i,o,d/R),w=y.Cartographic.fromRadians(g,m,b,x),k=n.cartographicToCartesian(w,D);y.Cartesian3.pack(k,h,3*l)}return e.push(h.buffer),{positions:h.buffer}})});