美文网首页
SuperMap iClient3D for WebGL教程-对

SuperMap iClient3D for WebGL教程-对

作者: 为梦齐舞 | 来源:发表于2020-01-14 22:14 被阅读0次

今天遇到客户希望使用WebGL对接ImageServer,但是Cesium底层并未提供该ImageryProvider,所以只能使用UrlTemplateImageryProvider进行自定义对接
总结对接ImageServer时服务分为两种:1、WebMercator坐标、2、经纬度坐标
WebMercator坐标对接如下:

new Cesium.UrlTemplateImageryProvider({    
      url: 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer/exportImage?bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&size={width}%2C{height}&f=image'  
     })

注意后面这段:?bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&size={width}%2C{height}&f=image
写的可都是Projected哦
如果使用的经纬度坐标,理所当然则需要改为Degrees,
so
WGS84坐标对接如下:

new Cesium.UrlTemplateImageryProvider({    
      url: '.../ImageServer/exportImage?bbox={westDegrees}%2C{southDegrees}%2C{eastDegrees}%2C{northDegrees}&size={width}%2C{height}&f=image'  
     })

相关文章

网友评论

      本文标题:SuperMap iClient3D for WebGL教程-对

      本文链接:https://www.haomeiwen.com/subject/mzczactx.html