@vtx/ol-map 1.0.85 → 1.0.87

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.
Files changed (330) hide show
  1. package/CHANGELOG.md +217 -0
  2. package/README.md +205 -205
  3. package/lib/_util/EventEmitter.js +3 -2
  4. package/lib/_util/EventEmitter.js.map +1 -1
  5. package/lib/_util/StyleCache.js +3 -2
  6. package/lib/_util/StyleCache.js.map +1 -1
  7. package/lib/_util/encryptParams.js +3 -2
  8. package/lib/_util/encryptParams.js.map +1 -1
  9. package/lib/_util/filterSpecialCharacters.js +6 -6
  10. package/lib/_util/filterSpecialCharacters.js.map +1 -1
  11. package/lib/_util/getComponentProps.js +1 -1
  12. package/lib/_util/getComponentProps.js.map +1 -1
  13. package/lib/_util/getCookie.js +6 -5
  14. package/lib/_util/getCookie.js.map +1 -1
  15. package/lib/_util/getDefaultMapInfo.js +5 -4
  16. package/lib/_util/getDefaultMapInfo.js.map +1 -1
  17. package/lib/_util/getSystemInfo.js +5 -4
  18. package/lib/_util/getSystemInfo.js.map +1 -1
  19. package/lib/_util/getToken.js +4 -2
  20. package/lib/_util/getToken.js.map +1 -1
  21. package/lib/_util/getUrlParam.js +2 -1
  22. package/lib/_util/getUrlParam.js.map +1 -1
  23. package/lib/_util/http.js +23 -22
  24. package/lib/_util/http.js.map +1 -1
  25. package/lib/_util/isFunction.js.map +1 -1
  26. package/lib/_util/isObject.js.map +1 -1
  27. package/lib/_util/layer.js +33 -29
  28. package/lib/_util/layer.js.map +1 -1
  29. package/lib/_util/mapTool.js +37 -36
  30. package/lib/_util/mapTool.js.map +1 -1
  31. package/lib/_util/projzh/datum/bd-09.js +2 -1
  32. package/lib/_util/projzh/datum/bd-09.js.map +1 -1
  33. package/lib/_util/projzh/datum/gcj-02.js +2 -1
  34. package/lib/_util/projzh/datum/gcj-02.js.map +1 -1
  35. package/lib/_util/projzh/datum/index.js +2 -1
  36. package/lib/_util/projzh/datum/index.js.map +1 -1
  37. package/lib/_util/projzh/index.js +2 -1
  38. package/lib/_util/projzh/index.js.map +1 -1
  39. package/lib/_util/projzh/projection/baidu-mercator.js +2 -1
  40. package/lib/_util/projzh/projection/baidu-mercator.js.map +1 -1
  41. package/lib/_util/projzh/projection/index.js +2 -1
  42. package/lib/_util/projzh/projection/index.js.map +1 -1
  43. package/lib/_util/projzh/projection/spherical-mercator.js +2 -1
  44. package/lib/_util/projzh/projection/spherical-mercator.js.map +1 -1
  45. package/lib/_util/projzh/util.js +2 -1
  46. package/lib/_util/projzh/util.js.map +1 -1
  47. package/lib/_util/search.js +10 -7
  48. package/lib/_util/search.js.map +1 -1
  49. package/lib/_util/setCookie.js +6 -5
  50. package/lib/_util/setCookie.js.map +1 -1
  51. package/lib/_util/transform.js +5 -4
  52. package/lib/_util/transform.js.map +1 -1
  53. package/lib/_util/useColSize.js +2 -1
  54. package/lib/_util/useColSize.js.map +1 -1
  55. package/lib/_util/useInterval.js.map +1 -1
  56. package/lib/_util/useSet.js +6 -5
  57. package/lib/_util/useSet.js.map +1 -1
  58. package/lib/analysis-layer/index.js +36 -31
  59. package/lib/analysis-layer/index.js.map +1 -1
  60. package/lib/buffer-draw/BufferDraw.js +5 -4
  61. package/lib/buffer-draw/BufferDraw.js.map +1 -1
  62. package/lib/buffer-draw/index.js +8 -8
  63. package/lib/buffer-draw/index.js.map +1 -1
  64. package/lib/circle/Circle.js +5 -4
  65. package/lib/circle/Circle.js.map +1 -1
  66. package/lib/circle/index.js +3 -3
  67. package/lib/circle/index.js.map +1 -1
  68. package/lib/config.js +2 -1
  69. package/lib/config.js.map +1 -1
  70. package/lib/dom/Dom.js +3 -2
  71. package/lib/dom/Dom.js.map +1 -1
  72. package/lib/dom/index.js +5 -5
  73. package/lib/dom/index.js.map +1 -1
  74. package/lib/events/index.js +4 -2
  75. package/lib/events/index.js.map +1 -1
  76. package/lib/feature-draw/FeatureDraw.js +11 -9
  77. package/lib/feature-draw/FeatureDraw.js.map +1 -1
  78. package/lib/feature-draw/index.js +7 -7
  79. package/lib/feature-draw/index.js.map +1 -1
  80. package/lib/feature-layer/FeatureLayer.js +101 -92
  81. package/lib/feature-layer/FeatureLayer.js.map +1 -1
  82. package/lib/feature-layer/createFeatureCollection.js +35 -27
  83. package/lib/feature-layer/createFeatureCollection.js.map +1 -1
  84. package/lib/feature-layer/index.js +6 -6
  85. package/lib/feature-layer/index.js.map +1 -1
  86. package/lib/feature-layer/style/css.js.map +1 -1
  87. package/lib/feature-layer/style/index.js.map +1 -1
  88. package/lib/flow-line-layer/FlowLineLayer.js +5 -4
  89. package/lib/flow-line-layer/FlowLineLayer.js.map +1 -1
  90. package/lib/flow-line-layer/index.js +6 -6
  91. package/lib/flow-line-layer/index.js.map +1 -1
  92. package/lib/flow-line-layer/style/css.js.map +1 -1
  93. package/lib/flow-line-layer/style/index.js.map +1 -1
  94. package/lib/fly-line-layer/FlyLineLayer.js +5 -4
  95. package/lib/fly-line-layer/FlyLineLayer.js.map +1 -1
  96. package/lib/fly-line-layer/index.js +4 -4
  97. package/lib/fly-line-layer/index.js.map +1 -1
  98. package/lib/fly-line-layer/style/css.js.map +1 -1
  99. package/lib/fly-line-layer/style/index.js.map +1 -1
  100. package/lib/group-layer/GroupLayer.js +3 -2
  101. package/lib/group-layer/GroupLayer.js.map +1 -1
  102. package/lib/group-layer/index.js +4 -4
  103. package/lib/group-layer/index.js.map +1 -1
  104. package/lib/group-layer/style/css.js.map +1 -1
  105. package/lib/group-layer/style/index.js.map +1 -1
  106. package/lib/heatmap-layer/HeatmapLayer.js +5 -4
  107. package/lib/heatmap-layer/HeatmapLayer.js.map +1 -1
  108. package/lib/heatmap-layer/index.js +4 -4
  109. package/lib/heatmap-layer/index.js.map +1 -1
  110. package/lib/heatmap-layer/style/css.js.map +1 -1
  111. package/lib/heatmap-layer/style/index.js.map +1 -1
  112. package/lib/high-layer/HighLayer.js +7 -6
  113. package/lib/high-layer/HighLayer.js.map +1 -1
  114. package/lib/high-layer/index.js +7 -6
  115. package/lib/high-layer/index.js.map +1 -1
  116. package/lib/image-layer/ImageLayer.js +5 -4
  117. package/lib/image-layer/ImageLayer.js.map +1 -1
  118. package/lib/image-layer/index.js +5 -5
  119. package/lib/image-layer/index.js.map +1 -1
  120. package/lib/image-layer/style/css.js.map +1 -1
  121. package/lib/image-layer/style/index.js.map +1 -1
  122. package/lib/index.js.map +1 -1
  123. package/lib/legend/index.js +10 -8
  124. package/lib/legend/index.js.map +1 -1
  125. package/lib/legend/style/css.js.map +1 -1
  126. package/lib/legend/style/index.js.map +1 -1
  127. package/lib/legend/style/index.less +60 -60
  128. package/lib/map/Analysis.js +3 -2
  129. package/lib/map/Analysis.js.map +1 -1
  130. package/lib/map/Layers.js +4 -3
  131. package/lib/map/Layers.js.map +1 -1
  132. package/lib/map/Popup.js +12 -11
  133. package/lib/map/Popup.js.map +1 -1
  134. package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js +2 -1
  135. package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js.map +1 -1
  136. package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js +2 -1
  137. package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js.map +1 -1
  138. package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js +5 -3
  139. package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js.map +1 -1
  140. package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js +5 -3
  141. package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js.map +1 -1
  142. package/lib/map/getBaseLayers/index.js +5 -3
  143. package/lib/map/getBaseLayers/index.js.map +1 -1
  144. package/lib/map/index.js +27 -22
  145. package/lib/map/index.js.map +1 -1
  146. package/lib/map/style/css.js.map +1 -1
  147. package/lib/map/style/index.js.map +1 -1
  148. package/lib/map/style/index.less +99 -99
  149. package/lib/map-icon/svg/index.js +2 -1
  150. package/lib/map-icon/svg/index.js.map +1 -1
  151. package/lib/marker/Marker.js +7 -5
  152. package/lib/marker/Marker.js.map +1 -1
  153. package/lib/marker/index.js +3 -3
  154. package/lib/marker/index.js.map +1 -1
  155. package/lib/path-line-layer/PathLineLayer.js +5 -4
  156. package/lib/path-line-layer/PathLineLayer.js.map +1 -1
  157. package/lib/path-line-layer/getPathLineStyles.js +5 -4
  158. package/lib/path-line-layer/getPathLineStyles.js.map +1 -1
  159. package/lib/path-line-layer/index.js +6 -6
  160. package/lib/path-line-layer/index.js.map +1 -1
  161. package/lib/path-line-layer/style/css.js.map +1 -1
  162. package/lib/path-line-layer/style/index.js.map +1 -1
  163. package/lib/path-play-back/PathPlayBack.js +7 -6
  164. package/lib/path-play-back/PathPlayBack.js.map +1 -1
  165. package/lib/path-play-back/index.js +5 -4
  166. package/lib/path-play-back/index.js.map +1 -1
  167. package/lib/poi-search/Location.js +4 -4
  168. package/lib/poi-search/Location.js.map +1 -1
  169. package/lib/poi-search/PoiList.js +4 -4
  170. package/lib/poi-search/PoiList.js.map +1 -1
  171. package/lib/poi-search/Search.js +9 -9
  172. package/lib/poi-search/Search.js.map +1 -1
  173. package/lib/poi-search/index.js +6 -5
  174. package/lib/poi-search/index.js.map +1 -1
  175. package/lib/poi-search/style/css.js.map +1 -1
  176. package/lib/poi-search/style/index.js.map +1 -1
  177. package/lib/poi-search/style/index.less +97 -97
  178. package/lib/point/Point.js +5 -4
  179. package/lib/point/Point.js.map +1 -1
  180. package/lib/point/index.js +3 -3
  181. package/lib/point/index.js.map +1 -1
  182. package/lib/polygon/Polygon.js +5 -4
  183. package/lib/polygon/Polygon.js.map +1 -1
  184. package/lib/polygon/index.js +3 -3
  185. package/lib/polygon/index.js.map +1 -1
  186. package/lib/polyline/Polyline.js +5 -4
  187. package/lib/polyline/Polyline.js.map +1 -1
  188. package/lib/polyline/index.js +3 -3
  189. package/lib/polyline/index.js.map +1 -1
  190. package/lib/popup/index.js +7 -6
  191. package/lib/popup/index.js.map +1 -1
  192. package/lib/popup/style/css.js.map +1 -1
  193. package/lib/popup/style/index.js.map +1 -1
  194. package/lib/popup/style/index.less +128 -128
  195. package/lib/provider/index.js +4 -2
  196. package/lib/provider/index.js.map +1 -1
  197. package/lib/renderer/Fill.js +3 -2
  198. package/lib/renderer/Fill.js.map +1 -1
  199. package/lib/renderer/Stroke.js +3 -2
  200. package/lib/renderer/Stroke.js.map +1 -1
  201. package/lib/renderer/index.js +9 -7
  202. package/lib/renderer/index.js.map +1 -1
  203. package/lib/renderer/style/css.js.map +1 -1
  204. package/lib/renderer/style/index.js.map +1 -1
  205. package/lib/renderer/transformRgb.js +2 -1
  206. package/lib/renderer/transformRgb.js.map +1 -1
  207. package/lib/search-map/VtxModal.js +5 -4
  208. package/lib/search-map/VtxModal.js.map +1 -1
  209. package/lib/search-map/index.js +6 -5
  210. package/lib/search-map/index.js.map +1 -1
  211. package/lib/search-map/style/css.js.map +1 -1
  212. package/lib/search-map/style/index.js.map +1 -1
  213. package/lib/search-map/style/index.less +71 -71
  214. package/lib/search-map/style/modal.less +58 -58
  215. package/lib/style/index.less +2 -2
  216. package/lib/style/themes/compact.less +1 -1
  217. package/lib/style/themes/dark.less +9 -9
  218. package/lib/style/themes/default.less +7 -7
  219. package/lib/style/themes/index.less +1 -1
  220. package/lib/style/themes/variable.less +5 -5
  221. package/lib/tile-layer/TileLayer.js +5 -4
  222. package/lib/tile-layer/TileLayer.js.map +1 -1
  223. package/lib/tile-layer/index.js +3 -3
  224. package/lib/tile-layer/index.js.map +1 -1
  225. package/lib/tile-layer/style/css.js.map +1 -1
  226. package/lib/tile-layer/style/index.js.map +1 -1
  227. package/lib/tools/Layer/LayerService.js +5 -4
  228. package/lib/tools/Layer/LayerService.js.map +1 -1
  229. package/lib/tools/Layer/LayersCheckService.js +15 -9
  230. package/lib/tools/Layer/LayersCheckService.js.map +1 -1
  231. package/lib/tools/Layer/index.js +6 -6
  232. package/lib/tools/Layer/index.js.map +1 -1
  233. package/lib/tools/Layer/index.less +43 -43
  234. package/lib/tools/Search/index.js +16 -15
  235. package/lib/tools/Search/index.js.map +1 -1
  236. package/lib/tools/Toolbox/BoxSelect/index.js +4 -3
  237. package/lib/tools/Toolbox/BoxSelect/index.js.map +1 -1
  238. package/lib/tools/Toolbox/CircleSelect/index.js +4 -3
  239. package/lib/tools/Toolbox/CircleSelect/index.js.map +1 -1
  240. package/lib/tools/Toolbox/EagleEye/index.js +6 -5
  241. package/lib/tools/Toolbox/EagleEye/index.js.map +1 -1
  242. package/lib/tools/Toolbox/MapBookmark/Bookmark.js +8 -7
  243. package/lib/tools/Toolbox/MapBookmark/Bookmark.js.map +1 -1
  244. package/lib/tools/Toolbox/MapBookmark/index.js +16 -15
  245. package/lib/tools/Toolbox/MapBookmark/index.js.map +1 -1
  246. package/lib/tools/Toolbox/MapBookmark/index.less +20 -20
  247. package/lib/tools/Toolbox/MapDownload/index.js.map +1 -1
  248. package/lib/tools/Toolbox/MapPrint/index.js +10 -10
  249. package/lib/tools/Toolbox/MapPrint/index.js.map +1 -1
  250. package/lib/tools/Toolbox/MapPrint/index.less +4 -4
  251. package/lib/tools/Toolbox/Measure/Area/index.js +2 -1
  252. package/lib/tools/Toolbox/Measure/Area/index.js.map +1 -1
  253. package/lib/tools/Toolbox/Measure/Distance/index.js +2 -1
  254. package/lib/tools/Toolbox/Measure/Distance/index.js.map +1 -1
  255. package/lib/tools/Toolbox/Measure/Measure.js +3 -2
  256. package/lib/tools/Toolbox/Measure/Measure.js.map +1 -1
  257. package/lib/tools/Toolbox/Measure/index.js +6 -5
  258. package/lib/tools/Toolbox/Measure/index.js.map +1 -1
  259. package/lib/tools/Toolbox/PolygonSelect/index.js +4 -3
  260. package/lib/tools/Toolbox/PolygonSelect/index.js.map +1 -1
  261. package/lib/tools/Toolbox/ScaleLine/index.js +6 -5
  262. package/lib/tools/Toolbox/ScaleLine/index.js.map +1 -1
  263. package/lib/tools/Toolbox/SelectTools/index.js +22 -21
  264. package/lib/tools/Toolbox/SelectTools/index.js.map +1 -1
  265. package/lib/tools/Toolbox/SelectTools/index.less +43 -43
  266. package/lib/tools/Toolbox/SpaceQuery/index.js +5 -5
  267. package/lib/tools/Toolbox/SpaceQuery/index.js.map +1 -1
  268. package/lib/tools/Toolbox/SpaceQuery/index.less +16 -16
  269. package/lib/tools/Toolbox/ZoomInput/index.js +6 -5
  270. package/lib/tools/Toolbox/ZoomInput/index.js.map +1 -1
  271. package/lib/tools/Toolbox/ZoomInput/index.less +5 -5
  272. package/lib/tools/Toolbox/index.js +9 -7
  273. package/lib/tools/Toolbox/index.js.map +1 -1
  274. package/lib/tools/Toolbox/index.less +2 -2
  275. package/lib/tools/Utils/CreateOverlay.js +5 -4
  276. package/lib/tools/Utils/CreateOverlay.js.map +1 -1
  277. package/lib/tools/Utils/Draw.js +11 -9
  278. package/lib/tools/Utils/Draw.js.map +1 -1
  279. package/lib/tools/Utils/HighLayer.js +7 -6
  280. package/lib/tools/Utils/HighLayer.js.map +1 -1
  281. package/lib/tools/Utils/measure.js +2 -1
  282. package/lib/tools/Utils/measure.js.map +1 -1
  283. package/lib/tools/Utils/utils.js +35 -27
  284. package/lib/tools/Utils/utils.js.map +1 -1
  285. package/lib/tools/View/index.js +8 -7
  286. package/lib/tools/View/index.js.map +1 -1
  287. package/lib/tools/View/index.less +28 -28
  288. package/lib/tools/analysis-tool/index.js +10 -9
  289. package/lib/tools/analysis-tool/index.js.map +1 -1
  290. package/lib/tools/base-map-switch/index.js +8 -7
  291. package/lib/tools/base-map-switch/index.js.map +1 -1
  292. package/lib/tools/components/Icon/index.js +2 -1
  293. package/lib/tools/components/Icon/index.js.map +1 -1
  294. package/lib/tools/components/ItemWrap/index.js +6 -5
  295. package/lib/tools/components/ItemWrap/index.js.map +1 -1
  296. package/lib/tools/components/ItemWrap/index.less +41 -41
  297. package/lib/tools/components/Modal/index.js +7 -6
  298. package/lib/tools/components/Modal/index.js.map +1 -1
  299. package/lib/tools/components/Modal/index.less +33 -33
  300. package/lib/tools/components/MyTabs/index.js.map +1 -1
  301. package/lib/tools/components/RequiredLabel/index.js +3 -3
  302. package/lib/tools/components/RequiredLabel/index.js.map +1 -1
  303. package/lib/tools/components/RequiredLabel/index.less +5 -5
  304. package/lib/tools/components/Select/index.js +2 -1
  305. package/lib/tools/components/Select/index.js.map +1 -1
  306. package/lib/tools/components/Table/index.js +7 -6
  307. package/lib/tools/components/Table/index.js.map +1 -1
  308. package/lib/tools/components/Table/index.less +13 -13
  309. package/lib/tools/components/ToolItem/index.js +2 -1
  310. package/lib/tools/components/ToolItem/index.js.map +1 -1
  311. package/lib/tools/components/ToolItem/index.less +27 -27
  312. package/lib/tools/components/ToolsSelect/index.js +2 -1
  313. package/lib/tools/components/ToolsSelect/index.js.map +1 -1
  314. package/lib/tools/components/ToolsSelect/index.less +10 -10
  315. package/lib/tools/full-screen/index.js +6 -5
  316. package/lib/tools/full-screen/index.js.map +1 -1
  317. package/lib/tools/index.js +4 -4
  318. package/lib/tools/index.js.map +1 -1
  319. package/lib/tools/layer-control/index.js +12 -9
  320. package/lib/tools/layer-control/index.js.map +1 -1
  321. package/lib/tools/refresh/index.js +7 -6
  322. package/lib/tools/refresh/index.js.map +1 -1
  323. package/lib/tools/style/css.js.map +1 -1
  324. package/lib/tools/style/index.js.map +1 -1
  325. package/lib/tools/style/index.less +144 -144
  326. package/lib/tools-item/index.js +6 -5
  327. package/lib/tools-item/index.js.map +1 -1
  328. package/lib/use-props/index.js +2 -1
  329. package/lib/use-props/index.js.map +1 -1
  330. package/package.json +119 -119
@@ -15,15 +15,15 @@ var _isObject = _interopRequireDefault(require("../_util/isObject"));
15
15
  var _encryptParams = _interopRequireDefault(require("../_util/encryptParams"));
16
16
  var _excluded = ["url", "params", "data", "dataField", "features", "sourceOptions", "key", "name", "label", "labelField", "point", "cluster", "template", "autoRefresh", "method", "layerControl", "show", "style", "group", "iconOptions", "afterGetData", "legend", "viewOnly", "encrypt", "valueField", "map"];
17
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
18
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
18
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
19
19
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
20
20
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
21
21
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
22
22
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
23
23
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
24
24
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
25
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
26
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
25
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
26
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
27
27
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
28
28
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
29
29
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -47,7 +47,7 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
47
47
  _inherits(FeatureLayer, _Vector);
48
48
  var _super = _createSuper(FeatureLayer);
49
49
  function FeatureLayer(options) {
50
- var _thisSuper, _this;
50
+ var _thisSuper, _this2;
51
51
  _classCallCheck(this, FeatureLayer);
52
52
  var url = options.url,
53
53
  params = options.params,
@@ -91,8 +91,8 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
91
91
  });
92
92
  }
93
93
  }
94
- _this = _super.call(this, props);
95
- _defineProperty(_assertThisInitialized(_this), "getClusterTextStyle", function (size) {
94
+ _this2 = _super.call(this, props);
95
+ _defineProperty(_assertThisInitialized(_this2), "getClusterTextStyle", function (size) {
96
96
  return new _style3.Text({
97
97
  text: String(size),
98
98
  font: '18px Calibri,sans-serif',
@@ -107,8 +107,8 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
107
107
  offsetX: 16
108
108
  });
109
109
  });
110
- _defineProperty(_assertThisInitialized(_this), "getLabelStyle", function (feature, color) {
111
- var labelField = _this._options.labelField;
110
+ _defineProperty(_assertThisInitialized(_this2), "getLabelStyle", function (feature, color) {
111
+ var labelField = _this2._options.labelField;
112
112
 
113
113
  // 判断是否是聚合点位
114
114
  if (feature.isCluster) {
@@ -139,87 +139,90 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
139
139
  });
140
140
  }
141
141
  });
142
- _set((_thisSuper = _assertThisInitialized(_this), _getPrototypeOf(FeatureLayer.prototype)), "show", show, _thisSuper, true);
142
+ _set((_thisSuper = _assertThisInitialized(_this2), _getPrototypeOf(FeatureLayer.prototype)), "show", show, _thisSuper, true);
143
143
  // 参数
144
- _this._options = options;
144
+ _this2._options = options;
145
145
 
146
146
  // 地图
147
- _this.map = map;
147
+ _this2.map = map;
148
148
 
149
149
  // 接口地址
150
- _this.url = url;
150
+ _this2.url = url;
151
151
 
152
152
  // 接口地址请求类型
153
- _this.method = method;
153
+ _this2.method = method;
154
154
 
155
155
  // 接口查询参数
156
- _this.params = params;
156
+ _this2.params = params;
157
157
 
158
158
  // 图层标识
159
- _this.key = key;
159
+ _this2.key = key;
160
160
 
161
161
  // 图层名称
162
- _this.name = name;
162
+ _this2.name = name;
163
163
 
164
164
  // 标签
165
- _this.label = label;
165
+ _this2.label = label;
166
166
 
167
167
  // 标签字段
168
- _this.labelField = _labelField;
168
+ _this2.labelField = _labelField;
169
169
 
170
170
  // 聚合
171
- _this.cluster = cluster;
171
+ _this2.cluster = cluster;
172
172
 
173
173
  // 聚合距离
174
- _this.distance = (cluster === null || cluster === void 0 ? void 0 : cluster.distance) || 80;
174
+ _this2.distance = (cluster === null || cluster === void 0 ? void 0 : cluster.distance) || 80;
175
175
 
176
176
  // 海量点
177
- _this.point = point;
177
+ _this2.point = point;
178
178
 
179
179
  // 自动刷新标识
180
- _this.autoRefresh = autoRefresh;
180
+ _this2.autoRefresh = autoRefresh;
181
181
 
182
182
  // 模版内容
183
- _this.template = template;
183
+ _this2.template = template;
184
184
 
185
185
  // 图层控制
186
- _this.layerControl = layerControl;
186
+ _this2.layerControl = layerControl;
187
187
 
188
188
  // 过滤
189
- _this.group = group;
189
+ _this2.group = group;
190
190
 
191
191
  // 处理获取的数据
192
- _this.afterGetData = afterGetData;
192
+ _this2.afterGetData = afterGetData;
193
193
 
194
194
  // 数据查询字段
195
- _this.valueField = valueField;
195
+ _this2.valueField = valueField;
196
196
 
197
197
  // 图例
198
- _this.legend = legend;
198
+ _this2.legend = legend;
199
199
 
200
200
  // 样式
201
- _this.style = style;
201
+ _this2.style = style;
202
202
 
203
203
  // 数据
204
- _this.data = data;
204
+ _this2.data = data;
205
205
 
206
206
  // 数据取值字段
207
- _this.dataField = dataField || 'geometryInfo';
207
+ _this2.dataField = dataField || 'geometryInfo';
208
208
 
209
209
  // 仅展示
210
- _this.viewOnly = viewOnly;
210
+ _this2.viewOnly = viewOnly;
211
211
 
212
212
  // 是否初始化
213
- _this.inited = false;
213
+ _this2.inited = false;
214
214
 
215
215
  // 加密
216
- _this.encrypt = encrypt;
216
+ _this2.encrypt = encrypt;
217
+
218
+ // 临时数据
219
+ _this2._features = [];
217
220
 
218
221
  // 默认是否展示
219
222
  if (defaultShow) {
220
- _this.init();
223
+ _this2.init();
221
224
  }
222
- return _this;
225
+ return _this2;
223
226
  }
224
227
 
225
228
  // 初始化数据
@@ -282,15 +285,15 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
282
285
  }, {
283
286
  key: "getStyleByMode",
284
287
  value: function getStyleByMode() {
285
- var _this2 = this;
288
+ var _this3 = this;
286
289
  return function (feature, resolution) {
287
- var _this2$group;
288
- var _this2$_options = _this2._options,
289
- style = _this2$_options.style,
290
- cluster = _this2$_options.cluster,
291
- otherStyle = _this2$_options.otherStyle;
290
+ var _this3$group;
291
+ var _this3$_options = _this3._options,
292
+ style = _this3$_options.style,
293
+ cluster = _this3$_options.cluster,
294
+ otherStyle = _this3$_options.otherStyle;
292
295
  var show = true;
293
- (_this2$group = _this2.group) === null || _this2$group === void 0 || _this2$group.map(function (v) {
296
+ (_this3$group = _this3.group) === null || _this3$group === void 0 ? void 0 : _this3$group.map(function (v) {
294
297
  var _v$filter;
295
298
  if (v !== null && v !== void 0 && (_v$filter = v.filter) !== null && _v$filter !== void 0 && _v$filter.call(v, feature.values_)) {
296
299
  style = v.style || style;
@@ -299,6 +302,7 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
299
302
  }
300
303
  }
301
304
  });
305
+ feature.show = show;
302
306
  if (!show) {
303
307
  return null;
304
308
  }
@@ -317,7 +321,7 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
317
321
  }
318
322
  if (style) {
319
323
  if (typeof style === 'string' || (0, _isFunction["default"])(style) && cluster) {
320
- styles.push(new _renderer["default"].Marker(_objectSpread({}, _this2.getMarkerOptions(feature, style))));
324
+ styles.push(new _renderer["default"].Marker(_objectSpread({}, _this3.getMarkerOptions(feature, style))));
321
325
  return styles;
322
326
  } else if (style instanceof _style3.Style) {
323
327
  // 判断是否为 ol Style
@@ -328,7 +332,7 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
328
332
 
329
333
  var _style = style(feature);
330
334
  if (_style !== null && _style !== void 0 && _style.type && _style !== null && _style !== void 0 && _style.style) {
331
- var options = _this2.getSimpleStyle(feature, _style);
335
+ var options = _this3.getSimpleStyle(feature, _style);
332
336
  styles.push(_renderer["default"].Simple(options));
333
337
  return styles;
334
338
  }
@@ -339,7 +343,7 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
339
343
  mode = _style2.mode;
340
344
  if (mode) {
341
345
  if (mode === 'Simple') {
342
- var _options = _this2.getSimpleStyle(feature, style.render);
346
+ var _options = _this3.getSimpleStyle(feature, style.render);
343
347
  styles.push(_renderer["default"].Simple(_options));
344
348
  return styles;
345
349
  }
@@ -347,11 +351,11 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
347
351
  var _feature$get2;
348
352
  var size = ((_feature$get2 = feature.get('features')) === null || _feature$get2 === void 0 ? void 0 : _feature$get2.length) || 0;
349
353
  if (size > 1) {
350
- var _options2 = _this2.getSimpleStyle(feature, style.render.render[0]);
354
+ var _options2 = _this3.getSimpleStyle(feature, style.render.render[0]);
351
355
  styles.push(_renderer["default"].Simple(_options2));
352
356
  return styles;
353
357
  }
354
- var _options3 = _this2.getMultipleStyle(feature, style.render);
358
+ var _options3 = _this3.getMultipleStyle(feature, style.render);
355
359
  styles.push(_renderer["default"].UniqueValue(feature, _options3));
356
360
  return styles;
357
361
  }
@@ -359,16 +363,16 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
359
363
  var _feature$get3;
360
364
  var _size = ((_feature$get3 = feature.get('features')) === null || _feature$get3 === void 0 ? void 0 : _feature$get3.length) || 0;
361
365
  if (_size > 1) {
362
- var _options4 = _this2.getSimpleStyle(feature, style.render.render[0]);
366
+ var _options4 = _this3.getSimpleStyle(feature, style.render.render[0]);
363
367
  styles.push(_renderer["default"].Simple(_options4));
364
368
  return styles;
365
369
  }
366
- var _options5 = _this2.getMultipleStyle(feature, style.render);
370
+ var _options5 = _this3.getMultipleStyle(feature, style.render);
367
371
  styles.push(_renderer["default"].ClassBreaks(feature, _options5));
368
372
  return styles;
369
373
  }
370
374
  } else if (style.style) {
371
- var _options6 = _this2.getSimpleStyle(feature, style);
375
+ var _options6 = _this3.getSimpleStyle(feature, style);
372
376
  styles.push(_renderer["default"].Simple(_options6));
373
377
  return styles;
374
378
  }
@@ -407,11 +411,11 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
407
411
  key: "getMultipleStyle",
408
412
  value: function getMultipleStyle(feature, _render) {
409
413
  var _render$render,
410
- _this3 = this;
414
+ _this4 = this;
411
415
  var render = _objectSpread({}, _render);
412
416
  if (render !== null && render !== void 0 && (_render$render = render.render) !== null && _render$render !== void 0 && _render$render.length) {
413
417
  render.render = render.render.map(function (v) {
414
- return _this3.getSimpleStyle(feature, v);
418
+ return _this4.getSimpleStyle(feature, v);
415
419
  });
416
420
  }
417
421
  return render;
@@ -432,11 +436,11 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
432
436
  var isFun = (0, _isFunction["default"])(style);
433
437
  var data = {};
434
438
  if (isFun) {
435
- var _data, _data2, _data3, _data4, _data5, _data6;
439
+ var _data, _data$style, _data2, _data3, _data3$style, _data4, _data5, _data5$style, _data6;
436
440
  data = style(feature) || {};
437
- icon = ((_data = data) === null || _data === void 0 || (_data = _data.style) === null || _data === void 0 ? void 0 : _data.icon) || ((_data2 = data) === null || _data2 === void 0 ? void 0 : _data2.icon) || icon;
438
- color = ((_data3 = data) === null || _data3 === void 0 || (_data3 = _data3.style) === null || _data3 === void 0 ? void 0 : _data3.color) || ((_data4 = data) === null || _data4 === void 0 ? void 0 : _data4.color) || color;
439
- image = ((_data5 = data) === null || _data5 === void 0 || (_data5 = _data5.style) === null || _data5 === void 0 ? void 0 : _data5.image) || ((_data6 = data) === null || _data6 === void 0 ? void 0 : _data6.image) || image;
441
+ icon = ((_data = data) === null || _data === void 0 ? void 0 : (_data$style = _data.style) === null || _data$style === void 0 ? void 0 : _data$style.icon) || ((_data2 = data) === null || _data2 === void 0 ? void 0 : _data2.icon) || icon;
442
+ color = ((_data3 = data) === null || _data3 === void 0 ? void 0 : (_data3$style = _data3.style) === null || _data3$style === void 0 ? void 0 : _data3$style.color) || ((_data4 = data) === null || _data4 === void 0 ? void 0 : _data4.color) || color;
443
+ image = ((_data5 = data) === null || _data5 === void 0 ? void 0 : (_data5$style = _data5.style) === null || _data5$style === void 0 ? void 0 : _data5$style.image) || ((_data6 = data) === null || _data6 === void 0 ? void 0 : _data6.image) || image;
440
444
  }
441
445
  var size = ((_feature$get4 = feature.get('features')) === null || _feature$get4 === void 0 ? void 0 : _feature$get4.length) || 0;
442
446
  var P = {
@@ -449,20 +453,18 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
449
453
  icon: icon,
450
454
  type: 'PointIcon'
451
455
  },
452
- marker_cluster: _objectSpread(_objectSpread({
456
+ marker_cluster: _objectSpread({
453
457
  // 聚合图标
454
458
  icon: icon,
455
459
  color: size > 1 ? '' : color,
456
460
  iconOptions: size > 1 ? _objectSpread({
457
461
  hideFooter: true,
458
462
  info: {
459
- text: '',
463
+ text: size,
460
464
  fontSize: 18
461
465
  }
462
466
  }, (cluster === null || cluster === void 0 ? void 0 : cluster.iconOptions) || {}) : {}
463
- }, size > 1 ? cluster === null || cluster === void 0 ? void 0 : cluster.style : cluster === null || cluster === void 0 ? void 0 : cluster.commonStyle), {}, {
464
- image: size > 1 ? '' : image || ''
465
- }),
467
+ }, size > 1 ? cluster === null || cluster === void 0 ? void 0 : cluster.style : cluster === null || cluster === void 0 ? void 0 : cluster.commonStyle),
466
468
  point_cluster: _objectSpread({
467
469
  // 聚合点位
468
470
  icon: icon,
@@ -498,37 +500,39 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
498
500
  _style.text = this.getLabelStyle(feature, color);
499
501
  }
500
502
  }
501
- if (feature.isCluster && size > 1 && type === 'marker_cluster') {
502
- _style.text = this.getClusterTextStyle(size);
503
- }
503
+
504
+ // if (feature.isCluster && size > 1 && type === 'marker_cluster') {
505
+ // _style.text = this.getClusterTextStyle(size);
506
+ // }
507
+
504
508
  return _style;
505
509
  }
506
510
  }, {
507
511
  key: "setClusterSource",
508
512
  value: function setClusterSource(cluster) {
509
- var _this4 = this;
513
+ var _this$_features;
514
+ var _this = this;
510
515
  var source = new _source.Vector({
511
- features: this._features
516
+ features: (_this$_features = this._features) === null || _this$_features === void 0 ? void 0 : _this$_features.filter(function (v) {
517
+ return v.show;
518
+ })
512
519
  });
513
- var showCluster = false;
514
- if (cluster) {
515
- if ((0, _isObject["default"])(cluster)) {
516
- if (cluster.show) {
517
- showCluster = true;
518
- }
519
- } else {
520
- showCluster = true;
521
- }
522
- }
523
- if (showCluster) {
520
+ var _ref = (0, _isObject["default"])(cluster) ? cluster : {
521
+ show: cluster
522
+ },
523
+ show = _ref.show,
524
+ minDistance = _ref.minDistance,
525
+ distance = _ref.distance;
526
+ if (show) {
524
527
  var clusterSource = new _source.Cluster(_objectSpread({
525
- distance: this.distance,
528
+ distance: distance || 100,
529
+ minDistance: minDistance || 50,
526
530
  source: source,
527
531
  createCluster: function createCluster(point, features) {
528
532
  var feature = new _ol.Feature({
529
533
  geometry: point,
530
534
  features: features.map(function (v) {
531
- v.layerKey = _this4.key;
535
+ v.layerKey = _this.key;
532
536
  return v;
533
537
  })
534
538
  });
@@ -638,14 +642,14 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
638
642
  }
639
643
  }, {
640
644
  key: "getFeaturesByFieldValueOpera",
641
- value: function getFeaturesByFieldValueOpera(_ref) {
645
+ value: function getFeaturesByFieldValueOpera(_ref2) {
642
646
  var _this7 = this;
643
- var field = _ref.field,
644
- value = _ref.value,
645
- _ref$operation = _ref.operation,
646
- operation = _ref$operation === void 0 ? '===' : _ref$operation,
647
- features = _ref.features,
648
- filter = _ref.filter;
647
+ var field = _ref2.field,
648
+ value = _ref2.value,
649
+ _ref2$operation = _ref2.operation,
650
+ operation = _ref2$operation === void 0 ? '===' : _ref2$operation,
651
+ features = _ref2.features,
652
+ filter = _ref2.filter;
649
653
  return new Promise(function (resolve, reject) {
650
654
  var _features = features || _this7.getFeatures();
651
655
  if (filter) {
@@ -698,8 +702,8 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
698
702
  key: "setGroup",
699
703
  value: function setGroup(group) {
700
704
  if (group !== null && group !== void 0 && group.length) {
701
- var _this$_features;
702
- if ((_this$_features = this._features) !== null && _this$_features !== void 0 && _this$_features.length) {
705
+ var _this$_features2;
706
+ if ((_this$_features2 = this._features) !== null && _this$_features2 !== void 0 && _this$_features2.length) {
703
707
  this._features.map(function (feature) {
704
708
  var show = true;
705
709
  group.map(function (v) {
@@ -708,14 +712,18 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
708
712
  if (v.hasOwnProperty('show') && !v.show) {
709
713
  show = false;
710
714
  }
711
- feature.show = show;
712
715
  }
713
716
  });
717
+ feature.show = show;
714
718
  });
715
719
  }
716
720
  this.group = group;
717
721
  this.setVisibleByGroup();
718
- this.setStyle(this.getStyleByMode());
722
+ if (this._options.cluster) {
723
+ this.setClusterMode(this._options.cluster);
724
+ } else {
725
+ this.setStyle(this.getStyleByMode());
726
+ }
719
727
  }
720
728
  }
721
729
 
@@ -754,5 +762,6 @@ var FeatureLayer = /*#__PURE__*/function (_Vector) {
754
762
  }]);
755
763
  return FeatureLayer;
756
764
  }(_layer.Vector);
757
- var _default = exports["default"] = FeatureLayer;
765
+ var _default = FeatureLayer;
766
+ exports["default"] = _default;
758
767
  //# sourceMappingURL=FeatureLayer.js.map