@mapgis/webclient-cesium-plugin 17.2.1 → 17.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -636,13 +636,50 @@
636
636
  <p class="code-caption"><h7>添加一个MapGIS瓦片服务:原生接口</h7></p>
637
637
 
638
638
 
639
- <pre class="prettyprint"><code>// ES5引入方式
640
639
  const provider = await MapGISTileServerImageryProvider.fromUrl(url)
641
640
  viewer.imageryLayers.addImageryProvider(provider)
641
+ <pre class="prettyprint"><code>// ES5引入方式
642
+ const { MapGISTileServerImageryProvider } = zondy
643
+ // ES6引入方式
644
+ import { MapGISTileServerImageryProvider } from "@mapgis/webclient-cesium-plugin"
645
+
646
+ // 定义瓦片地图服务的基地址
647
+ const url = 'http://webclient.smaryun.com:8089/igs/rest/services/Tile/%E6%AD%A6%E6%B1%89%E5%B8%82_4547_custom_1-10/TileServer'
648
+
649
+ // 加载IGS二维瓦片地图服务
650
+ async function addTileLayer() {
651
+ const provider = await MapGISTileServerImageryProvider.fromUrl(url)
652
+ viewer.imageryLayers.addImageryProvider(provider)
653
+ }
654
+
655
+ //添加栅格图层
656
+ addTileLayer()</code></pre>
642
657
 
643
658
 
644
659
  <p class="code-caption"><h7>添加一个MapGIS瓦片服务:混合接口</h7></p>
645
660
 
646
661
 
647
- <pre class="prettyprint"><code>// ES5引入方式
648
662
  // 获取provider的初始化参数
649
663
  const options = initializeOptions(layer, viewer)
650
664
  // 构造provider对象
651
665
  provider = new MapGISTileServerImageryProvider(options)
652
666
  // 添加图层到Cesium视图中
653
667
  cesiumLayer = viewer.imageryLayers.addImageryProvider(provider)
668
+ <pre class="prettyprint"><code>// ES5引入方式
669
+ const { MapGISTileServerImageryProvider } = zondy
670
+ const { IGSTileLayer } = zondy.Layer
671
+ const { initializeOptions } = zondy.cesium.util
672
+ // ES6引入方式
673
+ import { initializeOptions, MapGISTileServerImageryProvider } from "@mapgis/webclient-cesium-plugin"
674
+ import { IGSTileLayer } from "@mapgis/webclient-common"
675
+
676
+ // 定义瓦片地图服务的基地址
677
+ const url = 'http://webclient.smaryun.com:8089/igs/rest/services/Tile/%E6%AD%A6%E6%B1%89%E5%B8%82_4547_custom_1-10/TileServer'
678
+
679
+ // 创建瓦片地图图层对象
680
+ const igsTileLayer = new IGSTileLayer({ url })
681
+
682
+ // 获取瓦片图层服务的元信息
683
+ igsTileLayer.load().then((layer) => {
684
+ // 获取provider的初始化参数
685
+ const options = initializeOptions(layer, viewer)
686
+ // 构造provider对象
687
+ provider = new MapGISTileServerImageryProvider(options)
688
+ // 添加图层到Cesium视图中
689
+ cesiumLayer = viewer.imageryLayers.addImageryProvider(provider)
690
+ })</code></pre>
654
691
 
655
692
 
656
693