@vtx/ol-map 1.0.84 → 1.0.86
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.
- package/CHANGELOG.md +217 -0
- package/README.md +205 -205
- package/lib/_util/EventEmitter.js +3 -2
- package/lib/_util/EventEmitter.js.map +1 -1
- package/lib/_util/StyleCache.js +3 -2
- package/lib/_util/StyleCache.js.map +1 -1
- package/lib/_util/encryptParams.js +3 -2
- package/lib/_util/encryptParams.js.map +1 -1
- package/lib/_util/filterSpecialCharacters.js +6 -6
- package/lib/_util/filterSpecialCharacters.js.map +1 -1
- package/lib/_util/getComponentProps.js +1 -1
- package/lib/_util/getComponentProps.js.map +1 -1
- package/lib/_util/getCookie.js +6 -5
- package/lib/_util/getCookie.js.map +1 -1
- package/lib/_util/getDefaultMapInfo.js +5 -4
- package/lib/_util/getDefaultMapInfo.js.map +1 -1
- package/lib/_util/getSystemInfo.js +5 -4
- package/lib/_util/getSystemInfo.js.map +1 -1
- package/lib/_util/getToken.js +4 -2
- package/lib/_util/getToken.js.map +1 -1
- package/lib/_util/getUrlParam.js +2 -1
- package/lib/_util/getUrlParam.js.map +1 -1
- package/lib/_util/http.js +23 -22
- package/lib/_util/http.js.map +1 -1
- package/lib/_util/isFunction.js.map +1 -1
- package/lib/_util/isObject.js.map +1 -1
- package/lib/_util/layer.js +33 -29
- package/lib/_util/layer.js.map +1 -1
- package/lib/_util/mapTool.js +37 -36
- package/lib/_util/mapTool.js.map +1 -1
- package/lib/_util/projzh/datum/bd-09.js +2 -1
- package/lib/_util/projzh/datum/bd-09.js.map +1 -1
- package/lib/_util/projzh/datum/gcj-02.js +2 -1
- package/lib/_util/projzh/datum/gcj-02.js.map +1 -1
- package/lib/_util/projzh/datum/index.js +2 -1
- package/lib/_util/projzh/datum/index.js.map +1 -1
- package/lib/_util/projzh/index.js +2 -1
- package/lib/_util/projzh/index.js.map +1 -1
- package/lib/_util/projzh/projection/baidu-mercator.js +2 -1
- package/lib/_util/projzh/projection/baidu-mercator.js.map +1 -1
- package/lib/_util/projzh/projection/index.js +2 -1
- package/lib/_util/projzh/projection/index.js.map +1 -1
- package/lib/_util/projzh/projection/spherical-mercator.js +2 -1
- package/lib/_util/projzh/projection/spherical-mercator.js.map +1 -1
- package/lib/_util/projzh/util.js +2 -1
- package/lib/_util/projzh/util.js.map +1 -1
- package/lib/_util/search.js +10 -7
- package/lib/_util/search.js.map +1 -1
- package/lib/_util/setCookie.js +6 -5
- package/lib/_util/setCookie.js.map +1 -1
- package/lib/_util/transform.js +5 -4
- package/lib/_util/transform.js.map +1 -1
- package/lib/_util/useColSize.js +2 -1
- package/lib/_util/useColSize.js.map +1 -1
- package/lib/_util/useInterval.js.map +1 -1
- package/lib/_util/useSet.js +6 -5
- package/lib/_util/useSet.js.map +1 -1
- package/lib/analysis-layer/index.js +36 -31
- package/lib/analysis-layer/index.js.map +1 -1
- package/lib/buffer-draw/BufferDraw.js +5 -4
- package/lib/buffer-draw/BufferDraw.js.map +1 -1
- package/lib/buffer-draw/index.js +8 -8
- package/lib/buffer-draw/index.js.map +1 -1
- package/lib/circle/Circle.js +5 -4
- package/lib/circle/Circle.js.map +1 -1
- package/lib/circle/index.js +3 -3
- package/lib/circle/index.js.map +1 -1
- package/lib/config.js +2 -1
- package/lib/config.js.map +1 -1
- package/lib/dom/Dom.js +3 -2
- package/lib/dom/Dom.js.map +1 -1
- package/lib/dom/index.js +5 -5
- package/lib/dom/index.js.map +1 -1
- package/lib/events/index.js +4 -2
- package/lib/events/index.js.map +1 -1
- package/lib/feature-draw/FeatureDraw.js +11 -9
- package/lib/feature-draw/FeatureDraw.js.map +1 -1
- package/lib/feature-draw/index.js +7 -7
- package/lib/feature-draw/index.js.map +1 -1
- package/lib/feature-layer/FeatureLayer.js +101 -92
- package/lib/feature-layer/FeatureLayer.js.map +1 -1
- package/lib/feature-layer/createFeatureCollection.js +35 -27
- package/lib/feature-layer/createFeatureCollection.js.map +1 -1
- package/lib/feature-layer/index.js +6 -6
- package/lib/feature-layer/index.js.map +1 -1
- package/lib/feature-layer/style/css.js.map +1 -1
- package/lib/feature-layer/style/index.js.map +1 -1
- package/lib/flow-line-layer/FlowLineLayer.js +5 -4
- package/lib/flow-line-layer/FlowLineLayer.js.map +1 -1
- package/lib/flow-line-layer/index.js +6 -6
- package/lib/flow-line-layer/index.js.map +1 -1
- package/lib/flow-line-layer/style/css.js.map +1 -1
- package/lib/flow-line-layer/style/index.js.map +1 -1
- package/lib/fly-line-layer/FlyLineLayer.js +5 -4
- package/lib/fly-line-layer/FlyLineLayer.js.map +1 -1
- package/lib/fly-line-layer/index.js +4 -4
- package/lib/fly-line-layer/index.js.map +1 -1
- package/lib/fly-line-layer/style/css.js.map +1 -1
- package/lib/fly-line-layer/style/index.js.map +1 -1
- package/lib/group-layer/GroupLayer.js +3 -2
- package/lib/group-layer/GroupLayer.js.map +1 -1
- package/lib/group-layer/index.js +4 -4
- package/lib/group-layer/index.js.map +1 -1
- package/lib/group-layer/style/css.js.map +1 -1
- package/lib/group-layer/style/index.js.map +1 -1
- package/lib/heatmap-layer/HeatmapLayer.js +5 -4
- package/lib/heatmap-layer/HeatmapLayer.js.map +1 -1
- package/lib/heatmap-layer/index.js +4 -4
- package/lib/heatmap-layer/index.js.map +1 -1
- package/lib/heatmap-layer/style/css.js.map +1 -1
- package/lib/heatmap-layer/style/index.js.map +1 -1
- package/lib/high-layer/HighLayer.js +7 -6
- package/lib/high-layer/HighLayer.js.map +1 -1
- package/lib/high-layer/index.js +7 -6
- package/lib/high-layer/index.js.map +1 -1
- package/lib/image-layer/ImageLayer.js +37 -8
- package/lib/image-layer/ImageLayer.js.map +1 -1
- package/lib/image-layer/index.js +6 -6
- package/lib/image-layer/index.js.map +1 -1
- package/lib/image-layer/style/css.js.map +1 -1
- package/lib/image-layer/style/index.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legend/index.js +11 -9
- package/lib/legend/index.js.map +1 -1
- package/lib/legend/style/css.js.map +1 -1
- package/lib/legend/style/index.js.map +1 -1
- package/lib/legend/style/index.less +60 -60
- package/lib/map/Analysis.js +3 -2
- package/lib/map/Analysis.js.map +1 -1
- package/lib/map/Layers.js +4 -3
- package/lib/map/Layers.js.map +1 -1
- package/lib/map/Popup.js +11 -10
- package/lib/map/Popup.js.map +1 -1
- package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js +2 -1
- package/lib/map/getBaseLayers/imagery/amap/AmapImageryProvider.js.map +1 -1
- package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js +2 -1
- package/lib/map/getBaseLayers/imagery/baidu/BaiduImageryProvider.js.map +1 -1
- package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js +5 -3
- package/lib/map/getBaseLayers/imagery/geoq/GeoQImageryProvider.js.map +1 -1
- package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js +5 -3
- package/lib/map/getBaseLayers/imagery/tdt/TdtImageryProvider.js.map +1 -1
- package/lib/map/getBaseLayers/index.js +5 -3
- package/lib/map/getBaseLayers/index.js.map +1 -1
- package/lib/map/index.js +20 -19
- package/lib/map/index.js.map +1 -1
- package/lib/map/style/css.js.map +1 -1
- package/lib/map/style/index.js.map +1 -1
- package/lib/map/style/index.less +99 -99
- package/lib/map-icon/svg/index.js +2 -1
- package/lib/map-icon/svg/index.js.map +1 -1
- package/lib/marker/Marker.js +7 -5
- package/lib/marker/Marker.js.map +1 -1
- package/lib/marker/index.js +3 -3
- package/lib/marker/index.js.map +1 -1
- package/lib/path-line-layer/PathLineLayer.js +5 -4
- package/lib/path-line-layer/PathLineLayer.js.map +1 -1
- package/lib/path-line-layer/getPathLineStyles.js +5 -4
- package/lib/path-line-layer/getPathLineStyles.js.map +1 -1
- package/lib/path-line-layer/index.js +6 -6
- package/lib/path-line-layer/index.js.map +1 -1
- package/lib/path-line-layer/style/css.js.map +1 -1
- package/lib/path-line-layer/style/index.js.map +1 -1
- package/lib/path-play-back/PathPlayBack.js +7 -6
- package/lib/path-play-back/PathPlayBack.js.map +1 -1
- package/lib/path-play-back/index.js +5 -4
- package/lib/path-play-back/index.js.map +1 -1
- package/lib/poi-search/Location.js +4 -4
- package/lib/poi-search/Location.js.map +1 -1
- package/lib/poi-search/PoiList.js +4 -4
- package/lib/poi-search/PoiList.js.map +1 -1
- package/lib/poi-search/Search.js +9 -9
- package/lib/poi-search/Search.js.map +1 -1
- package/lib/poi-search/index.js +6 -5
- package/lib/poi-search/index.js.map +1 -1
- package/lib/poi-search/style/css.js.map +1 -1
- package/lib/poi-search/style/index.js.map +1 -1
- package/lib/poi-search/style/index.less +97 -97
- package/lib/point/Point.js +5 -4
- package/lib/point/Point.js.map +1 -1
- package/lib/point/index.js +3 -3
- package/lib/point/index.js.map +1 -1
- package/lib/polygon/Polygon.js +5 -4
- package/lib/polygon/Polygon.js.map +1 -1
- package/lib/polygon/index.js +3 -3
- package/lib/polygon/index.js.map +1 -1
- package/lib/polyline/Polyline.js +5 -4
- package/lib/polyline/Polyline.js.map +1 -1
- package/lib/polyline/index.js +3 -3
- package/lib/polyline/index.js.map +1 -1
- package/lib/popup/index.js +7 -6
- package/lib/popup/index.js.map +1 -1
- package/lib/popup/style/css.js.map +1 -1
- package/lib/popup/style/index.js.map +1 -1
- package/lib/popup/style/index.less +128 -128
- package/lib/provider/index.js +4 -2
- package/lib/provider/index.js.map +1 -1
- package/lib/renderer/Fill.js +3 -2
- package/lib/renderer/Fill.js.map +1 -1
- package/lib/renderer/Stroke.js +3 -2
- package/lib/renderer/Stroke.js.map +1 -1
- package/lib/renderer/index.js +9 -7
- package/lib/renderer/index.js.map +1 -1
- package/lib/renderer/style/css.js.map +1 -1
- package/lib/renderer/style/index.js.map +1 -1
- package/lib/renderer/transformRgb.js +2 -1
- package/lib/renderer/transformRgb.js.map +1 -1
- package/lib/search-map/VtxModal.js +5 -4
- package/lib/search-map/VtxModal.js.map +1 -1
- package/lib/search-map/index.js +6 -5
- package/lib/search-map/index.js.map +1 -1
- package/lib/search-map/style/css.js.map +1 -1
- package/lib/search-map/style/index.js.map +1 -1
- package/lib/search-map/style/index.less +71 -71
- package/lib/search-map/style/modal.less +58 -58
- package/lib/style/index.less +2 -2
- package/lib/style/themes/compact.less +1 -1
- package/lib/style/themes/dark.less +9 -9
- package/lib/style/themes/default.less +7 -7
- package/lib/style/themes/index.less +1 -1
- package/lib/style/themes/variable.less +5 -5
- package/lib/tile-layer/TileLayer.js +5 -4
- package/lib/tile-layer/TileLayer.js.map +1 -1
- package/lib/tile-layer/index.js +3 -3
- package/lib/tile-layer/index.js.map +1 -1
- package/lib/tile-layer/style/css.js.map +1 -1
- package/lib/tile-layer/style/index.js.map +1 -1
- package/lib/tools/Layer/LayerService.js +5 -4
- package/lib/tools/Layer/LayerService.js.map +1 -1
- package/lib/tools/Layer/LayersCheckService.js +15 -9
- package/lib/tools/Layer/LayersCheckService.js.map +1 -1
- package/lib/tools/Layer/index.js +6 -6
- package/lib/tools/Layer/index.js.map +1 -1
- package/lib/tools/Layer/index.less +43 -43
- package/lib/tools/Search/index.js +16 -15
- package/lib/tools/Search/index.js.map +1 -1
- package/lib/tools/Toolbox/BoxSelect/index.js +4 -3
- package/lib/tools/Toolbox/BoxSelect/index.js.map +1 -1
- package/lib/tools/Toolbox/CircleSelect/index.js +4 -3
- package/lib/tools/Toolbox/CircleSelect/index.js.map +1 -1
- package/lib/tools/Toolbox/EagleEye/index.js +6 -5
- package/lib/tools/Toolbox/EagleEye/index.js.map +1 -1
- package/lib/tools/Toolbox/MapBookmark/Bookmark.js +8 -7
- package/lib/tools/Toolbox/MapBookmark/Bookmark.js.map +1 -1
- package/lib/tools/Toolbox/MapBookmark/index.js +16 -15
- package/lib/tools/Toolbox/MapBookmark/index.js.map +1 -1
- package/lib/tools/Toolbox/MapBookmark/index.less +20 -20
- package/lib/tools/Toolbox/MapDownload/index.js.map +1 -1
- package/lib/tools/Toolbox/MapPrint/index.js +10 -10
- package/lib/tools/Toolbox/MapPrint/index.js.map +1 -1
- package/lib/tools/Toolbox/MapPrint/index.less +4 -4
- package/lib/tools/Toolbox/Measure/Area/index.js +2 -1
- package/lib/tools/Toolbox/Measure/Area/index.js.map +1 -1
- package/lib/tools/Toolbox/Measure/Distance/index.js +2 -1
- package/lib/tools/Toolbox/Measure/Distance/index.js.map +1 -1
- package/lib/tools/Toolbox/Measure/Measure.js +3 -2
- package/lib/tools/Toolbox/Measure/Measure.js.map +1 -1
- package/lib/tools/Toolbox/Measure/index.js +6 -5
- package/lib/tools/Toolbox/Measure/index.js.map +1 -1
- package/lib/tools/Toolbox/PolygonSelect/index.js +4 -3
- package/lib/tools/Toolbox/PolygonSelect/index.js.map +1 -1
- package/lib/tools/Toolbox/ScaleLine/index.js +6 -5
- package/lib/tools/Toolbox/ScaleLine/index.js.map +1 -1
- package/lib/tools/Toolbox/SelectTools/index.js +22 -21
- package/lib/tools/Toolbox/SelectTools/index.js.map +1 -1
- package/lib/tools/Toolbox/SelectTools/index.less +43 -43
- package/lib/tools/Toolbox/SpaceQuery/index.js +5 -5
- package/lib/tools/Toolbox/SpaceQuery/index.js.map +1 -1
- package/lib/tools/Toolbox/SpaceQuery/index.less +16 -16
- package/lib/tools/Toolbox/ZoomInput/index.js +6 -5
- package/lib/tools/Toolbox/ZoomInput/index.js.map +1 -1
- package/lib/tools/Toolbox/ZoomInput/index.less +5 -5
- package/lib/tools/Toolbox/index.js +9 -7
- package/lib/tools/Toolbox/index.js.map +1 -1
- package/lib/tools/Toolbox/index.less +2 -2
- package/lib/tools/Utils/CreateOverlay.js +5 -4
- package/lib/tools/Utils/CreateOverlay.js.map +1 -1
- package/lib/tools/Utils/Draw.js +11 -9
- package/lib/tools/Utils/Draw.js.map +1 -1
- package/lib/tools/Utils/HighLayer.js +7 -6
- package/lib/tools/Utils/HighLayer.js.map +1 -1
- package/lib/tools/Utils/measure.js +2 -1
- package/lib/tools/Utils/measure.js.map +1 -1
- package/lib/tools/Utils/utils.js +35 -27
- package/lib/tools/Utils/utils.js.map +1 -1
- package/lib/tools/View/index.js +8 -7
- package/lib/tools/View/index.js.map +1 -1
- package/lib/tools/View/index.less +28 -28
- package/lib/tools/analysis-tool/index.js +10 -9
- package/lib/tools/analysis-tool/index.js.map +1 -1
- package/lib/tools/base-map-switch/index.js +8 -7
- package/lib/tools/base-map-switch/index.js.map +1 -1
- package/lib/tools/components/Icon/index.js +2 -1
- package/lib/tools/components/Icon/index.js.map +1 -1
- package/lib/tools/components/ItemWrap/index.js +6 -5
- package/lib/tools/components/ItemWrap/index.js.map +1 -1
- package/lib/tools/components/ItemWrap/index.less +41 -41
- package/lib/tools/components/Modal/index.js +7 -6
- package/lib/tools/components/Modal/index.js.map +1 -1
- package/lib/tools/components/Modal/index.less +33 -33
- package/lib/tools/components/MyTabs/index.js.map +1 -1
- package/lib/tools/components/RequiredLabel/index.js +3 -3
- package/lib/tools/components/RequiredLabel/index.js.map +1 -1
- package/lib/tools/components/RequiredLabel/index.less +5 -5
- package/lib/tools/components/Select/index.js +2 -1
- package/lib/tools/components/Select/index.js.map +1 -1
- package/lib/tools/components/Table/index.js +7 -6
- package/lib/tools/components/Table/index.js.map +1 -1
- package/lib/tools/components/Table/index.less +13 -13
- package/lib/tools/components/ToolItem/index.js +2 -1
- package/lib/tools/components/ToolItem/index.js.map +1 -1
- package/lib/tools/components/ToolItem/index.less +27 -27
- package/lib/tools/components/ToolsSelect/index.js +2 -1
- package/lib/tools/components/ToolsSelect/index.js.map +1 -1
- package/lib/tools/components/ToolsSelect/index.less +10 -10
- package/lib/tools/full-screen/index.js +6 -5
- package/lib/tools/full-screen/index.js.map +1 -1
- package/lib/tools/index.js +4 -4
- package/lib/tools/index.js.map +1 -1
- package/lib/tools/layer-control/index.js +12 -9
- package/lib/tools/layer-control/index.js.map +1 -1
- package/lib/tools/refresh/index.js +7 -6
- package/lib/tools/refresh/index.js.map +1 -1
- package/lib/tools/style/css.js.map +1 -1
- package/lib/tools/style/index.js.map +1 -1
- package/lib/tools/style/index.less +144 -144
- package/lib/tools-item/index.js +6 -5
- package/lib/tools-item/index.js.map +1 -1
- package/lib/use-props/index.js +2 -1
- package/lib/use-props/index.js.map +1 -1
- 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(
|
|
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(
|
|
26
|
-
function _objectSpread(
|
|
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,
|
|
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
|
-
|
|
95
|
-
_defineProperty(_assertThisInitialized(
|
|
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(
|
|
111
|
-
var 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(
|
|
142
|
+
_set((_thisSuper = _assertThisInitialized(_this2), _getPrototypeOf(FeatureLayer.prototype)), "show", show, _thisSuper, true);
|
|
143
143
|
// 参数
|
|
144
|
-
|
|
144
|
+
_this2._options = options;
|
|
145
145
|
|
|
146
146
|
// 地图
|
|
147
|
-
|
|
147
|
+
_this2.map = map;
|
|
148
148
|
|
|
149
149
|
// 接口地址
|
|
150
|
-
|
|
150
|
+
_this2.url = url;
|
|
151
151
|
|
|
152
152
|
// 接口地址请求类型
|
|
153
|
-
|
|
153
|
+
_this2.method = method;
|
|
154
154
|
|
|
155
155
|
// 接口查询参数
|
|
156
|
-
|
|
156
|
+
_this2.params = params;
|
|
157
157
|
|
|
158
158
|
// 图层标识
|
|
159
|
-
|
|
159
|
+
_this2.key = key;
|
|
160
160
|
|
|
161
161
|
// 图层名称
|
|
162
|
-
|
|
162
|
+
_this2.name = name;
|
|
163
163
|
|
|
164
164
|
// 标签
|
|
165
|
-
|
|
165
|
+
_this2.label = label;
|
|
166
166
|
|
|
167
167
|
// 标签字段
|
|
168
|
-
|
|
168
|
+
_this2.labelField = _labelField;
|
|
169
169
|
|
|
170
170
|
// 聚合
|
|
171
|
-
|
|
171
|
+
_this2.cluster = cluster;
|
|
172
172
|
|
|
173
173
|
// 聚合距离
|
|
174
|
-
|
|
174
|
+
_this2.distance = (cluster === null || cluster === void 0 ? void 0 : cluster.distance) || 80;
|
|
175
175
|
|
|
176
176
|
// 海量点
|
|
177
|
-
|
|
177
|
+
_this2.point = point;
|
|
178
178
|
|
|
179
179
|
// 自动刷新标识
|
|
180
|
-
|
|
180
|
+
_this2.autoRefresh = autoRefresh;
|
|
181
181
|
|
|
182
182
|
// 模版内容
|
|
183
|
-
|
|
183
|
+
_this2.template = template;
|
|
184
184
|
|
|
185
185
|
// 图层控制
|
|
186
|
-
|
|
186
|
+
_this2.layerControl = layerControl;
|
|
187
187
|
|
|
188
188
|
// 过滤
|
|
189
|
-
|
|
189
|
+
_this2.group = group;
|
|
190
190
|
|
|
191
191
|
// 处理获取的数据
|
|
192
|
-
|
|
192
|
+
_this2.afterGetData = afterGetData;
|
|
193
193
|
|
|
194
194
|
// 数据查询字段
|
|
195
|
-
|
|
195
|
+
_this2.valueField = valueField;
|
|
196
196
|
|
|
197
197
|
// 图例
|
|
198
|
-
|
|
198
|
+
_this2.legend = legend;
|
|
199
199
|
|
|
200
200
|
// 样式
|
|
201
|
-
|
|
201
|
+
_this2.style = style;
|
|
202
202
|
|
|
203
203
|
// 数据
|
|
204
|
-
|
|
204
|
+
_this2.data = data;
|
|
205
205
|
|
|
206
206
|
// 数据取值字段
|
|
207
|
-
|
|
207
|
+
_this2.dataField = dataField || 'geometryInfo';
|
|
208
208
|
|
|
209
209
|
// 仅展示
|
|
210
|
-
|
|
210
|
+
_this2.viewOnly = viewOnly;
|
|
211
211
|
|
|
212
212
|
// 是否初始化
|
|
213
|
-
|
|
213
|
+
_this2.inited = false;
|
|
214
214
|
|
|
215
215
|
// 加密
|
|
216
|
-
|
|
216
|
+
_this2.encrypt = encrypt;
|
|
217
|
+
|
|
218
|
+
// 临时数据
|
|
219
|
+
_this2._features = [];
|
|
217
220
|
|
|
218
221
|
// 默认是否展示
|
|
219
222
|
if (defaultShow) {
|
|
220
|
-
|
|
223
|
+
_this2.init();
|
|
221
224
|
}
|
|
222
|
-
return
|
|
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
|
|
288
|
+
var _this3 = this;
|
|
286
289
|
return function (feature, resolution) {
|
|
287
|
-
var
|
|
288
|
-
var
|
|
289
|
-
style =
|
|
290
|
-
cluster =
|
|
291
|
-
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
|
-
(
|
|
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({},
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
-
|
|
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
|
|
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
|
|
438
|
-
color = ((_data3 = data) === null || _data3 === void 0
|
|
439
|
-
image = ((_data5 = data) === null || _data5 === void 0
|
|
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(
|
|
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
|
-
|
|
502
|
-
|
|
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
|
|
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
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
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:
|
|
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 =
|
|
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(
|
|
645
|
+
value: function getFeaturesByFieldValueOpera(_ref2) {
|
|
642
646
|
var _this7 = this;
|
|
643
|
-
var field =
|
|
644
|
-
value =
|
|
645
|
-
|
|
646
|
-
operation =
|
|
647
|
-
features =
|
|
648
|
-
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$
|
|
702
|
-
if ((_this$
|
|
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
|
-
|
|
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 =
|
|
765
|
+
var _default = FeatureLayer;
|
|
766
|
+
exports["default"] = _default;
|
|
758
767
|
//# sourceMappingURL=FeatureLayer.js.map
|