@antv/l7-core
Advanced tools
Comparing version 2.20.19 to 2.20.20
@@ -40,3 +40,3 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(layer, _ref) { | ||
var x, y, lngLat, type, target, isPicked, _this$rendererService, readPixelsAsync, getContainer, _this$getContainerSiz, width, height, _layer$getLayerConfig, enableHighlight, enableSelect, xInDevicePixel, yInDevicePixel, pickedColors, pickedFeatureIdx, rawFeature, layerTarget, _layerTarget, selectedId; | ||
var x, y, lngLat, type, target, isPicked, _this$rendererService, readPixelsAsync, getViewportSize, _getViewportSize, width, height, _layer$getLayerConfig, enableHighlight, enableSelect, xInDevicePixel, yInDevicePixel, pickedColors, pickedFeatureIdx, rawFeature, layerTarget, _layerTarget, selectedId; | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
@@ -47,6 +47,4 @@ while (1) switch (_context.prev = _context.next) { | ||
isPicked = false; | ||
_this$rendererService = _this.rendererService, readPixelsAsync = _this$rendererService.readPixelsAsync, getContainer = _this$rendererService.getContainer; | ||
_this$getContainerSiz = _this.getContainerSize(getContainer()), width = _this$getContainerSiz.width, height = _this$getContainerSiz.height; | ||
width *= DOM.DPR; | ||
height *= DOM.DPR; | ||
_this$rendererService = _this.rendererService, readPixelsAsync = _this$rendererService.readPixelsAsync, getViewportSize = _this$rendererService.getViewportSize; | ||
_getViewportSize = getViewportSize(), width = _getViewportSize.width, height = _getViewportSize.height; | ||
_layer$getLayerConfig = layer.getLayerConfig(), enableHighlight = _layer$getLayerConfig.enableHighlight, enableSelect = _layer$getLayerConfig.enableSelect; | ||
@@ -56,8 +54,8 @@ xInDevicePixel = x * DOM.DPR; | ||
if (!(xInDevicePixel > width - 1 * DOM.DPR || xInDevicePixel < 0 || yInDevicePixel > height - 1 * DOM.DPR || yInDevicePixel < 0)) { | ||
_context.next = 11; | ||
_context.next = 9; | ||
break; | ||
} | ||
return _context.abrupt("return", false); | ||
case 11: | ||
_context.next = 13; | ||
case 9: | ||
_context.next = 11; | ||
return readPixelsAsync({ | ||
@@ -72,3 +70,3 @@ x: Math.floor(xInDevicePixel / _this.pickBufferScale), | ||
}); | ||
case 13: | ||
case 11: | ||
pickedColors = _context.sent; | ||
@@ -133,3 +131,3 @@ _this.pickedColors = pickedColors; | ||
return _context.abrupt("return", isPicked); | ||
case 19: | ||
case 17: | ||
case "end": | ||
@@ -151,8 +149,6 @@ return _context.stop(); | ||
createFramebuffer = _this$rendererService2.createFramebuffer, | ||
getContainer = _this$rendererService2.getContainer; | ||
var _this$getContainerSiz2 = this.getContainerSize(getContainer()), | ||
width = _this$getContainerSiz2.width, | ||
height = _this$getContainerSiz2.height; | ||
width *= DOM.DPR; | ||
height *= DOM.DPR; | ||
getViewportSize = _this$rendererService2.getViewportSize; | ||
var _getViewportSize2 = getViewportSize(), | ||
width = _getViewportSize2.width, | ||
height = _getViewportSize2.height; | ||
this.pickBufferScale = this.configService.getSceneConfig(id).pickBufferScale || 1; | ||
@@ -235,3 +231,3 @@ width = Math.round(width / this.pickBufferScale); | ||
var _this3 = this; | ||
var _box$map, _box$map2, xMin, yMin, xMax, yMax, _this$rendererService4, readPixelsAsync, getContainer, _this$getContainerSiz3, width, height, w, h, pickedColors, features, featuresIdMap, i, color, pickedFeatureIdx, rawFeature; | ||
var _box$map, _box$map2, xMin, yMin, xMax, yMax, _this$rendererService4, readPixelsAsync, getViewportSize, _getViewportSize3, width, height, w, h, pickedColors, features, featuresIdMap, i, color, pickedFeatureIdx, rawFeature; | ||
return _regeneratorRuntime.wrap(function _callee4$(_context4) { | ||
@@ -244,15 +240,13 @@ while (1) switch (_context4.prev = _context4.next) { | ||
}), _box$map2 = _slicedToArray(_box$map, 4), xMin = _box$map2[0], yMin = _box$map2[1], xMax = _box$map2[2], yMax = _box$map2[3]; | ||
_this$rendererService4 = this.rendererService, readPixelsAsync = _this$rendererService4.readPixelsAsync, getContainer = _this$rendererService4.getContainer; | ||
_this$getContainerSiz3 = this.getContainerSize(getContainer()), width = _this$getContainerSiz3.width, height = _this$getContainerSiz3.height; | ||
width *= DOM.DPR; | ||
height *= DOM.DPR; | ||
_this$rendererService4 = this.rendererService, readPixelsAsync = _this$rendererService4.readPixelsAsync, getViewportSize = _this$rendererService4.getViewportSize; | ||
_getViewportSize3 = getViewportSize(), width = _getViewportSize3.width, height = _getViewportSize3.height; | ||
if (!(xMin > (width - 1) * DOM.DPR / this.pickBufferScale || xMax < 0 || yMin > (height - 1) * DOM.DPR / this.pickBufferScale || yMax < 0)) { | ||
_context4.next = 7; | ||
_context4.next = 5; | ||
break; | ||
} | ||
return _context4.abrupt("return", []); | ||
case 7: | ||
case 5: | ||
w = Math.min(width / this.pickBufferScale, xMax) - xMin; | ||
h = Math.min(height / this.pickBufferScale, yMax) - yMin; | ||
_context4.next = 11; | ||
_context4.next = 9; | ||
return readPixelsAsync({ | ||
@@ -267,3 +261,3 @@ x: xMin, | ||
}); | ||
case 11: | ||
case 9: | ||
pickedColors = _context4.sent; | ||
@@ -284,3 +278,3 @@ features = []; | ||
return _context4.abrupt("return", features); | ||
case 16: | ||
case 14: | ||
case "end": | ||
@@ -331,10 +325,3 @@ return _context4.stop(); | ||
function getContainerSize(container) { | ||
if (container.getContext) { | ||
return { | ||
width: container.width / DOM.DPR, | ||
height: container.height / DOM.DPR | ||
}; | ||
} else { | ||
return container.getBoundingClientRect(); | ||
} | ||
return container.getBoundingClientRect(); | ||
} | ||
@@ -399,8 +386,6 @@ }, { | ||
value: function resizePickingFBO() { | ||
var getContainer = this.rendererService.getContainer; | ||
var _this$getContainerSiz4 = this.getContainerSize(getContainer()), | ||
width = _this$getContainerSiz4.width, | ||
height = _this$getContainerSiz4.height; | ||
width *= DOM.DPR; | ||
height *= DOM.DPR; | ||
var getViewportSize = this.rendererService.getViewportSize; | ||
var _getViewportSize4 = getViewportSize(), | ||
width = _getViewportSize4.width, | ||
height = _getViewportSize4.height; | ||
if (this.width !== width || this.height !== height) { | ||
@@ -407,0 +392,0 @@ this.pickingFBO.resize({ |
@@ -63,2 +63,3 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
value: function needPick(type) { | ||
this.updateLayerRenderList(); | ||
return this.layerList.some(function (layer) { | ||
@@ -65,0 +66,0 @@ return layer.needPick(type); |
@@ -47,3 +47,3 @@ "use strict"; | ||
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(layer, _ref) { | ||
var x, y, lngLat, type, target, isPicked, _this$rendererService, readPixelsAsync, getContainer, _this$getContainerSiz, width, height, _layer$getLayerConfig, enableHighlight, enableSelect, xInDevicePixel, yInDevicePixel, pickedColors, pickedFeatureIdx, rawFeature, layerTarget, _layerTarget, selectedId; | ||
var x, y, lngLat, type, target, isPicked, _this$rendererService, readPixelsAsync, getViewportSize, _getViewportSize, width, height, _layer$getLayerConfig, enableHighlight, enableSelect, xInDevicePixel, yInDevicePixel, pickedColors, pickedFeatureIdx, rawFeature, layerTarget, _layerTarget, selectedId; | ||
return _regenerator.default.wrap(function _callee$(_context) { | ||
@@ -54,6 +54,4 @@ while (1) switch (_context.prev = _context.next) { | ||
isPicked = false; | ||
_this$rendererService = _this.rendererService, readPixelsAsync = _this$rendererService.readPixelsAsync, getContainer = _this$rendererService.getContainer; | ||
_this$getContainerSiz = _this.getContainerSize(getContainer()), width = _this$getContainerSiz.width, height = _this$getContainerSiz.height; | ||
width *= _l7Utils.DOM.DPR; | ||
height *= _l7Utils.DOM.DPR; | ||
_this$rendererService = _this.rendererService, readPixelsAsync = _this$rendererService.readPixelsAsync, getViewportSize = _this$rendererService.getViewportSize; | ||
_getViewportSize = getViewportSize(), width = _getViewportSize.width, height = _getViewportSize.height; | ||
_layer$getLayerConfig = layer.getLayerConfig(), enableHighlight = _layer$getLayerConfig.enableHighlight, enableSelect = _layer$getLayerConfig.enableSelect; | ||
@@ -63,8 +61,8 @@ xInDevicePixel = x * _l7Utils.DOM.DPR; | ||
if (!(xInDevicePixel > width - 1 * _l7Utils.DOM.DPR || xInDevicePixel < 0 || yInDevicePixel > height - 1 * _l7Utils.DOM.DPR || yInDevicePixel < 0)) { | ||
_context.next = 11; | ||
_context.next = 9; | ||
break; | ||
} | ||
return _context.abrupt("return", false); | ||
case 11: | ||
_context.next = 13; | ||
case 9: | ||
_context.next = 11; | ||
return readPixelsAsync({ | ||
@@ -79,3 +77,3 @@ x: Math.floor(xInDevicePixel / _this.pickBufferScale), | ||
}); | ||
case 13: | ||
case 11: | ||
pickedColors = _context.sent; | ||
@@ -140,3 +138,3 @@ _this.pickedColors = pickedColors; | ||
return _context.abrupt("return", isPicked); | ||
case 19: | ||
case 17: | ||
case "end": | ||
@@ -158,8 +156,6 @@ return _context.stop(); | ||
createFramebuffer = _this$rendererService2.createFramebuffer, | ||
getContainer = _this$rendererService2.getContainer; | ||
var _this$getContainerSiz2 = this.getContainerSize(getContainer()), | ||
width = _this$getContainerSiz2.width, | ||
height = _this$getContainerSiz2.height; | ||
width *= _l7Utils.DOM.DPR; | ||
height *= _l7Utils.DOM.DPR; | ||
getViewportSize = _this$rendererService2.getViewportSize; | ||
var _getViewportSize2 = getViewportSize(), | ||
width = _getViewportSize2.width, | ||
height = _getViewportSize2.height; | ||
this.pickBufferScale = this.configService.getSceneConfig(id).pickBufferScale || 1; | ||
@@ -242,3 +238,3 @@ width = Math.round(width / this.pickBufferScale); | ||
var _this3 = this; | ||
var _box$map, _box$map2, xMin, yMin, xMax, yMax, _this$rendererService4, readPixelsAsync, getContainer, _this$getContainerSiz3, width, height, w, h, pickedColors, features, featuresIdMap, i, color, pickedFeatureIdx, rawFeature; | ||
var _box$map, _box$map2, xMin, yMin, xMax, yMax, _this$rendererService4, readPixelsAsync, getViewportSize, _getViewportSize3, width, height, w, h, pickedColors, features, featuresIdMap, i, color, pickedFeatureIdx, rawFeature; | ||
return _regenerator.default.wrap(function _callee4$(_context4) { | ||
@@ -251,15 +247,13 @@ while (1) switch (_context4.prev = _context4.next) { | ||
}), _box$map2 = (0, _slicedToArray2.default)(_box$map, 4), xMin = _box$map2[0], yMin = _box$map2[1], xMax = _box$map2[2], yMax = _box$map2[3]; | ||
_this$rendererService4 = this.rendererService, readPixelsAsync = _this$rendererService4.readPixelsAsync, getContainer = _this$rendererService4.getContainer; | ||
_this$getContainerSiz3 = this.getContainerSize(getContainer()), width = _this$getContainerSiz3.width, height = _this$getContainerSiz3.height; | ||
width *= _l7Utils.DOM.DPR; | ||
height *= _l7Utils.DOM.DPR; | ||
_this$rendererService4 = this.rendererService, readPixelsAsync = _this$rendererService4.readPixelsAsync, getViewportSize = _this$rendererService4.getViewportSize; | ||
_getViewportSize3 = getViewportSize(), width = _getViewportSize3.width, height = _getViewportSize3.height; | ||
if (!(xMin > (width - 1) * _l7Utils.DOM.DPR / this.pickBufferScale || xMax < 0 || yMin > (height - 1) * _l7Utils.DOM.DPR / this.pickBufferScale || yMax < 0)) { | ||
_context4.next = 7; | ||
_context4.next = 5; | ||
break; | ||
} | ||
return _context4.abrupt("return", []); | ||
case 7: | ||
case 5: | ||
w = Math.min(width / this.pickBufferScale, xMax) - xMin; | ||
h = Math.min(height / this.pickBufferScale, yMax) - yMin; | ||
_context4.next = 11; | ||
_context4.next = 9; | ||
return readPixelsAsync({ | ||
@@ -274,3 +268,3 @@ x: xMin, | ||
}); | ||
case 11: | ||
case 9: | ||
pickedColors = _context4.sent; | ||
@@ -291,3 +285,3 @@ features = []; | ||
return _context4.abrupt("return", features); | ||
case 16: | ||
case 14: | ||
case "end": | ||
@@ -338,10 +332,3 @@ return _context4.stop(); | ||
function getContainerSize(container) { | ||
if (container.getContext) { | ||
return { | ||
width: container.width / _l7Utils.DOM.DPR, | ||
height: container.height / _l7Utils.DOM.DPR | ||
}; | ||
} else { | ||
return container.getBoundingClientRect(); | ||
} | ||
return container.getBoundingClientRect(); | ||
} | ||
@@ -406,8 +393,6 @@ }, { | ||
value: function resizePickingFBO() { | ||
var getContainer = this.rendererService.getContainer; | ||
var _this$getContainerSiz4 = this.getContainerSize(getContainer()), | ||
width = _this$getContainerSiz4.width, | ||
height = _this$getContainerSiz4.height; | ||
width *= _l7Utils.DOM.DPR; | ||
height *= _l7Utils.DOM.DPR; | ||
var getViewportSize = this.rendererService.getViewportSize; | ||
var _getViewportSize4 = getViewportSize(), | ||
width = _getViewportSize4.width, | ||
height = _getViewportSize4.height; | ||
if (this.width !== width || this.height !== height) { | ||
@@ -414,0 +399,0 @@ this.pickingFBO.resize({ |
@@ -70,2 +70,3 @@ "use strict"; | ||
value: function needPick(type) { | ||
this.updateLayerRenderList(); | ||
return this.layerList.some(function (layer) { | ||
@@ -72,0 +73,0 @@ return layer.needPick(type); |
{ | ||
"name": "@antv/l7-core", | ||
"version": "2.20.19", | ||
"version": "2.20.20", | ||
"description": "", | ||
@@ -28,3 +28,3 @@ "main": "lib/index.js", | ||
"@antv/async-hook": "^2.2.9", | ||
"@antv/l7-utils": "2.20.19", | ||
"@antv/l7-utils": "2.20.20", | ||
"@babel/runtime": "^7.7.7", | ||
@@ -51,3 +51,3 @@ "@mapbox/tiny-sdf": "^1.2.5", | ||
}, | ||
"gitHead": "7a7fb59e506d8d970d296fa6efc7e668513a25f6", | ||
"gitHead": "1966dbadf9efee8d69d22beb4d89947c158da634", | ||
"publishConfig": { | ||
@@ -54,0 +54,0 @@ "access": "public" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
987679
20790
+ Added@antv/l7-utils@2.20.20(transitive)
- Removed@antv/l7-utils@2.20.19(transitive)
Updated@antv/l7-utils@2.20.20