@mapgis/webclient-mapboxgl-plugin 17.4.0 → 17.4.8

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