@antv/l7-layers 2.13.1 → 2.13.2
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/es/core/BaseLayer.js +15 -8
- package/lib/core/BaseLayer.js +15 -8
- package/package.json +6 -6
package/es/core/BaseLayer.js
CHANGED
|
@@ -590,12 +590,19 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
590
590
|
}, {
|
|
591
591
|
key: "scale",
|
|
592
592
|
value: function scale(field, cfg) {
|
|
593
|
+
var preOption = _objectSpread({}, this.scaleOptions);
|
|
594
|
+
|
|
593
595
|
if (isObject(field)) {
|
|
594
596
|
this.scaleOptions = _objectSpread(_objectSpread({}, this.scaleOptions), field);
|
|
595
597
|
} else {
|
|
596
598
|
this.scaleOptions[field] = cfg;
|
|
597
599
|
}
|
|
598
600
|
|
|
601
|
+
if (this.styleAttributeService && !isEqual(preOption, this.scaleOptions)) {
|
|
602
|
+
var scaleOptions = isObject(field) ? field : _defineProperty({}, field, cfg);
|
|
603
|
+
this.styleAttributeService.updateScaleAttribute(scaleOptions);
|
|
604
|
+
}
|
|
605
|
+
|
|
599
606
|
return this;
|
|
600
607
|
}
|
|
601
608
|
/**
|
|
@@ -1062,8 +1069,8 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1062
1069
|
} // this.layerSource.inited 为 true update 事件不会再触发
|
|
1063
1070
|
|
|
1064
1071
|
|
|
1065
|
-
this.layerSource.on('update', function (
|
|
1066
|
-
var type =
|
|
1072
|
+
this.layerSource.on('update', function (_ref4) {
|
|
1073
|
+
var type = _ref4.type;
|
|
1067
1074
|
|
|
1068
1075
|
if (_this8.coordCenter === undefined) {
|
|
1069
1076
|
var _this8$mapService;
|
|
@@ -1193,9 +1200,9 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1193
1200
|
}
|
|
1194
1201
|
}, {
|
|
1195
1202
|
key: "pick",
|
|
1196
|
-
value: function pick(
|
|
1197
|
-
var x =
|
|
1198
|
-
y =
|
|
1203
|
+
value: function pick(_ref8) {
|
|
1204
|
+
var x = _ref8.x,
|
|
1205
|
+
y = _ref8.y;
|
|
1199
1206
|
this.interactionService.triggerHover({
|
|
1200
1207
|
x: x,
|
|
1201
1208
|
y: y
|
|
@@ -1228,9 +1235,9 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
|
|
|
1228
1235
|
return _context3.abrupt("return", new Promise(function (resolve, reject) {
|
|
1229
1236
|
// filter supported worker & worker enabled layer
|
|
1230
1237
|
if (workerOptions && workerOptions.modelType in WorkerSourceMap && workerEnabled) {
|
|
1231
|
-
_this10.styleAttributeService.createAttributesAndIndicesAscy(_this10.encodedData, segmentNumber, workerOptions).then(function (
|
|
1232
|
-
var attributes =
|
|
1233
|
-
elements =
|
|
1238
|
+
_this10.styleAttributeService.createAttributesAndIndicesAscy(_this10.encodedData, segmentNumber, workerOptions).then(function (_ref9) {
|
|
1239
|
+
var attributes = _ref9.attributes,
|
|
1240
|
+
elements = _ref9.elements;
|
|
1234
1241
|
var m = createModel(_objectSpread({
|
|
1235
1242
|
attributes: attributes,
|
|
1236
1243
|
uniforms: uniforms,
|
package/lib/core/BaseLayer.js
CHANGED
|
@@ -591,12 +591,19 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
591
591
|
}, {
|
|
592
592
|
key: "scale",
|
|
593
593
|
value: function scale(field, cfg) {
|
|
594
|
+
var preOption = (0, _objectSpread2.default)({}, this.scaleOptions);
|
|
595
|
+
|
|
594
596
|
if ((0, _lodash.isObject)(field)) {
|
|
595
597
|
this.scaleOptions = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.scaleOptions), field);
|
|
596
598
|
} else {
|
|
597
599
|
this.scaleOptions[field] = cfg;
|
|
598
600
|
}
|
|
599
601
|
|
|
602
|
+
if (this.styleAttributeService && !(0, _lodash.isEqual)(preOption, this.scaleOptions)) {
|
|
603
|
+
var scaleOptions = (0, _lodash.isObject)(field) ? field : (0, _defineProperty2.default)({}, field, cfg);
|
|
604
|
+
this.styleAttributeService.updateScaleAttribute(scaleOptions);
|
|
605
|
+
}
|
|
606
|
+
|
|
600
607
|
return this;
|
|
601
608
|
}
|
|
602
609
|
/**
|
|
@@ -1063,8 +1070,8 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
1063
1070
|
} // this.layerSource.inited 为 true update 事件不会再触发
|
|
1064
1071
|
|
|
1065
1072
|
|
|
1066
|
-
this.layerSource.on('update', function (
|
|
1067
|
-
var type =
|
|
1073
|
+
this.layerSource.on('update', function (_ref4) {
|
|
1074
|
+
var type = _ref4.type;
|
|
1068
1075
|
|
|
1069
1076
|
if (_this8.coordCenter === undefined) {
|
|
1070
1077
|
var _this8$mapService;
|
|
@@ -1194,9 +1201,9 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
1194
1201
|
}
|
|
1195
1202
|
}, {
|
|
1196
1203
|
key: "pick",
|
|
1197
|
-
value: function pick(
|
|
1198
|
-
var x =
|
|
1199
|
-
y =
|
|
1204
|
+
value: function pick(_ref8) {
|
|
1205
|
+
var x = _ref8.x,
|
|
1206
|
+
y = _ref8.y;
|
|
1200
1207
|
this.interactionService.triggerHover({
|
|
1201
1208
|
x: x,
|
|
1202
1209
|
y: y
|
|
@@ -1229,9 +1236,9 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
1229
1236
|
return _context3.abrupt("return", new Promise(function (resolve, reject) {
|
|
1230
1237
|
// filter supported worker & worker enabled layer
|
|
1231
1238
|
if (workerOptions && workerOptions.modelType in _l7Utils.WorkerSourceMap && workerEnabled) {
|
|
1232
|
-
_this10.styleAttributeService.createAttributesAndIndicesAscy(_this10.encodedData, segmentNumber, workerOptions).then(function (
|
|
1233
|
-
var attributes =
|
|
1234
|
-
elements =
|
|
1239
|
+
_this10.styleAttributeService.createAttributesAndIndicesAscy(_this10.encodedData, segmentNumber, workerOptions).then(function (_ref9) {
|
|
1240
|
+
var attributes = _ref9.attributes,
|
|
1241
|
+
elements = _ref9.elements;
|
|
1235
1242
|
var m = createModel((0, _objectSpread2.default)({
|
|
1236
1243
|
attributes: attributes,
|
|
1237
1244
|
uniforms: uniforms,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-layers",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.2",
|
|
4
4
|
"description": "L7's collection of built-in layers",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"license": "ISC",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@antv/async-hook": "^2.2.9",
|
|
30
|
-
"@antv/l7-core": "2.13.
|
|
31
|
-
"@antv/l7-maps": "2.13.
|
|
32
|
-
"@antv/l7-source": "2.13.
|
|
33
|
-
"@antv/l7-utils": "2.13.
|
|
30
|
+
"@antv/l7-core": "2.13.2",
|
|
31
|
+
"@antv/l7-maps": "2.13.2",
|
|
32
|
+
"@antv/l7-source": "2.13.2",
|
|
33
|
+
"@antv/l7-utils": "2.13.2",
|
|
34
34
|
"@babel/runtime": "^7.7.7",
|
|
35
35
|
"@mapbox/martini": "^0.2.0",
|
|
36
36
|
"@turf/clone": "^6.5.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@types/gl-matrix": "^2.4.5",
|
|
62
62
|
"@types/lodash": "^4.14.138"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "21f7fb572078c84e5ff18b3e2acc2fa86cdd7e6b",
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
}
|