@mapgis/webclient-mapboxgl-plugin 17.4.0 → 17.6.0

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.
@@ -104,7 +104,8 @@
104
104
 
105
105
  <nav>
106
106
 
107
- <div class="category"><div style="font-weight: bold;vertical-align: middle;padding: 0.4rem 0;" class="mapgis-menu-span"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/m.png" alt="">视图模块</div><ul class="mapgis-sidebar-menus"><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="MapView"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="MapView.html">MapView</a><span style="display: none;"><p>二维场景视图(mapboxgl引擎),对地图引擎进行管理,如果要对地图图层进行管理请参考<code>Map</code>,<br/>
107
+ <div class="category"><div style="font-weight: bold;vertical-align: middle;padding: 0.4rem 0;" class="mapgis-menu-span"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/m.png" alt="">扩展模块</div><ul class="mapgis-sidebar-menus"><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="initializeOptions"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="initializeOptions.html">initializeOptions</a><span style="display: none;"><p>根据图层获取对应的mapboxgl内的sources和layers</p></span></li></ul><div style="font-weight: bold;vertical-align: middle;padding: 0.4rem 0;" class="mapgis-menu-span"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/m.png" alt="">视图模块</div><ul class="mapgis-sidebar-menus"><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="MapView"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="MapView.html">MapView</a><span style="display: none;"><p>二维场景视图(mapboxgl引擎),对地图引擎进行管理,如果要对地图图层进行管理请参考<code>Map</code>,<br/>
108
+ 继承自<a href='http://webclient.smaryun.com/static/modules/common/api/common-mapgis/MapView.html' target='_blank'>zondy.MapView</a><br/>
108
109
  参考示例:
109
110
  <a href='#MapView'>[初始化二维场景视图]</a>
110
111
  <br>[ES5引入方式]:<br/>
@@ -116,11 +117,12 @@ import { MapView } from '@mapgis/webclient-mapboxgl-plugin' <br/></p></span></li
116
117
  [ES6引入方式]:<br/>
117
118
  import { Popup } from '@mapgis/webclient-mapboxgl-plugin' <br/>
118
119
  自定义样式说明:<br/>
119
- zondy-popup__content 弹窗容器样式<br/>
120
+ zondy-popup__container 弹窗容器样式<br/>
120
121
  zondy-popup__tip 弹窗对话框箭头样式<br/>
121
122
  zondy-popup__header 弹窗头部样式<br/>
122
123
  zondy-popup__content 弹窗主体样式<br/>
123
- zondy-popup__footer 弹窗底部样式<br/></p></span></li><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="Screenshot"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="Screenshot.html">Screenshot</a><span style="display: none;"><p>打印工具</p></span></li></ul><div style="font-weight: bold;vertical-align: middle;padding: 0.4rem 0;" class="mapgis-menu-span"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/m.png" alt="">草图编辑模块</div><ul class="mapgis-sidebar-menus"><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="SketchEditorMapboxgl"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="SketchEditorMapboxgl.html">SketchEditorMapboxgl</a><span style="display: none;"><p>二维Mapboxgl引擎草图编辑类<br/>
124
+ zondy-popup__footer 弹窗底部样式<br/></p></span></li><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="Screenshot"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="Screenshot.html">Screenshot</a><span style="display: none;"><p>打印工具</p></span></li></ul><div style="font-weight: bold;vertical-align: middle;padding: 0.4rem 0;" class="mapgis-menu-span"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/m.png" alt="">草图编辑模块</div><ul class="mapgis-sidebar-menus"><li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="SketchEditor"><img style="width: 20px;margin-right: 6px;vertical-align: middle;" src="./styles/c.png" alt=""><a href="SketchEditor.html">SketchEditor</a><span style="display: none;"><p>二维Mapboxgl引擎草图编辑类<br/>
125
+ 继承自<a href='http://webclient.smaryun.com/static/modules/common/api/common-mapgis/SketchEditor.html' target='_blank'>zondy.SketchEditor</a><br/>
124
126
  <br>[ES5引入方式]:<br/>
125
127
  const { SketchEditor } = zondy.mapboxgl.tool.sketch <br/>
126
128
  [ES6引入方式]:<br/>
@@ -166,6 +168,7 @@ import { SketchEditor } from &quot;@mapgis/webclient-leaflet-plugin&quot; <br/><
166
168
 
167
169
  <div class="description">
168
170
  <p>二维场景视图(mapboxgl引擎),对地图引擎进行管理,如果要对地图图层进行管理请参考<code>Map</code>,<br/>
171
+ 继承自<a href='http://webclient.smaryun.com/static/modules/common/api/common-mapgis/MapView.html' target='_blank'>zondy.MapView</a><br/>
169
172
  参考示例:
170
173
  <a href='#MapView'>[初始化二维场景视图]</a>
171
174
  <br>[ES5引入方式]:<br/>
@@ -285,6 +288,32 @@ import { MapView } from '@mapgis/webclient-mapboxgl-plugin' <br/></p>
285
288
 
286
289
 
287
290
 
291
+ <tr class="deep-level-1">
292
+
293
+ <td class="name"><code>spatialReference</code></td>
294
+
295
+
296
+ <td class="type">
297
+
298
+
299
+ <span class="param-type">SpatialReference</span>
300
+
301
+
302
+
303
+ </td>
304
+
305
+
306
+ <td class="default">
307
+
308
+ </td>
309
+
310
+
311
+ <td class="description last"><p>视图空间参考系</p></td>
312
+ </tr>
313
+
314
+
315
+
316
+
288
317
  <tr class="deep-level-1">
289
318
 
290
319
  <td class="name"><code>zoom</code></td>
@@ -333,7 +362,7 @@ import { MapView } from '@mapgis/webclient-mapboxgl-plugin' <br/></p>
333
362
  </td>
334
363
 
335
364
 
336
- <td class="description last"><p>地图视图中心点</p></td>
365
+ <td class="description last"><p>地图视图中心点。如果有中心点,看是否存在zoom/scale,使用center和zoom/scale定位(同时设置scale和zoom时,scale优先于zoom),否则默认zoom为到第0级。如果没有设置center,但设置了extent,则以extent定位。</p></td>
337
366
  </tr>
338
367
 
339
368
 
@@ -359,7 +388,7 @@ import { MapView } from '@mapgis/webclient-mapboxgl-plugin' <br/></p>
359
388
  </td>
360
389
 
361
390
 
362
- <td class="description last"><p>地图视图可视范围</p></td>
391
+ <td class="description last"><p>地图视图初始所在的范围。如果没有设置center,但设置extent了,则地图视图定位到extent范围内。</p></td>
363
392
  </tr>
364
393
 
365
394
 
@@ -411,7 +440,7 @@ import { MapView } from '@mapgis/webclient-mapboxgl-plugin' <br/></p>
411
440
  </td>
412
441
 
413
442
 
414
- <td class="description last"><p>地图视图的最大比例尺(比例尺的分母,该值越小,比例尺越大)。视图的当前比列尺不会大于地图视图的最大比例尺。默认值为undefined,undefined表示用户未设置,视图的最大比例尺不受限制。maxScale的值应该始终小于minScale的值。</p></td>
443
+ <td class="description last"><p>地图视图的最大比例尺(比例尺的分母,该值越小,比例尺越大)。视图的当前比列尺不会大于地图视图的最大比例尺。默认值为undefined,undefined表示用户未设置,地图视图会根据当前加载的图层,自动计算maxScale、minScale的值。如果用户设置了该值,则地图视图将直接采用用户设置的值。maxScale的值应该始终小于minScale的值。</p></td>
415
444
  </tr>
416
445
 
417
446
 
@@ -437,7 +466,59 @@ import { MapView } from '@mapgis/webclient-mapboxgl-plugin' <br/></p>
437
466
  </td>
438
467
 
439
468
 
440
- <td class="description last"><p>地图视图的最小比例尺(比例尺的分母,该值越大,比例尺越小)。视图的当前比列尺不会小于地图视图的最小比例尺。默认值为undefined,undefined表示用户未设置,地图视图会根据全图范围,计算视图的最小比例尺。如果用户设置了该值,则地图将直接采用用户设置的值。minScale的值应该始终大于maxScale的值。</p></td>
469
+ <td class="description last"><p>地图视图的最小比例尺(比例尺的分母,该值越大,比例尺越小)。视图的当前比列尺不会小于地图视图的最小比例尺。默认值为undefined,undefined表示用户未设置,地图视图会根据当前加载的图层,自动计算maxScale、minScale的值。如果用户设置了该值,则地图视图将直接采用用户设置的值。minScale的值应该始终大于maxScale的值。</p></td>
470
+ </tr>
471
+
472
+
473
+
474
+
475
+ <tr class="deep-level-1">
476
+
477
+ <td class="name"><code>maxZoom</code></td>
478
+
479
+
480
+ <td class="type">
481
+
482
+
483
+ <span class="param-type">Number</span>
484
+
485
+
486
+
487
+ </td>
488
+
489
+
490
+ <td class="default">
491
+
492
+ </td>
493
+
494
+
495
+ <td class="description last"><p>最大缩放级数 。优先级低于maxScale</p></td>
496
+ </tr>
497
+
498
+
499
+
500
+
501
+ <tr class="deep-level-1">
502
+
503
+ <td class="name"><code>minZoom</code></td>
504
+
505
+
506
+ <td class="type">
507
+
508
+
509
+ <span class="param-type">Number</span>
510
+
511
+
512
+
513
+ </td>
514
+
515
+
516
+ <td class="default">
517
+
518
+ </td>
519
+
520
+
521
+ <td class="description last"><p>最小缩放级数。优先级低于minScale</p></td>
441
522
  </tr>
442
523
 
443
524
 
@@ -468,6 +549,32 @@ import { MapView } from '@mapgis/webclient-mapboxgl-plugin' <br/></p>
468
549
 
469
550
 
470
551
 
552
+
553
+ <tr class="deep-level-1">
554
+
555
+ <td class="name"><code>fullExtent</code></td>
556
+
557
+
558
+ <td class="type">
559
+
560
+
561
+ <span class="param-type">Number</span>
562
+
563
+
564
+
565
+ </td>
566
+
567
+
568
+ <td class="default">
569
+
570
+ </td>
571
+
572
+
573
+ <td class="description last"><p>地图视图最大显示范围。用户不设置时,将地图范围作为地图视图的最大显示范围,用户设置时采用用户设置的。地图视图初始化时,会根据此范围计算地图视图的最小比例尺,当瓦片数据的最大比例尺小于此比例尺时,无法显示。在相同视图大小下,fullExtent越大,地图视图的最小比例尺越小。</p></td>
574
+ </tr>
575
+
576
+
577
+
471
578
 
472
579
 
473
580
 
@@ -603,7 +710,8 @@ import { MapView } from '@mapgis/webclient-mapboxgl-plugin' <br/></p>
603
710
  const { Map } = zondy
604
711
  const { MapView } = zondy.mapboxgl
605
712
  // ES6引入方式
606
- import { Map, MapView } from "@mapgis/webclient-mapboxgl-plugin"
713
+ import { Map } from "@mapgis/webclient-common"
714
+ import { MapView } from "@mapgis/webclient-mapboxgl-plugin"
607
715
  // 初始化图层管理容器
608
716
  const map = new Map();
609
717
  // 初始化地图视图对象
@@ -631,7 +739,7 @@ const mapView = new MapView({
631
739
 
632
740
 
633
741
  <ul>
634
- <li>Evented</li>
742
+ <li>zondy.MapViewBase</li>
635
743
  </ul>
636
744
 
637
745
 
@@ -657,80 +765,6 @@ const mapView = new MapView({
657
765
  <span class="method-parameter is-pulled-right">
658
766
  <label>类型:</label>
659
767
 
660
- <span class="param-type">SpatialReference</span>
661
-
662
-
663
- </span>
664
-
665
- <h4 class="name" id="_spatialReference">
666
- <a class="href-link" href="#_spatialReference">#</a>
667
-
668
-
669
- <span class='tag'>readonly</span>
670
-
671
-
672
- <span class="code-name">
673
- _spatialReference
674
- </span>
675
-
676
- </h4>
677
-
678
-
679
-
680
-
681
- <div class="description">
682
- <p>视图空间参考系</p>
683
- </div>
684
-
685
-
686
-
687
-
688
-
689
- <dl class="details">
690
-
691
-
692
-
693
-
694
-
695
-
696
-
697
-
698
-
699
-
700
-
701
-
702
-
703
-
704
-
705
-
706
-
707
-
708
-
709
-
710
-
711
-
712
-
713
-
714
-
715
-
716
-
717
-
718
-
719
-
720
-
721
- </dl>
722
-
723
-
724
-
725
-
726
-
727
- </div>
728
-
729
- <div class="member">
730
-
731
- <span class="method-parameter is-pulled-right">
732
- <label>类型:</label>
733
-
734
768
  <span class="param-type">Point</span>
735
769
 
736
770
 
@@ -801,7 +835,7 @@ const mapView = new MapView({
801
835
  <span class="method-parameter is-pulled-right">
802
836
  <label>类型:</label>
803
837
 
804
- <span class="param-type">Object</span>
838
+ <span class="param-type">EngineType</span>
805
839
 
806
840
 
807
841
  </span>
@@ -1107,7 +1141,7 @@ const mapView = new MapView({
1107
1141
 
1108
1142
 
1109
1143
  <div class="description">
1110
- <p>地图视图最大比例尺</p>
1144
+ <p>地图视图的最大比例尺(比例尺的分母,该值越小,比例尺越大)。视图的当前比列尺不会大于地图视图的最大比例尺。默认值为undefined,undefined表示用户未设置,地图视图会根据当前加载的图层,自动计算maxScale、minScale的值。如果用户设置了该值,则地图视图将直接采用用户设置的值。maxScale的值应该始终小于minScale的值。</p>
1111
1145
  </div>
1112
1146
 
1113
1147
 
@@ -1177,7 +1211,7 @@ const mapView = new MapView({
1177
1211
 
1178
1212
 
1179
1213
  <div class="description">
1180
- <p>地图视图最小比例尺</p>
1214
+ <p>地图视图的最小比例尺(比例尺的分母,该值越大,比例尺越小)。视图的当前比列尺不会小于地图视图的最小比例尺。默认值为undefined,undefined表示用户未设置,地图视图会根据当前加载的图层,自动计算maxScale、minScale的值。如果用户设置了该值,则地图视图将直接采用用户设置的值。minScale的值应该始终大于maxScale的值。</p>
1181
1215
  </div>
1182
1216
 
1183
1217
 
@@ -1657,6 +1691,2656 @@ const mapView = new MapView({
1657
1691
 
1658
1692
 
1659
1693
 
1694
+ <div class='vertical-section'>
1695
+ <h3 id='function'>方法</h3>
1696
+ <div class="members">
1697
+
1698
+ <div class="member">
1699
+
1700
+
1701
+
1702
+ <h4 class="name" id=".fromJSON">
1703
+ <a class="href-link" href="#.fromJSON">#</a>
1704
+
1705
+
1706
+ <span class='tag'>static</span>
1707
+
1708
+
1709
+ <span class="code-name" style="font-size:30px">
1710
+
1711
+ fromJSON<span class="signature">(json)</span>
1712
+
1713
+ </span>
1714
+ </h4>
1715
+
1716
+
1717
+
1718
+ <div class="description">
1719
+ <p><a id='fromJSON'></a>
1720
+ 通过一个配置生成一个场景视图对象</p>
1721
+ </div>
1722
+
1723
+
1724
+
1725
+
1726
+
1727
+
1728
+
1729
+
1730
+
1731
+
1732
+ <h4>参数:</h4>
1733
+
1734
+ <div class="table-container">
1735
+ <table class="params table">
1736
+ <thead>
1737
+ <tr>
1738
+
1739
+ <th>名称</th>
1740
+
1741
+
1742
+ <th>类型</th>
1743
+
1744
+
1745
+
1746
+ <th class="last">描述</th>
1747
+ </tr>
1748
+ </thead>
1749
+
1750
+ <tbody>
1751
+
1752
+
1753
+
1754
+ <tr class="deep-level-0">
1755
+
1756
+ <td class="name"><code>json</code></td>
1757
+
1758
+
1759
+ <td class="type">
1760
+
1761
+
1762
+ <span class="param-type">Object</span>
1763
+
1764
+
1765
+
1766
+ </td>
1767
+
1768
+
1769
+
1770
+ <td class="description last"><p>场景视图配置</p></td>
1771
+ </tr>
1772
+
1773
+
1774
+
1775
+
1776
+ </tbody>
1777
+ </table>
1778
+ </div>
1779
+
1780
+
1781
+
1782
+
1783
+
1784
+
1785
+ <dl class="details">
1786
+
1787
+
1788
+
1789
+
1790
+
1791
+
1792
+
1793
+
1794
+
1795
+
1796
+
1797
+
1798
+
1799
+
1800
+
1801
+
1802
+
1803
+
1804
+
1805
+
1806
+
1807
+
1808
+
1809
+
1810
+
1811
+
1812
+
1813
+
1814
+
1815
+
1816
+
1817
+ </dl>
1818
+
1819
+
1820
+
1821
+
1822
+
1823
+
1824
+
1825
+
1826
+
1827
+
1828
+
1829
+
1830
+
1831
+
1832
+
1833
+
1834
+
1835
+
1836
+ <div class='columns method-parameter'>
1837
+ <div class="column is-2"><label>返回值:</label></div>
1838
+ <div class="column is-10">
1839
+
1840
+
1841
+
1842
+ <div class="columns">
1843
+
1844
+
1845
+ <div class='column is-5 has-text-left'>
1846
+ <label>类型: </label>
1847
+
1848
+ <span class="param-type"><a href="MapView.html">MapView</a></span>
1849
+
1850
+
1851
+ </div>
1852
+
1853
+ </div>
1854
+
1855
+
1856
+ </div>
1857
+ </div>
1858
+
1859
+
1860
+
1861
+
1862
+
1863
+
1864
+ </div>
1865
+
1866
+ <div class="member">
1867
+
1868
+
1869
+
1870
+ <h4 class="name" id="flyTo">
1871
+ <a class="href-link" href="#flyTo">#</a>
1872
+
1873
+ <span class="code-name" style="font-size:30px">
1874
+
1875
+ flyTo<span class="signature">(options)</span>
1876
+
1877
+ </span>
1878
+ </h4>
1879
+
1880
+
1881
+
1882
+ <div class="description">
1883
+ <p>视点跳转</a></p>
1884
+ </div>
1885
+
1886
+
1887
+
1888
+
1889
+
1890
+
1891
+
1892
+
1893
+
1894
+
1895
+ <h4>参数:</h4>
1896
+
1897
+ <div class="table-container">
1898
+ <table class="params table">
1899
+ <thead>
1900
+ <tr>
1901
+
1902
+ <th>名称</th>
1903
+
1904
+
1905
+ <th>类型</th>
1906
+
1907
+
1908
+
1909
+ <th class="last">描述</th>
1910
+ </tr>
1911
+ </thead>
1912
+
1913
+ <tbody>
1914
+
1915
+
1916
+
1917
+ <tr class="deep-level-0">
1918
+
1919
+ <td class="name"><code>options</code></td>
1920
+
1921
+
1922
+ <td class="type">
1923
+
1924
+ </td>
1925
+
1926
+
1927
+
1928
+ <td class="description last"><p>跳转参数</p></td>
1929
+ </tr>
1930
+
1931
+
1932
+
1933
+
1934
+ <tr class="deep-level-1">
1935
+
1936
+ <td class="name"><code>center</code></td>
1937
+
1938
+
1939
+ <td class="type">
1940
+
1941
+
1942
+ <span class="param-type">Array</span>
1943
+
1944
+
1945
+
1946
+ </td>
1947
+
1948
+
1949
+
1950
+ <td class="description last"><p>跳转中心点</p></td>
1951
+ </tr>
1952
+
1953
+
1954
+
1955
+
1956
+ <tr class="deep-level-1">
1957
+
1958
+ <td class="name"><code>zoom</code></td>
1959
+
1960
+
1961
+ <td class="type">
1962
+
1963
+
1964
+ <span class="param-type">Number</span>
1965
+
1966
+
1967
+
1968
+ </td>
1969
+
1970
+
1971
+
1972
+ <td class="description last"><p>地图层级</p></td>
1973
+ </tr>
1974
+
1975
+
1976
+
1977
+
1978
+ <tr class="deep-level-1">
1979
+
1980
+ <td class="name"><code>extent</code></td>
1981
+
1982
+
1983
+ <td class="type">
1984
+
1985
+
1986
+ <span class="param-type">Extent</span>
1987
+
1988
+
1989
+
1990
+ </td>
1991
+
1992
+
1993
+
1994
+ <td class="description last"><p>按范围跳转</p></td>
1995
+ </tr>
1996
+
1997
+
1998
+
1999
+
2000
+
2001
+
2002
+
2003
+ </tbody>
2004
+ </table>
2005
+ </div>
2006
+
2007
+
2008
+
2009
+
2010
+
2011
+
2012
+ <dl class="details">
2013
+
2014
+
2015
+
2016
+
2017
+
2018
+
2019
+
2020
+
2021
+
2022
+
2023
+
2024
+
2025
+
2026
+
2027
+
2028
+
2029
+
2030
+
2031
+
2032
+
2033
+
2034
+
2035
+
2036
+
2037
+
2038
+
2039
+
2040
+
2041
+
2042
+
2043
+
2044
+ </dl>
2045
+
2046
+
2047
+
2048
+
2049
+
2050
+
2051
+
2052
+
2053
+
2054
+
2055
+
2056
+
2057
+
2058
+
2059
+
2060
+
2061
+
2062
+
2063
+
2064
+
2065
+
2066
+
2067
+
2068
+ <h5>示例</h5>
2069
+
2070
+ <p class="code-caption"><h7>中心点跳转示例</h7></p>
2071
+
2072
+
2073
+ <pre class="prettyprint"><code>// ES5引入方式
2074
+ const { Map } = zondy
2075
+ const { MapView } = zondy.mapboxgl
2076
+ // ES6引入方式
2077
+ import { Map } from "@mapgis/webclient-common"
2078
+ import { MapView } from "@mapgis/webclient-mapboxgl-plugin"
2079
+ // 初始化图层管理容器
2080
+ map = new .Map();
2081
+ // 初始化地图视图对象
2082
+ mapView = new MapView({
2083
+ // 视图id
2084
+ viewId: "view-id",
2085
+ // 图层管理容器
2086
+ map: map
2087
+ });
2088
+ // 视点跳转
2089
+ mapView.flyTo({
2090
+ // 跳转中心点
2091
+ center: [{x}, {y}],
2092
+ // 地图层级
2093
+ zoom: {zoom}
2094
+ });</code></pre>
2095
+
2096
+
2097
+ <p class="code-caption"><h7>按范围跳转示例</h7></p>
2098
+
2099
+
2100
+ <pre class="prettyprint"><code>// ES5引入方式
2101
+ const { Map } = zondy
2102
+ const { Extent } = zondy.geometry
2103
+ const { MapView } = zondy.mapboxgl
2104
+ // ES6引入方式
2105
+ import { Map, MapView, Extent } from "@mapgis/webclient-mapboxgl-plugin"
2106
+ // 初始化图层管理容器
2107
+ map = new Map();
2108
+ // 初始化地图视图对象
2109
+ mapView = new MapView({
2110
+ // 视图id
2111
+ viewId: "view-id",
2112
+ // 图层管理容器
2113
+ map: map
2114
+ });
2115
+ mapView.flyTo({
2116
+ // 范围几何
2117
+ extent: new Extent({
2118
+ "xmin":10,
2119
+ "xmax":210,
2120
+ "ymin":0,
2121
+ "ymax":100,
2122
+ })
2123
+ });</code></pre>
2124
+
2125
+
2126
+ <p class="code-caption"><h7>按范围跳转示例-拿到图层信息后跳转</h7></p>
2127
+
2128
+
2129
+ <pre class="prettyprint"><code>// ES5引入方式
2130
+ const { IGSMapImageLayer } = zondy.layer
2131
+ // ES6引入方式
2132
+ import { IGSMapImageLayer } from "@mapgis/webclient-mapboxgl-plugin"
2133
+ const igsMapImageLayer = new IGSMapImageLayer({
2134
+ url: 'http://192.168.82.89:8089/igs/rest/services/Map/Hubei4326/MapServer'
2135
+ });
2136
+ map.add(igsMapImageLayer);
2137
+ // 图层加载完毕
2138
+ igsMapImageLayer.on('layer-view-created', function (result) {
2139
+ console.log("加载完毕:", result.layer)
2140
+ //视点跳转
2141
+ mapView.flyTo({
2142
+ extent: result.layer.extent
2143
+ });
2144
+ })</code></pre>
2145
+
2146
+
2147
+
2148
+ </div>
2149
+
2150
+ <div class="member">
2151
+
2152
+
2153
+
2154
+ <h4 class="name" id="getCenter">
2155
+ <a class="href-link" href="#getCenter">#</a>
2156
+
2157
+ <span class="code-name" style="font-size:30px">
2158
+
2159
+ getCenter<span class="signature">()</span>
2160
+
2161
+ </span>
2162
+ </h4>
2163
+
2164
+
2165
+
2166
+ <div class="description">
2167
+ <p>获取当前视图的中心点(经纬度中心点)<a id='getCenter'></a></p>
2168
+ </div>
2169
+
2170
+
2171
+
2172
+
2173
+
2174
+
2175
+
2176
+
2177
+
2178
+
2179
+
2180
+
2181
+
2182
+
2183
+ <dl class="details">
2184
+
2185
+
2186
+
2187
+
2188
+
2189
+
2190
+
2191
+
2192
+
2193
+
2194
+
2195
+
2196
+
2197
+
2198
+
2199
+
2200
+
2201
+
2202
+
2203
+
2204
+
2205
+
2206
+
2207
+
2208
+
2209
+
2210
+
2211
+
2212
+
2213
+
2214
+
2215
+ </dl>
2216
+
2217
+
2218
+
2219
+
2220
+
2221
+
2222
+
2223
+
2224
+
2225
+
2226
+
2227
+
2228
+
2229
+
2230
+
2231
+
2232
+
2233
+
2234
+ <div class='columns method-parameter'>
2235
+ <div class="column is-2"><label>返回值:</label></div>
2236
+ <div class="column is-10">
2237
+
2238
+
2239
+
2240
+ <div class="columns">
2241
+
2242
+ <div class='param-desc column is-7'><p>中心点对象</p></div>
2243
+
2244
+
2245
+ <div class='column is-5 has-text-left'>
2246
+ <label>类型: </label>
2247
+
2248
+ <span class="param-type">Object</span>
2249
+
2250
+
2251
+ </div>
2252
+
2253
+ </div>
2254
+
2255
+
2256
+ </div>
2257
+ </div>
2258
+
2259
+
2260
+
2261
+
2262
+
2263
+
2264
+ </div>
2265
+
2266
+ <div class="member">
2267
+
2268
+
2269
+
2270
+ <h4 class="name" id="getExtent">
2271
+ <a class="href-link" href="#getExtent">#</a>
2272
+
2273
+ <span class="code-name" style="font-size:30px">
2274
+
2275
+ getExtent<span class="signature">()</span>
2276
+
2277
+ </span>
2278
+ </h4>
2279
+
2280
+
2281
+
2282
+ <div class="description">
2283
+ <p>获取当前视图的地理范围<a id='getExtent'></a></p>
2284
+ </div>
2285
+
2286
+
2287
+
2288
+
2289
+
2290
+
2291
+
2292
+
2293
+
2294
+
2295
+
2296
+
2297
+
2298
+
2299
+ <dl class="details">
2300
+
2301
+
2302
+
2303
+
2304
+
2305
+
2306
+
2307
+
2308
+
2309
+
2310
+
2311
+
2312
+
2313
+
2314
+
2315
+
2316
+
2317
+
2318
+
2319
+
2320
+
2321
+
2322
+
2323
+
2324
+
2325
+
2326
+
2327
+
2328
+
2329
+
2330
+
2331
+ </dl>
2332
+
2333
+
2334
+
2335
+
2336
+
2337
+
2338
+
2339
+
2340
+
2341
+
2342
+
2343
+
2344
+
2345
+
2346
+
2347
+
2348
+
2349
+
2350
+ <div class='columns method-parameter'>
2351
+ <div class="column is-2"><label>返回值:</label></div>
2352
+ <div class="column is-10">
2353
+
2354
+
2355
+
2356
+ <div class="columns">
2357
+
2358
+ <div class='param-desc column is-7'><p>获取当前视图的地理范围</p></div>
2359
+
2360
+
2361
+ <div class='column is-5 has-text-left'>
2362
+ <label>类型: </label>
2363
+
2364
+ <span class="param-type">Extent</span>
2365
+
2366
+
2367
+ </div>
2368
+
2369
+ </div>
2370
+
2371
+
2372
+ </div>
2373
+ </div>
2374
+
2375
+
2376
+
2377
+
2378
+
2379
+
2380
+ </div>
2381
+
2382
+ <div class="member">
2383
+
2384
+
2385
+
2386
+ <h4 class="name" id="getScale">
2387
+ <a class="href-link" href="#getScale">#</a>
2388
+
2389
+ <span class="code-name" style="font-size:30px">
2390
+
2391
+ getScale<span class="signature">()</span>
2392
+
2393
+ </span>
2394
+ </h4>
2395
+
2396
+
2397
+
2398
+ <div class="description">
2399
+ <p><a id='getScale'></a>
2400
+ 获取当前比例尺</p>
2401
+ </div>
2402
+
2403
+
2404
+
2405
+
2406
+
2407
+
2408
+
2409
+
2410
+
2411
+
2412
+
2413
+
2414
+
2415
+
2416
+ <dl class="details">
2417
+
2418
+
2419
+
2420
+
2421
+
2422
+
2423
+
2424
+
2425
+
2426
+
2427
+
2428
+
2429
+
2430
+
2431
+
2432
+
2433
+
2434
+
2435
+
2436
+
2437
+
2438
+
2439
+
2440
+
2441
+
2442
+
2443
+
2444
+
2445
+
2446
+
2447
+
2448
+ </dl>
2449
+
2450
+
2451
+
2452
+
2453
+
2454
+
2455
+
2456
+
2457
+
2458
+
2459
+
2460
+
2461
+
2462
+
2463
+
2464
+
2465
+
2466
+
2467
+ <div class='columns method-parameter'>
2468
+ <div class="column is-2"><label>返回值:</label></div>
2469
+ <div class="column is-10">
2470
+
2471
+
2472
+
2473
+ <div class="columns">
2474
+
2475
+ <div class='param-desc column is-7'><p>比例尺 实际10000米:地图1米</p></div>
2476
+
2477
+
2478
+ <div class='column is-5 has-text-left'>
2479
+ <label>类型: </label>
2480
+
2481
+ <span class="param-type">Number</span>
2482
+
2483
+
2484
+ </div>
2485
+
2486
+ </div>
2487
+
2488
+
2489
+ </div>
2490
+ </div>
2491
+
2492
+
2493
+
2494
+
2495
+
2496
+
2497
+ </div>
2498
+
2499
+ <div class="member">
2500
+
2501
+
2502
+
2503
+ <h4 class="name" id="getSize">
2504
+ <a class="href-link" href="#getSize">#</a>
2505
+
2506
+ <span class="code-name" style="font-size:30px">
2507
+
2508
+ getSize<span class="signature">()</span>
2509
+
2510
+ </span>
2511
+ </h4>
2512
+
2513
+
2514
+
2515
+ <div class="description">
2516
+ <p>获取当前视图容器的宽高,单位像素<a id='getSize'></a></p>
2517
+ </div>
2518
+
2519
+
2520
+
2521
+
2522
+
2523
+
2524
+
2525
+
2526
+
2527
+
2528
+
2529
+
2530
+
2531
+
2532
+ <dl class="details">
2533
+
2534
+
2535
+
2536
+
2537
+
2538
+
2539
+
2540
+
2541
+
2542
+
2543
+
2544
+
2545
+
2546
+
2547
+
2548
+
2549
+
2550
+
2551
+
2552
+
2553
+
2554
+
2555
+
2556
+
2557
+
2558
+
2559
+
2560
+
2561
+
2562
+
2563
+
2564
+ </dl>
2565
+
2566
+
2567
+
2568
+
2569
+
2570
+
2571
+
2572
+
2573
+
2574
+
2575
+
2576
+
2577
+
2578
+
2579
+
2580
+
2581
+
2582
+
2583
+ <div class='columns method-parameter'>
2584
+ <div class="column is-2"><label>返回值:</label></div>
2585
+ <div class="column is-10">
2586
+
2587
+
2588
+
2589
+ <div class="columns">
2590
+
2591
+ <div class='param-desc column is-7'><p>当前视图容器的宽高对象</p></div>
2592
+
2593
+
2594
+ <div class='column is-5 has-text-left'>
2595
+ <label>类型: </label>
2596
+
2597
+ <span class="param-type">Object</span>
2598
+
2599
+
2600
+ </div>
2601
+
2602
+ </div>
2603
+
2604
+
2605
+ </div>
2606
+ </div>
2607
+
2608
+
2609
+
2610
+
2611
+
2612
+
2613
+ </div>
2614
+
2615
+ <div class="member">
2616
+
2617
+
2618
+
2619
+ <h4 class="name" id="getZoom">
2620
+ <a class="href-link" href="#getZoom">#</a>
2621
+
2622
+ <span class="code-name" style="font-size:30px">
2623
+
2624
+ getZoom<span class="signature">()</span>
2625
+
2626
+ </span>
2627
+ </h4>
2628
+
2629
+
2630
+
2631
+ <div class="description">
2632
+ <p>获取当前缩放级数<a id='getZoom'></a></p>
2633
+ </div>
2634
+
2635
+
2636
+
2637
+
2638
+
2639
+
2640
+
2641
+
2642
+
2643
+
2644
+
2645
+
2646
+
2647
+
2648
+ <dl class="details">
2649
+
2650
+
2651
+
2652
+
2653
+
2654
+
2655
+
2656
+
2657
+
2658
+
2659
+
2660
+
2661
+
2662
+
2663
+
2664
+
2665
+
2666
+
2667
+
2668
+
2669
+
2670
+
2671
+
2672
+
2673
+
2674
+
2675
+
2676
+
2677
+
2678
+
2679
+
2680
+ </dl>
2681
+
2682
+
2683
+
2684
+
2685
+
2686
+
2687
+
2688
+
2689
+
2690
+
2691
+
2692
+
2693
+
2694
+
2695
+
2696
+
2697
+
2698
+
2699
+ <div class='columns method-parameter'>
2700
+ <div class="column is-2"><label>返回值:</label></div>
2701
+ <div class="column is-10">
2702
+
2703
+
2704
+
2705
+ <div class="columns">
2706
+
2707
+ <div class='param-desc column is-7'><p>当前缩放级数</p></div>
2708
+
2709
+
2710
+ <div class='column is-5 has-text-left'>
2711
+ <label>类型: </label>
2712
+
2713
+ <span class="param-type">Number</span>
2714
+
2715
+
2716
+ </div>
2717
+
2718
+ </div>
2719
+
2720
+
2721
+ </div>
2722
+ </div>
2723
+
2724
+
2725
+
2726
+
2727
+
2728
+
2729
+ </div>
2730
+
2731
+ <div class="member">
2732
+
2733
+
2734
+
2735
+ <h4 class="name" id="goTo">
2736
+ <a class="href-link" href="#goTo">#</a>
2737
+
2738
+ <span class="code-name" style="font-size:30px">
2739
+
2740
+ goTo<span class="signature">(goToTarget, options)</span>
2741
+
2742
+ </span>
2743
+ </h4>
2744
+
2745
+
2746
+
2747
+ <div class="description">
2748
+ <p>视点跳转为给定的目标<a id='goTo'></a></p>
2749
+ </div>
2750
+
2751
+
2752
+
2753
+
2754
+
2755
+
2756
+
2757
+
2758
+
2759
+
2760
+ <h4>参数:</h4>
2761
+
2762
+ <div class="table-container">
2763
+ <table class="params table">
2764
+ <thead>
2765
+ <tr>
2766
+
2767
+ <th>名称</th>
2768
+
2769
+
2770
+ <th>类型</th>
2771
+
2772
+
2773
+ <th style="min-width: 100px;">默认值</th>
2774
+
2775
+
2776
+ <th class="last">描述</th>
2777
+ </tr>
2778
+ </thead>
2779
+
2780
+ <tbody>
2781
+
2782
+
2783
+
2784
+ <tr class="deep-level-0">
2785
+
2786
+ <td class="name"><code>goToTarget</code></td>
2787
+
2788
+
2789
+ <td class="type">
2790
+
2791
+ </td>
2792
+
2793
+
2794
+ <td class="default">
2795
+
2796
+ </td>
2797
+
2798
+
2799
+ <td class="description last"><p>跳转参数</p></td>
2800
+ </tr>
2801
+
2802
+
2803
+
2804
+
2805
+ <tr class="deep-level-1">
2806
+
2807
+ <td class="name"><code>center</code></td>
2808
+
2809
+
2810
+ <td class="type">
2811
+
2812
+
2813
+ <span class="param-type">Point</span>
2814
+ |
2815
+
2816
+ <span class="param-type">Array</span>
2817
+
2818
+
2819
+
2820
+ </td>
2821
+
2822
+
2823
+ <td class="default">
2824
+
2825
+ </td>
2826
+
2827
+
2828
+ <td class="description last"><p>视图跳转中心点</p></td>
2829
+ </tr>
2830
+
2831
+
2832
+
2833
+
2834
+ <tr class="deep-level-1">
2835
+
2836
+ <td class="name"><code>zoom</code></td>
2837
+
2838
+
2839
+ <td class="type">
2840
+
2841
+
2842
+ <span class="param-type">Number</span>
2843
+
2844
+
2845
+
2846
+ </td>
2847
+
2848
+
2849
+ <td class="default">
2850
+
2851
+ </td>
2852
+
2853
+
2854
+ <td class="description last"><p>视图跳转层级</p></td>
2855
+ </tr>
2856
+
2857
+
2858
+
2859
+
2860
+ <tr class="deep-level-1">
2861
+
2862
+ <td class="name"><code>scale</code></td>
2863
+
2864
+
2865
+ <td class="type">
2866
+
2867
+
2868
+ <span class="param-type">Number</span>
2869
+
2870
+
2871
+
2872
+ </td>
2873
+
2874
+
2875
+ <td class="default">
2876
+
2877
+ </td>
2878
+
2879
+
2880
+ <td class="description last"><p>视图跳转比例尺</p></td>
2881
+ </tr>
2882
+
2883
+
2884
+
2885
+
2886
+ <tr class="deep-level-1">
2887
+
2888
+ <td class="name"><code>layer</code></td>
2889
+
2890
+
2891
+ <td class="type">
2892
+
2893
+
2894
+ <span class="param-type">Layer</span>
2895
+ |
2896
+
2897
+ <span class="param-type">SubLayer</span>
2898
+ |
2899
+
2900
+ <span class="param-type">undefined</span>
2901
+
2902
+
2903
+
2904
+ </td>
2905
+
2906
+
2907
+ <td class="default">
2908
+
2909
+ </td>
2910
+
2911
+
2912
+ <td class="description last"><p>跳转的图层</p></td>
2913
+ </tr>
2914
+
2915
+
2916
+
2917
+
2918
+ <tr class="deep-level-1">
2919
+
2920
+ <td class="name"><code>target</code></td>
2921
+
2922
+
2923
+ <td class="type">
2924
+
2925
+
2926
+ <span class="param-type">Geometry</span>
2927
+ |
2928
+
2929
+ <span class="param-type">Array.&lt;Geometry></span>
2930
+ |
2931
+
2932
+ <span class="param-type">Collection.&lt;Geometry></span>
2933
+
2934
+
2935
+
2936
+ </td>
2937
+
2938
+
2939
+ <td class="default">
2940
+
2941
+ </td>
2942
+
2943
+
2944
+ <td class="description last"><p>按范围跳转</p></td>
2945
+ </tr>
2946
+
2947
+
2948
+
2949
+
2950
+
2951
+
2952
+
2953
+
2954
+
2955
+ <tr class="deep-level-0">
2956
+
2957
+ <td class="name"><code>options</code></td>
2958
+
2959
+
2960
+ <td class="type">
2961
+
2962
+ </td>
2963
+
2964
+
2965
+ <td class="default">
2966
+
2967
+ </td>
2968
+
2969
+
2970
+ <td class="description last"><p>动画参数</p></td>
2971
+ </tr>
2972
+
2973
+
2974
+
2975
+
2976
+ <tr class="deep-level-1">
2977
+
2978
+ <td class="name"><code>animate</code></td>
2979
+
2980
+
2981
+ <td class="type">
2982
+
2983
+
2984
+ <span class="param-type">Boolean</span>
2985
+
2986
+
2987
+
2988
+ </td>
2989
+
2990
+
2991
+ <td class="default">
2992
+
2993
+ true
2994
+
2995
+ </td>
2996
+
2997
+
2998
+ <td class="description last"><p>新视图的过渡是否开启动画,默认开启动画</p></td>
2999
+ </tr>
3000
+
3001
+
3002
+
3003
+
3004
+ <tr class="deep-level-1">
3005
+
3006
+ <td class="name"><code>duration</code></td>
3007
+
3008
+
3009
+ <td class="type">
3010
+
3011
+
3012
+ <span class="param-type">Number</span>
3013
+
3014
+
3015
+
3016
+ </td>
3017
+
3018
+
3019
+ <td class="default">
3020
+
3021
+ 200
3022
+
3023
+ </td>
3024
+
3025
+
3026
+ <td class="description last"><p>动画的持续时间,以毫秒为单位,默认200毫秒</p></td>
3027
+ </tr>
3028
+
3029
+
3030
+
3031
+
3032
+
3033
+
3034
+
3035
+ </tbody>
3036
+ </table>
3037
+ </div>
3038
+
3039
+
3040
+
3041
+
3042
+
3043
+
3044
+ <dl class="details">
3045
+
3046
+
3047
+
3048
+
3049
+
3050
+
3051
+
3052
+
3053
+
3054
+
3055
+
3056
+
3057
+
3058
+
3059
+
3060
+
3061
+
3062
+
3063
+
3064
+
3065
+
3066
+
3067
+
3068
+
3069
+
3070
+
3071
+
3072
+
3073
+
3074
+
3075
+
3076
+ </dl>
3077
+
3078
+
3079
+
3080
+
3081
+
3082
+
3083
+
3084
+
3085
+
3086
+
3087
+
3088
+
3089
+
3090
+
3091
+
3092
+
3093
+
3094
+
3095
+ <div class='columns method-parameter'>
3096
+ <div class="column is-2"><label>返回值:</label></div>
3097
+ <div class="column is-10">
3098
+
3099
+
3100
+
3101
+ <div class="columns">
3102
+
3103
+ <div class='param-desc column is-7'><p>视图跳转是否成功</p></div>
3104
+
3105
+
3106
+ <div class='column is-5 has-text-left'>
3107
+ <label>类型: </label>
3108
+
3109
+ <span class="param-type">Promise.&lt;Boolean></span>
3110
+
3111
+
3112
+ </div>
3113
+
3114
+ </div>
3115
+
3116
+
3117
+ </div>
3118
+ </div>
3119
+
3120
+
3121
+
3122
+
3123
+
3124
+
3125
+ <h5>示例</h5>
3126
+
3127
+ <p class="code-caption"><h7>中心点跳转示例</h7></p>
3128
+
3129
+
3130
+ <pre class="prettyprint"><code>// ES5引入方式
3131
+ const { Map } = zondy
3132
+ const { MapView } = zondy.mapboxgl
3133
+ // ES6引入方式
3134
+ import { Map } from "@mapgis/webclient-common"
3135
+ import { MapView } from "@mapgis/webclient-mapboxgl-plugin"
3136
+ // 初始化图层管理容器
3137
+ map = new .Map();
3138
+ // 初始化地图视图对象
3139
+ mapView = new MapView({
3140
+ // 视图id
3141
+ viewId: "view-id",
3142
+ // 图层管理容器
3143
+ map: map
3144
+ });
3145
+ // 视点跳转
3146
+ mapView.goTo({
3147
+ // 跳转中心点
3148
+ center: [115.47643872463577, 30.980700423496124],
3149
+ // 地图层级
3150
+ zoom: 8
3151
+ });</code></pre>
3152
+
3153
+
3154
+ <p class="code-caption"><h7>按范围跳转示例</h7></p>
3155
+
3156
+
3157
+ <pre class="prettyprint"><code>// ES5引入方式
3158
+ const { Map } = zondy
3159
+ const { Extent, Circle } = zondy.geometry
3160
+ const { MapView } = zondy.mapboxgl
3161
+ // ES6引入方式
3162
+ import { Map } from "@mapgis/webclient-common"
3163
+ import { MapView } from "@mapgis/webclient-mapboxgl-plugin"
3164
+ // 初始化图层管理容器
3165
+ map = new Map();
3166
+ // 初始化地图视图对象
3167
+ mapView = new MapView({
3168
+ // 视图id
3169
+ viewId: "view-id",
3170
+ // 图层管理容器
3171
+ map: map
3172
+ });
3173
+ const extent1 = new Extent({
3174
+ xmin: 111.88463529230717,
3175
+ ymin: 28.646934514163803,
3176
+ xmax: 116.89989408129225,
3177
+ ymax: 33.07991791253288,
3178
+ })
3179
+ const geometry2 = new Circle({
3180
+ center: [111, 29],
3181
+ radius: 100,
3182
+ radiusUnit: "kilometers",
3183
+ })
3184
+ mapView
3185
+ .goTo({
3186
+ target: [extent1, geometry2],
3187
+ })
3188
+ .then(() => {
3189
+ console.log("gotoExtent callback")
3190
+ })</code></pre>
3191
+
3192
+
3193
+
3194
+ </div>
3195
+
3196
+ <div class="member">
3197
+
3198
+
3199
+
3200
+ <h4 class="name" id="hitTest">
3201
+ <a class="href-link" href="#hitTest">#</a>
3202
+
3203
+ <span class="code-name" style="font-size:30px">
3204
+
3205
+ hitTest<span class="signature">(screenPoint)</span>
3206
+
3207
+ </span>
3208
+ </h4>
3209
+
3210
+
3211
+
3212
+ <div class="description">
3213
+ <p>穿透检测,图元拾取。目前支持graphic类型拾取结果,支持图层类型GraphicLayer,FeatureLayer。</p>
3214
+ </div>
3215
+
3216
+
3217
+
3218
+
3219
+
3220
+
3221
+
3222
+
3223
+
3224
+
3225
+ <h4>参数:</h4>
3226
+
3227
+ <div class="table-container">
3228
+ <table class="params table">
3229
+ <thead>
3230
+ <tr>
3231
+
3232
+ <th>名称</th>
3233
+
3234
+
3235
+ <th>类型</th>
3236
+
3237
+
3238
+
3239
+ <th class="last">描述</th>
3240
+ </tr>
3241
+ </thead>
3242
+
3243
+ <tbody>
3244
+
3245
+
3246
+
3247
+ <tr class="deep-level-0">
3248
+
3249
+ <td class="name"><code>screenPoint</code></td>
3250
+
3251
+
3252
+ <td class="type">
3253
+
3254
+
3255
+ <span class="param-type">Object</span>
3256
+
3257
+
3258
+
3259
+ </td>
3260
+
3261
+
3262
+
3263
+ <td class="description last"><p>屏幕像素坐标点,例如{ x: 900, y: 500 }</p></td>
3264
+ </tr>
3265
+
3266
+
3267
+
3268
+
3269
+ </tbody>
3270
+ </table>
3271
+ </div>
3272
+
3273
+
3274
+
3275
+
3276
+
3277
+
3278
+ <dl class="details">
3279
+
3280
+
3281
+
3282
+
3283
+
3284
+
3285
+
3286
+
3287
+
3288
+
3289
+
3290
+
3291
+
3292
+
3293
+
3294
+
3295
+
3296
+
3297
+
3298
+
3299
+
3300
+
3301
+
3302
+
3303
+
3304
+
3305
+
3306
+
3307
+
3308
+
3309
+
3310
+ </dl>
3311
+
3312
+
3313
+
3314
+
3315
+
3316
+
3317
+
3318
+
3319
+
3320
+
3321
+
3322
+
3323
+
3324
+
3325
+
3326
+
3327
+
3328
+
3329
+ <div class='columns method-parameter'>
3330
+ <div class="column is-2"><label>返回值:</label></div>
3331
+ <div class="column is-10">
3332
+
3333
+
3334
+
3335
+ <div class="columns">
3336
+
3337
+ <div class='param-desc column is-7'><p>图元检测结果</p></div>
3338
+
3339
+
3340
+ <div class='column is-5 has-text-left'>
3341
+ <label>类型: </label>
3342
+
3343
+ <span class="param-type">Array</span>
3344
+
3345
+
3346
+ </div>
3347
+
3348
+ </div>
3349
+
3350
+
3351
+ </div>
3352
+ </div>
3353
+
3354
+
3355
+
3356
+
3357
+
3358
+
3359
+ <h5>示例</h5>
3360
+
3361
+ <p class="code-caption"><h7>根据基础图层对象或者图层id查询并返回实际图层</h7></p>
3362
+
3363
+
3364
+ <pre class="prettyprint"><code>// ES5引入方式
3365
+ const { Map, Feature } = zondy
3366
+ const { Point, Polygon, MultiPolygon ,Extent, Circle } = zondy.geometry
3367
+ const { GraphicsLayer, IGSFeatureLayer, IGSTileLayer } = zondy.layer
3368
+ const { MapView } = zondy.mapboxgl
3369
+ // ES6引入方式
3370
+ import { MapView } from "@mapgis/webclient-mapboxgl-plugin";
3371
+ import { Map, Point, Polygon, MultiPolygon ,Extent, GraphicsLayer, Feature, Circle, IGSFeatureLayer, IGSTileLayer } from "@mapgis/webclient-common";
3372
+ // 初始化图层管理容器
3373
+ const map = new Map();
3374
+ // 初始化地图视图对象
3375
+ this.mapView = new MapView({
3376
+ // 视图id
3377
+ viewId: "mapgis-2d-viewer",
3378
+ // 图层管理容器
3379
+ map: map,
3380
+ })
3381
+ // 创建一个要素crs
3382
+ const feature = [
3383
+ new Feature({
3384
+ id: '11113',
3385
+ geometry: new Circle({
3386
+ center: [113, 35],
3387
+ radius: 10000,
3388
+ radiusUnit: 'kilometers',
3389
+ })
3390
+ }),
3391
+ new Feature({
3392
+ id: '11114',
3393
+ geometry: new Polygon({
3394
+ coordinates: [
3395
+ // 外圈
3396
+ [
3397
+ [113.0, 29.0],
3398
+ [116.0, 29.0],
3399
+ [116.0, 35.0],
3400
+ [113.0, 35.0],
3401
+ [113.0, 29.0]
3402
+ ]
3403
+ ]
3404
+ })
3405
+ }),
3406
+ new Feature({
3407
+ id: '11115',
3408
+ geometry:new MultiPolygon({
3409
+ coordinates: [
3410
+ [
3411
+ // 外圈
3412
+ [
3413
+ [112.0, 28.0],
3414
+ [115.0, 28.0],
3415
+ [115.0, 30.0],
3416
+ [112.0, 30.0],
3417
+ [112.0, 28.0]
3418
+ ],
3419
+ // 第一个内圈
3420
+ [
3421
+ [112.2, 28.2],
3422
+ [112.2, 29.8],
3423
+ [114.8, 29.8],
3424
+ [114.8, 28.2],
3425
+ [112.2, 28.2]
3426
+ ]
3427
+ ]
3428
+ ]
3429
+ })
3430
+ })
3431
+ ]
3432
+ // 初始化几何图层
3433
+ const graphicsLayer = new GraphicsLayer({
3434
+ graphics:feature
3435
+ })
3436
+ map.add(this.graphicsLayer)
3437
+ const result = this.mapView.hitTest({x:1100,y:600})</code></pre>
3438
+
3439
+
3440
+
3441
+ </div>
3442
+
3443
+ <div class="member">
3444
+
3445
+
3446
+
3447
+ <h4 class="name" id="takeScreenshot">
3448
+ <a class="href-link" href="#takeScreenshot">#</a>
3449
+
3450
+ <span class="code-name" style="font-size:30px">
3451
+
3452
+ takeScreenshot<span class="signature">(options<span class="signature-attributes">opt</span>)</span>
3453
+
3454
+ </span>
3455
+ </h4>
3456
+
3457
+
3458
+
3459
+ <div class="description">
3460
+ <p>屏幕快照</p>
3461
+ </div>
3462
+
3463
+
3464
+
3465
+
3466
+
3467
+
3468
+
3469
+
3470
+
3471
+
3472
+ <h4>参数:</h4>
3473
+
3474
+ <div class="table-container">
3475
+ <table class="params table">
3476
+ <thead>
3477
+ <tr>
3478
+
3479
+ <th>名称</th>
3480
+
3481
+
3482
+ <th>类型</th>
3483
+
3484
+
3485
+ <th style="min-width: 100px;">默认值</th>
3486
+
3487
+
3488
+ <th class="last">描述</th>
3489
+ </tr>
3490
+ </thead>
3491
+
3492
+ <tbody>
3493
+
3494
+
3495
+
3496
+ <tr class="deep-level-0">
3497
+
3498
+ <td class="name"><code>options</code></td>
3499
+
3500
+
3501
+ <td class="type">
3502
+
3503
+
3504
+ <span class="param-type">Object</span>
3505
+
3506
+
3507
+
3508
+ </td>
3509
+
3510
+
3511
+ <td class="default">
3512
+
3513
+ {}
3514
+
3515
+ </td>
3516
+
3517
+
3518
+ <td class="description last"><p>屏幕快照配置配置</p></td>
3519
+ </tr>
3520
+
3521
+
3522
+
3523
+
3524
+ <tr class="deep-level-1">
3525
+
3526
+ <td class="name"><code>format</code></td>
3527
+
3528
+
3529
+ <td class="type">
3530
+
3531
+
3532
+ <span class="param-type">PictureFormat</span>
3533
+
3534
+
3535
+
3536
+ </td>
3537
+
3538
+
3539
+ <td class="default">
3540
+
3541
+ PictureFormat.PNG
3542
+
3543
+ </td>
3544
+
3545
+
3546
+ <td class="description last"><p>照片格式,支持png,jpeg格式</p></td>
3547
+ </tr>
3548
+
3549
+
3550
+
3551
+
3552
+ <tr class="deep-level-1">
3553
+
3554
+ <td class="name"><code>filename</code></td>
3555
+
3556
+
3557
+ <td class="type">
3558
+
3559
+
3560
+ <span class="param-type">String</span>
3561
+
3562
+
3563
+
3564
+ </td>
3565
+
3566
+
3567
+ <td class="default">
3568
+
3569
+ 'screenshotFile'
3570
+
3571
+ </td>
3572
+
3573
+
3574
+ <td class="description last"><p>下载文件名</p></td>
3575
+ </tr>
3576
+
3577
+
3578
+
3579
+
3580
+ <tr class="deep-level-1">
3581
+
3582
+ <td class="name"><code>width</code></td>
3583
+
3584
+
3585
+ <td class="type">
3586
+
3587
+
3588
+ <span class="param-type">Number</span>
3589
+
3590
+
3591
+
3592
+ </td>
3593
+
3594
+
3595
+ <td class="default">
3596
+
3597
+ </td>
3598
+
3599
+
3600
+ <td class="description last"><p>图片宽度</p></td>
3601
+ </tr>
3602
+
3603
+
3604
+
3605
+
3606
+ <tr class="deep-level-1">
3607
+
3608
+ <td class="name"><code>height</code></td>
3609
+
3610
+
3611
+ <td class="type">
3612
+
3613
+
3614
+ <span class="param-type">Number</span>
3615
+
3616
+
3617
+
3618
+ </td>
3619
+
3620
+
3621
+ <td class="default">
3622
+
3623
+ </td>
3624
+
3625
+
3626
+ <td class="description last"><p>图片高度</p></td>
3627
+ </tr>
3628
+
3629
+
3630
+
3631
+
3632
+ <tr class="deep-level-1">
3633
+
3634
+ <td class="name"><code>x</code></td>
3635
+
3636
+
3637
+ <td class="type">
3638
+
3639
+
3640
+ <span class="param-type">Number</span>
3641
+
3642
+
3643
+
3644
+ </td>
3645
+
3646
+
3647
+ <td class="default">
3648
+
3649
+ </td>
3650
+
3651
+
3652
+ <td class="description last"><p>图片原点x</p></td>
3653
+ </tr>
3654
+
3655
+
3656
+
3657
+
3658
+ <tr class="deep-level-1">
3659
+
3660
+ <td class="name"><code>y</code></td>
3661
+
3662
+
3663
+ <td class="type">
3664
+
3665
+
3666
+ <span class="param-type">Number</span>
3667
+
3668
+
3669
+
3670
+ </td>
3671
+
3672
+
3673
+ <td class="default">
3674
+
3675
+ </td>
3676
+
3677
+
3678
+ <td class="description last"><p>图片原点y</p></td>
3679
+ </tr>
3680
+
3681
+
3682
+
3683
+
3684
+ <tr class="deep-level-1">
3685
+
3686
+ <td class="name"><code>isDownload</code></td>
3687
+
3688
+
3689
+ <td class="type">
3690
+
3691
+
3692
+ <span class="param-type">Boolean</span>
3693
+
3694
+
3695
+
3696
+ </td>
3697
+
3698
+
3699
+ <td class="default">
3700
+
3701
+ true
3702
+
3703
+ </td>
3704
+
3705
+
3706
+ <td class="description last"><p>是否下载图片</p></td>
3707
+ </tr>
3708
+
3709
+
3710
+
3711
+
3712
+
3713
+
3714
+
3715
+ </tbody>
3716
+ </table>
3717
+ </div>
3718
+
3719
+
3720
+
3721
+
3722
+
3723
+
3724
+ <dl class="details">
3725
+
3726
+
3727
+
3728
+
3729
+
3730
+
3731
+
3732
+
3733
+
3734
+
3735
+
3736
+
3737
+
3738
+
3739
+
3740
+
3741
+
3742
+
3743
+
3744
+
3745
+
3746
+
3747
+
3748
+
3749
+
3750
+
3751
+
3752
+
3753
+
3754
+
3755
+
3756
+ </dl>
3757
+
3758
+
3759
+
3760
+
3761
+
3762
+
3763
+
3764
+
3765
+
3766
+
3767
+
3768
+
3769
+
3770
+
3771
+
3772
+
3773
+
3774
+
3775
+ <div class='columns method-parameter'>
3776
+ <div class="column is-2"><label>返回值:</label></div>
3777
+ <div class="column is-10">
3778
+
3779
+
3780
+
3781
+ <div class="columns">
3782
+
3783
+ <div class='param-desc column is-7'><p>屏幕快照 {dataUrl String },且浏览器会下载图片</p></div>
3784
+
3785
+
3786
+ <div class='column is-5 has-text-left'>
3787
+ <label>类型: </label>
3788
+
3789
+ <span class="param-type">Object</span>
3790
+
3791
+
3792
+ </div>
3793
+
3794
+ </div>
3795
+
3796
+
3797
+ </div>
3798
+ </div>
3799
+
3800
+
3801
+
3802
+
3803
+
3804
+
3805
+ <h5>示例</h5>
3806
+
3807
+ <p class="code-caption"><h7>屏幕快照</h7></p>
3808
+
3809
+
3810
+ <pre class="prettyprint"><code>// ES5引入方式
3811
+ const { Map } = zondy
3812
+ const { PictureFormat } = zondy.Enum
3813
+ const { MapView } = zondy.mapboxgl
3814
+ // ES6引入方式
3815
+ import { MapView } from "@mapgis/webclient-mapboxgl-plugin"
3816
+ import { Map, PictureFormat } from "@mapgis/webclient-common"
3817
+ // 初始化图层管理容器
3818
+ const map = new Map();
3819
+ // 初始化地图视图对象
3820
+ const mapView = new MapView({
3821
+ // 二维场景视图的容器(html的div标签)ID
3822
+ viewId: "二维场景视图的容器的id",
3823
+ // 图层管理容器
3824
+ map: map
3825
+ })
3826
+ // 设置屏幕快照参数
3827
+ const screenshotOptions: {
3828
+ format: PictureFormat.PNG
3829
+ }
3830
+ // 开始屏幕快照
3831
+ mapView.takeScreenshot(screenshotOptions).then((result) => {
3832
+ // 获取base64格式的url字符串
3833
+ console.log("dataUrl:", result.dataUrl)
3834
+ })</code></pre>
3835
+
3836
+
3837
+
3838
+ </div>
3839
+
3840
+ <div class="member">
3841
+
3842
+
3843
+
3844
+ <h4 class="name" id="toJSON">
3845
+ <a class="href-link" href="#toJSON">#</a>
3846
+
3847
+ <span class="code-name" style="font-size:30px">
3848
+
3849
+ toJSON<span class="signature">()</span>
3850
+
3851
+ </span>
3852
+ </h4>
3853
+
3854
+
3855
+
3856
+ <div class="description">
3857
+ <p><a id='toJSON'></a>
3858
+ 导出场景视图的配置文件</p>
3859
+ </div>
3860
+
3861
+
3862
+
3863
+
3864
+
3865
+
3866
+
3867
+
3868
+
3869
+
3870
+
3871
+
3872
+
3873
+
3874
+ <dl class="details">
3875
+
3876
+
3877
+
3878
+
3879
+
3880
+
3881
+
3882
+
3883
+
3884
+
3885
+
3886
+
3887
+
3888
+
3889
+
3890
+
3891
+
3892
+
3893
+
3894
+
3895
+
3896
+
3897
+
3898
+
3899
+
3900
+
3901
+
3902
+
3903
+
3904
+
3905
+
3906
+ </dl>
3907
+
3908
+
3909
+
3910
+
3911
+
3912
+
3913
+
3914
+
3915
+
3916
+
3917
+
3918
+
3919
+
3920
+
3921
+
3922
+
3923
+
3924
+
3925
+ <div class='columns method-parameter'>
3926
+ <div class="column is-2"><label>返回值:</label></div>
3927
+ <div class="column is-10">
3928
+
3929
+
3930
+
3931
+ <div class="columns">
3932
+
3933
+ <div class='param-desc column is-7'><p>导出的配置文件</p></div>
3934
+
3935
+
3936
+ <div class='column is-5 has-text-left'>
3937
+ <label>类型: </label>
3938
+
3939
+ <span class="param-type">Object</span>
3940
+
3941
+
3942
+ </div>
3943
+
3944
+ </div>
3945
+
3946
+
3947
+ </div>
3948
+ </div>
3949
+
3950
+
3951
+
3952
+
3953
+
3954
+
3955
+ </div>
3956
+
3957
+ <div class="member">
3958
+
3959
+
3960
+
3961
+ <h4 class="name" id="toMap">
3962
+ <a class="href-link" href="#toMap">#</a>
3963
+
3964
+ <span class="code-name" style="font-size:30px">
3965
+
3966
+ toMap<span class="signature">(screenPoint)</span>
3967
+
3968
+ </span>
3969
+ </h4>
3970
+
3971
+
3972
+
3973
+ <div class="description">
3974
+ <p><a id='toMap'></a>
3975
+ 屏幕像素坐标点转地理坐标点</p>
3976
+ </div>
3977
+
3978
+
3979
+
3980
+
3981
+
3982
+
3983
+
3984
+
3985
+
3986
+
3987
+ <h4>参数:</h4>
3988
+
3989
+ <div class="table-container">
3990
+ <table class="params table">
3991
+ <thead>
3992
+ <tr>
3993
+
3994
+ <th>名称</th>
3995
+
3996
+
3997
+ <th>类型</th>
3998
+
3999
+
4000
+
4001
+ <th class="last">描述</th>
4002
+ </tr>
4003
+ </thead>
4004
+
4005
+ <tbody>
4006
+
4007
+
4008
+
4009
+ <tr class="deep-level-0">
4010
+
4011
+ <td class="name"><code>screenPoint</code></td>
4012
+
4013
+
4014
+ <td class="type">
4015
+
4016
+
4017
+ <span class="param-type">Object</span>
4018
+
4019
+
4020
+
4021
+ </td>
4022
+
4023
+
4024
+
4025
+ <td class="description last"><p>屏幕像素坐标点,例如{ x: 900, y: 500 }</p></td>
4026
+ </tr>
4027
+
4028
+
4029
+
4030
+
4031
+ </tbody>
4032
+ </table>
4033
+ </div>
4034
+
4035
+
4036
+
4037
+
4038
+
4039
+
4040
+ <dl class="details">
4041
+
4042
+
4043
+
4044
+
4045
+
4046
+
4047
+
4048
+
4049
+
4050
+
4051
+
4052
+
4053
+
4054
+
4055
+
4056
+
4057
+
4058
+
4059
+
4060
+
4061
+
4062
+
4063
+
4064
+
4065
+
4066
+
4067
+
4068
+
4069
+
4070
+
4071
+
4072
+ </dl>
4073
+
4074
+
4075
+
4076
+
4077
+
4078
+
4079
+
4080
+
4081
+
4082
+
4083
+
4084
+
4085
+
4086
+
4087
+
4088
+
4089
+
4090
+
4091
+ <div class='columns method-parameter'>
4092
+ <div class="column is-2"><label>返回值:</label></div>
4093
+ <div class="column is-10">
4094
+
4095
+
4096
+
4097
+ <div class="columns">
4098
+
4099
+ <div class='param-desc column is-7'><p>地理坐标点</p></div>
4100
+
4101
+
4102
+ <div class='column is-5 has-text-left'>
4103
+ <label>类型: </label>
4104
+
4105
+ <span class="param-type">Point</span>
4106
+
4107
+
4108
+ </div>
4109
+
4110
+ </div>
4111
+
4112
+
4113
+ </div>
4114
+ </div>
4115
+
4116
+
4117
+
4118
+
4119
+
4120
+
4121
+ <h5>示例</h5>
4122
+
4123
+ <p class="code-caption"><h5>屏幕像素坐标点转地理坐标示例</h5></p>
4124
+
4125
+
4126
+ <pre class="prettyprint"><code>// ES5引入方式
4127
+ const { Map } = zondy
4128
+ const { Point, Extent } = zondy.geometry
4129
+ const { MapView } = zondy.mapboxgl
4130
+ // ES6引入方式
4131
+ import { MapView } from "@mapgis/webclient-mapboxgl-plugin"
4132
+ import { Map, Point, Extent } from "@mapgis/webclient-common"
4133
+ // 初始化图层管理容器
4134
+ const map = new Map();
4135
+ // 初始化地图视图对象
4136
+ const mapView = new MapView({
4137
+ // 视图id
4138
+ viewId: "mapgis-2d-viewer",
4139
+ // 图层管理容器
4140
+ map: map
4141
+ });
4142
+ const screenPoint = { x: 900, y: 500 }
4143
+ mapView.toMap(screenPoint)</code></pre>
4144
+
4145
+
4146
+
4147
+ </div>
4148
+
4149
+ <div class="member">
4150
+
4151
+
4152
+
4153
+ <h4 class="name" id="toScreen">
4154
+ <a class="href-link" href="#toScreen">#</a>
4155
+
4156
+ <span class="code-name" style="font-size:30px">
4157
+
4158
+ toScreen<span class="signature">(point)</span>
4159
+
4160
+ </span>
4161
+ </h4>
4162
+
4163
+
4164
+
4165
+ <div class="description">
4166
+ <p><a id='toScreen'></a>
4167
+ 地理坐标点转屏幕像素坐标点</p>
4168
+ </div>
4169
+
4170
+
4171
+
4172
+
4173
+
4174
+
4175
+
4176
+
4177
+
4178
+
4179
+ <h4>参数:</h4>
4180
+
4181
+ <div class="table-container">
4182
+ <table class="params table">
4183
+ <thead>
4184
+ <tr>
4185
+
4186
+ <th>名称</th>
4187
+
4188
+
4189
+ <th>类型</th>
4190
+
4191
+
4192
+
4193
+ <th class="last">描述</th>
4194
+ </tr>
4195
+ </thead>
4196
+
4197
+ <tbody>
4198
+
4199
+
4200
+
4201
+ <tr class="deep-level-0">
4202
+
4203
+ <td class="name"><code>point</code></td>
4204
+
4205
+
4206
+ <td class="type">
4207
+
4208
+
4209
+ <span class="param-type">Point</span>
4210
+
4211
+
4212
+
4213
+ </td>
4214
+
4215
+
4216
+
4217
+ <td class="description last"><p>地理坐标点</p></td>
4218
+ </tr>
4219
+
4220
+
4221
+
4222
+
4223
+ </tbody>
4224
+ </table>
4225
+ </div>
4226
+
4227
+
4228
+
4229
+
4230
+
4231
+
4232
+ <dl class="details">
4233
+
4234
+
4235
+
4236
+
4237
+
4238
+
4239
+
4240
+
4241
+
4242
+
4243
+
4244
+
4245
+
4246
+
4247
+
4248
+
4249
+
4250
+
4251
+
4252
+
4253
+
4254
+
4255
+
4256
+
4257
+
4258
+
4259
+
4260
+
4261
+
4262
+
4263
+
4264
+ </dl>
4265
+
4266
+
4267
+
4268
+
4269
+
4270
+
4271
+
4272
+
4273
+
4274
+
4275
+
4276
+
4277
+
4278
+
4279
+
4280
+
4281
+
4282
+
4283
+ <div class='columns method-parameter'>
4284
+ <div class="column is-2"><label>返回值:</label></div>
4285
+ <div class="column is-10">
4286
+
4287
+
4288
+
4289
+ <div class="columns">
4290
+
4291
+ <div class='param-desc column is-7'><p>屏幕像素坐标点</p></div>
4292
+
4293
+
4294
+ <div class='column is-5 has-text-left'>
4295
+ <label>类型: </label>
4296
+
4297
+ <span class="param-type">Object</span>
4298
+
4299
+
4300
+ </div>
4301
+
4302
+ </div>
4303
+
4304
+
4305
+ </div>
4306
+ </div>
4307
+
4308
+
4309
+
4310
+
4311
+
4312
+
4313
+ <h5>示例</h5>
4314
+
4315
+ <p class="code-caption"><h5>地理坐标点转屏幕像素坐标示例</h5></p>
4316
+
4317
+
4318
+ <pre class="prettyprint"><code>// ES5引入方式
4319
+ const { Map } = zondy
4320
+ const { Point, Extent } = zondy.geometry
4321
+ const { MapView } = zondy.mapboxgl
4322
+ // ES6引入方式
4323
+ import { MapView } from "@mapgis/webclient-mapboxgl-plugin"
4324
+ import { Map, Point, Extent } from "@mapgis/webclient-common"
4325
+ // 初始化图层管理容器
4326
+ const map = new Map();
4327
+ // 初始化地图视图对象
4328
+ const mapView = new MapView({
4329
+ // 视图id
4330
+ viewId: "mapgis-2d-viewer",
4331
+ // 图层管理容器
4332
+ map: map
4333
+ });
4334
+ const geoPoint = new Point({ coordinates: [123, 23, 0] })
4335
+ mapView.toScreen(geoPoint)</code></pre>
4336
+
4337
+
4338
+
4339
+ </div>
4340
+
4341
+ </div>
4342
+ </div>
4343
+
1660
4344
 
1661
4345
 
1662
4346