@vtx/cs-map-layer 1.0.11 → 1.0.12

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.
@@ -1,5 +1,5 @@
1
1
  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); }
2
- var _excluded = ["code", "params", "showModal"];
2
+ var _excluded = ["code", "params", "showModal", "styleOption"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  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; }
5
5
  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; }
@@ -10,15 +10,17 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
10
10
  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; }
11
11
  import { FeatureLayer } from '@vtx/cs-map';
12
12
  import React from 'react';
13
+ import DeviceTemplate from "../_components/Template/DeviceTemplate";
13
14
  import { DEVICE_CODE } from "../_util/interface";
14
15
  import { deviceCodeMap, getDeviceStyle } from "../_util/layerConfig";
15
- import DeviceTemplate from "../_components/Template/DeviceTemplate";
16
16
  var DeviceLayer = function DeviceLayer(props) {
17
17
  var _props$code = props.code,
18
18
  code = _props$code === void 0 ? DEVICE_CODE.DEFAULT : _props$code,
19
19
  _props$params = props.params,
20
20
  params = _props$params === void 0 ? {} : _props$params,
21
21
  showModal = props.showModal,
22
+ _props$styleOption = props.styleOption,
23
+ styleOption = _props$styleOption === void 0 ? {} : _props$styleOption,
22
24
  otherProps = _objectWithoutProperties(props, _excluded);
23
25
  var _ref = deviceCodeMap[code] || {},
24
26
  name = _ref.name,
@@ -30,11 +32,11 @@ var DeviceLayer = function DeviceLayer(props) {
30
32
  deviceTypeId: code
31
33
  }, params),
32
34
  style: function style(f) {
33
- return getDeviceStyle(f, icon || '');
35
+ return getDeviceStyle(f, icon || '', styleOption);
34
36
  },
35
37
  name: name,
36
38
  labelField: labelField,
37
- legend: icon,
39
+ legend: icon || (styleOption === null || styleOption === void 0 ? void 0 : styleOption.icon),
38
40
  zIndex: 4,
39
41
  id: code,
40
42
  template: function template(feature) {
@@ -15,7 +15,7 @@ type DeviceI = {
15
15
  };
16
16
  declare const facilityCodeMap: FacilityI;
17
17
  declare const deviceCodeMap: DeviceI;
18
- export declare const getDeviceStyle: (f: any, icon: string) => {
18
+ export declare const getDeviceStyle: (f: any, icon: string, styleOption?: {}) => {
19
19
  type: string;
20
20
  style: {
21
21
  icon: string;
@@ -1,5 +1,7 @@
1
1
  var _facilityCodeMap;
2
2
  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); }
3
+ 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; }
4
+ 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; }
3
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
5
7
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
@@ -250,6 +252,7 @@ var deviceCodeMap = {
250
252
  }
251
253
  };
252
254
  export var getDeviceStyle = function getDeviceStyle(f, icon) {
255
+ var styleOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
253
256
  var value = f._properties.properties._value;
254
257
  var statusMap = {
255
258
  1: '',
@@ -262,11 +265,11 @@ export var getDeviceStyle = function getDeviceStyle(f, icon) {
262
265
  };
263
266
  return {
264
267
  type: 'Marker',
265
- style: {
268
+ style: _objectSpread({
266
269
  icon: icon,
267
270
  scale: 0.65,
268
271
  status: statusMap[value.status]
269
- }
272
+ }, styleOption)
270
273
  };
271
274
  };
272
275
  export { deviceCodeMap, facilityCodeMap };
package/package.json CHANGED
@@ -1,102 +1,102 @@
1
- {
2
- "name": "@vtx/cs-map-layer",
3
- "version": "1.0.11",
4
- "description": "React components for Vortex",
5
- "license": "MIT",
6
- "module": "lib/index.js",
7
- "types": "lib/index.d.ts",
8
- "files": [
9
- "lib"
10
- ],
11
- "scripts": {
12
- "build": "father build",
13
- "build:watch": "father dev",
14
- "dev": "npm run cesium:fix && dumi dev",
15
- "docs:build": "npm run cesium:fix && dumi build",
16
- "doctor": "father doctor",
17
- "cesium:fix": "node ./scripts/cesium-fix.js",
18
- "lint": "npm run lint:es && npm run lint:css",
19
- "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
20
- "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
21
- "prepublishOnly": "father doctor && npm run build",
22
- "start": "npm run dev"
23
- },
24
- "husky": {
25
- "hooks": {
26
- "pre-commit": "lint-staged",
27
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
28
- }
29
- },
30
- "commitlint": {
31
- "extends": [
32
- "@commitlint/config-conventional"
33
- ]
34
- },
35
- "lint-staged": {
36
- "*.{md,json}": [
37
- "prettier --write --no-error-on-unmatched-pattern"
38
- ],
39
- "*.{css,less}": [
40
- "stylelint --fix",
41
- "prettier --write"
42
- ],
43
- "*.{js,jsx}": [
44
- "eslint --fix",
45
- "prettier --write"
46
- ],
47
- "*.{ts,tsx}": [
48
- "eslint --fix",
49
- "prettier --parser=typescript --write"
50
- ]
51
- },
52
- "dependencies": {
53
- "@vtx/utils": "latest",
54
- "cesium": "1.90.0",
55
- "lodash": "^4.17.21",
56
- "moment": "^2.29.1",
57
- "qs": "^6.0.0"
58
- },
59
- "devDependencies": {
60
- "@babel/runtime": "^7.6.3",
61
- "@commitlint/cli": "^17.1.2",
62
- "@commitlint/config-conventional": "^17.1.0",
63
- "@types/lodash": "^4.14.202",
64
- "@types/qs": "^6.9.11",
65
- "@types/react": "^18.0.0",
66
- "@types/react-dom": "^18.0.0",
67
- "@umijs/lint": "^4.0.0",
68
- "babel-plugin-import": "^1.13.8",
69
- "dumi": "^2.2.13",
70
- "eslint": "^8.23.0",
71
- "father": "^4.1.0",
72
- "husky": "^8.0.1",
73
- "lint-staged": "^13.0.3",
74
- "prettier": "^2.7.1",
75
- "prettier-plugin-organize-imports": "^3.0.0",
76
- "prettier-plugin-packagejson": "^2.2.18",
77
- "react": "^18.0.0",
78
- "react-dom": "^18.0.0",
79
- "@ant-design/icons": "4.7.0",
80
- "@vtx/cs-map": "latest",
81
- "@turf/turf": "^6.5.0",
82
- "@vtx/map-icon": "^2.0.16",
83
- "ahooks": "^3.1.5",
84
- "axios": "^0.21.1",
85
- "antd": "4.20.5",
86
- "stylelint": "^14.9.1"
87
- },
88
- "peerDependencies": {
89
- "antd": ">4.0.0",
90
- "@vtx/map-icon": ">=2.0.0",
91
- "@vtx/cs-map": ">=1.0.40",
92
- "axios": ">=0.21.1",
93
- "@ant-design/icons": ">=4.0.0",
94
- "react": ">=16.9.0",
95
- "react-dom": ">=16.9.0"
96
- },
97
- "publishConfig": {
98
- "access": "public"
99
- },
100
- "authors": [],
101
- "slideEffects": false
102
- }
1
+ {
2
+ "name": "@vtx/cs-map-layer",
3
+ "version": "1.0.12",
4
+ "description": "React components for Vortex",
5
+ "license": "MIT",
6
+ "module": "lib/index.js",
7
+ "types": "lib/index.d.ts",
8
+ "files": [
9
+ "lib"
10
+ ],
11
+ "scripts": {
12
+ "build": "father build",
13
+ "build:watch": "father dev",
14
+ "cesium:fix": "node ./scripts/cesium-fix.js",
15
+ "dev": "npm run cesium:fix && dumi dev",
16
+ "docs:build": "npm run cesium:fix && dumi build",
17
+ "doctor": "father doctor",
18
+ "lint": "npm run lint:es && npm run lint:css",
19
+ "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
20
+ "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
21
+ "prepublishOnly": "father doctor && npm run build",
22
+ "start": "npm run dev"
23
+ },
24
+ "husky": {
25
+ "hooks": {
26
+ "pre-commit": "lint-staged",
27
+ "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
28
+ }
29
+ },
30
+ "commitlint": {
31
+ "extends": [
32
+ "@commitlint/config-conventional"
33
+ ]
34
+ },
35
+ "lint-staged": {
36
+ "*.{md,json}": [
37
+ "prettier --write --no-error-on-unmatched-pattern"
38
+ ],
39
+ "*.{css,less}": [
40
+ "stylelint --fix",
41
+ "prettier --write"
42
+ ],
43
+ "*.{js,jsx}": [
44
+ "eslint --fix",
45
+ "prettier --write"
46
+ ],
47
+ "*.{ts,tsx}": [
48
+ "eslint --fix",
49
+ "prettier --parser=typescript --write"
50
+ ]
51
+ },
52
+ "dependencies": {
53
+ "@vtx/utils": "latest",
54
+ "cesium": "1.90.0",
55
+ "lodash": "^4.17.21",
56
+ "moment": "^2.29.1",
57
+ "qs": "^6.0.0"
58
+ },
59
+ "devDependencies": {
60
+ "@ant-design/icons": "4.7.0",
61
+ "@babel/runtime": "^7.6.3",
62
+ "@commitlint/cli": "^17.1.2",
63
+ "@commitlint/config-conventional": "^17.1.0",
64
+ "@turf/turf": "^6.5.0",
65
+ "@types/lodash": "^4.14.202",
66
+ "@types/qs": "^6.9.11",
67
+ "@types/react": "^18.0.0",
68
+ "@types/react-dom": "^18.0.0",
69
+ "@umijs/lint": "^4.0.0",
70
+ "@vtx/cs-map": "latest",
71
+ "@vtx/map-icon": "^2.0.16",
72
+ "ahooks": "^3.1.5",
73
+ "antd": "4.20.5",
74
+ "axios": "^0.21.1",
75
+ "babel-plugin-import": "^1.13.8",
76
+ "dumi": "^2.2.13",
77
+ "eslint": "^8.23.0",
78
+ "father": "^4.1.0",
79
+ "husky": "^8.0.1",
80
+ "lint-staged": "^13.0.3",
81
+ "prettier": "^2.7.1",
82
+ "prettier-plugin-organize-imports": "^3.0.0",
83
+ "prettier-plugin-packagejson": "^2.2.18",
84
+ "react": "^18.0.0",
85
+ "react-dom": "^18.0.0",
86
+ "stylelint": "^14.9.1"
87
+ },
88
+ "peerDependencies": {
89
+ "@ant-design/icons": ">=4.0.0",
90
+ "@vtx/cs-map": ">=1.0.40",
91
+ "@vtx/map-icon": ">=2.0.0",
92
+ "antd": ">4.0.0",
93
+ "axios": ">=0.21.1",
94
+ "react": ">=16.9.0",
95
+ "react-dom": ">=16.9.0"
96
+ },
97
+ "publishConfig": {
98
+ "access": "public"
99
+ },
100
+ "authors": [],
101
+ "slideEffects": false
102
+ }