@antv/l7-core
Advanced tools
Comparing version 2.1.2 to 2.1.3
@@ -6,2 +6,16 @@ # Change Log | ||
## [2.1.3](https://github.com/antvis/L7/compare/v2.0.36...v2.1.3) (2020-03-17) | ||
### Bug Fixes | ||
* ios 12 点击事件问题 & regl 版本锁定 ([ad52e8e](https://github.com/antvis/L7/commit/ad52e8e8fde4a7b4b3e16d86a6035bd7c07fb80c)) | ||
* ios touchstart && double touch ([4fc3a11](https://github.com/antvis/L7/commit/4fc3a11de953918a9f5ba13d767c00429d1711cd)) | ||
* mapbox 光照问题 ([20d2a6d](https://github.com/antvis/L7/commit/20d2a6d8b803ca3ad87cc1ef69a59d1e3d348cef)) | ||
* merge conflict ([89c8cb2](https://github.com/antvis/L7/commit/89c8cb2c0250eb5a28d96d82c87b804bf3db4c30)) | ||
## [2.1.2](https://github.com/antvis/L7/compare/v2.0.36...v2.1.2) (2020-03-15) | ||
@@ -8,0 +22,0 @@ |
@@ -44,4 +44,10 @@ import _initializerDefineProperty from "@babel/runtime/helpers/initializerDefineProperty"; | ||
_this.onTouch = function (target) { | ||
var touch = target.touches[0]; | ||
target.stopPropagation(); | ||
if (target.targetTouches.length > 1) { | ||
return; | ||
} | ||
var touch = target.targetTouches[0]; | ||
_this.onHover({ | ||
@@ -88,8 +94,10 @@ x: touch.pageX, | ||
_this.emit(InteractionEvent.Hover, { | ||
x: x, | ||
y: y, | ||
lngLat: lngLat, | ||
type: type | ||
}); | ||
if (type !== 'click' || type !== 'click') { | ||
_this.emit(InteractionEvent.Hover, { | ||
x: x, | ||
y: y, | ||
lngLat: lngLat, | ||
type: type | ||
}); | ||
} | ||
}; | ||
@@ -96,0 +104,0 @@ |
@@ -13,3 +13,2 @@ import { IPickingService } from './IPickingService'; | ||
private pickingLayers; | ||
private pickingLayer; | ||
private pickFromPickingFBO; | ||
@@ -32,4 +31,2 @@ private triggerHoverOnLayer; | ||
private selectFeature; | ||
private selectFeatureHandle; | ||
private highlightFeatureHandle; | ||
} |
@@ -17,3 +17,3 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray"; | ||
import { decodePickingColor, encodePickingColor } from '@antv/l7-utils'; | ||
import { decodePickingColor } from '@antv/l7-utils'; | ||
import { inject, injectable } from 'inversify'; | ||
@@ -50,4 +50,3 @@ import { TYPES } from '../../types'; | ||
getViewportSize = _this$rendererService.getViewportSize, | ||
readPixels = _this$rendererService.readPixels, | ||
useFramebuffer = _this$rendererService.useFramebuffer; | ||
readPixels = _this$rendererService.readPixels; | ||
@@ -244,54 +243,2 @@ var _getViewportSize = getViewportSize(), | ||
}, { | ||
key: "pickingLayer", | ||
value: function () { | ||
var _pickingLayer = _asyncToGenerator(_regeneratorRuntime.mark(function _callee3(layer, target) { | ||
var _this3 = this; | ||
var _this$rendererService4, getViewportSize, useFramebuffer, clear, _getViewportSize4, width, height; | ||
return _regeneratorRuntime.wrap(function _callee3$(_context3) { | ||
while (1) { | ||
switch (_context3.prev = _context3.next) { | ||
case 0: | ||
_this$rendererService4 = this.rendererService, getViewportSize = _this$rendererService4.getViewportSize, useFramebuffer = _this$rendererService4.useFramebuffer, clear = _this$rendererService4.clear; | ||
_getViewportSize4 = getViewportSize(), width = _getViewportSize4.width, height = _getViewportSize4.height; | ||
if (this.width !== width || this.height !== height) { | ||
this.pickingFBO.resize({ | ||
width: Math.round(width / PICKSCALE), | ||
height: Math.round(height / PICKSCALE) | ||
}); | ||
this.width = width; | ||
this.height = height; | ||
} | ||
useFramebuffer(this.pickingFBO, function () { | ||
clear({ | ||
framebuffer: _this3.pickingFBO, | ||
color: [0, 0, 0, 0], | ||
stencil: 0, | ||
depth: 1 | ||
}); | ||
layer.hooks.beforePickingEncode.call(); | ||
layer.renderModels(); | ||
layer.hooks.afterPickingEncode.call(); | ||
_this3.pickFromPickingFBO(layer, target); | ||
}); | ||
case 4: | ||
case "end": | ||
return _context3.stop(); | ||
} | ||
} | ||
}, _callee3, this); | ||
})); | ||
function pickingLayer(_x3, _x4) { | ||
return _pickingLayer.apply(this, arguments); | ||
} | ||
return pickingLayer; | ||
}() | ||
}, { | ||
key: "triggerHoverOnLayer", | ||
@@ -321,16 +268,2 @@ value: function triggerHoverOnLayer(layer, target) { | ||
} | ||
}, { | ||
key: "selectFeatureHandle", | ||
value: function selectFeatureHandle(layer, _ref2) { | ||
var featureId = _ref2.featureId; | ||
var pickedColors = encodePickingColor(featureId); | ||
this.selectFeature(layer, new Uint8Array(pickedColors)); | ||
} | ||
}, { | ||
key: "highlightFeatureHandle", | ||
value: function highlightFeatureHandle(layer, _ref3) { | ||
var featureId = _ref3.featureId; | ||
var pickedColors = encodePickingColor(featureId); | ||
this.highlightPickedFeature(layer, new Uint8Array(pickedColors)); | ||
} | ||
}]); | ||
@@ -337,0 +270,0 @@ |
@@ -75,2 +75,4 @@ import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
if (_this.$container) { | ||
var _this$$container; | ||
var pixelRatio = window.devicePixelRatio; | ||
@@ -87,2 +89,4 @@ var w = window.innerWidth; | ||
var canvas = (_this$$container = _this.$container) === null || _this$$container === void 0 ? void 0 : _this$$container.getElementsByTagName('canvas')[0]; | ||
_this.rendererService.viewport({ | ||
@@ -98,2 +102,7 @@ x: 0, | ||
if (canvas) { | ||
canvas.width = w * pixelRatio; | ||
canvas.height = h * pixelRatio; | ||
} | ||
_this.render(); | ||
@@ -276,5 +285,5 @@ } | ||
value: function exportPng(type) { | ||
var _this$$container; | ||
var _this$$container2; | ||
var renderCanvas = (_this$$container = this.$container) === null || _this$$container === void 0 ? void 0 : _this$$container.getElementsByTagName('canvas')[0]; | ||
var renderCanvas = (_this$$container2 = this.$container) === null || _this$$container2 === void 0 ? void 0 : _this$$container2.getElementsByTagName('canvas')[0]; | ||
this.render(); | ||
@@ -281,0 +290,0 @@ var layersPng = type === 'jpg' ? renderCanvas === null || renderCanvas === void 0 ? void 0 : renderCanvas.toDataURL('image/jpeg') : renderCanvas === null || renderCanvas === void 0 ? void 0 : renderCanvas.toDataURL('image/png'); |
@@ -63,4 +63,10 @@ "use strict"; | ||
_this.onTouch = function (target) { | ||
var touch = target.touches[0]; | ||
target.stopPropagation(); | ||
if (target.targetTouches.length > 1) { | ||
return; | ||
} | ||
var touch = target.targetTouches[0]; | ||
_this.onHover({ | ||
@@ -107,8 +113,10 @@ x: touch.pageX, | ||
_this.emit(_IInteractionService.InteractionEvent.Hover, { | ||
x: x, | ||
y: y, | ||
lngLat: lngLat, | ||
type: type | ||
}); | ||
if (type !== 'click' || type !== 'click') { | ||
_this.emit(_IInteractionService.InteractionEvent.Hover, { | ||
x: x, | ||
y: y, | ||
lngLat: lngLat, | ||
type: type | ||
}); | ||
} | ||
}; | ||
@@ -115,0 +123,0 @@ |
@@ -67,4 +67,3 @@ "use strict"; | ||
getViewportSize = _this$rendererService.getViewportSize, | ||
readPixels = _this$rendererService.readPixels, | ||
useFramebuffer = _this$rendererService.useFramebuffer; | ||
readPixels = _this$rendererService.readPixels; | ||
@@ -261,54 +260,2 @@ var _getViewportSize = getViewportSize(), | ||
}, { | ||
key: "pickingLayer", | ||
value: function () { | ||
var _pickingLayer = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(layer, target) { | ||
var _this3 = this; | ||
var _this$rendererService4, getViewportSize, useFramebuffer, clear, _getViewportSize4, width, height; | ||
return _regenerator.default.wrap(function _callee3$(_context3) { | ||
while (1) { | ||
switch (_context3.prev = _context3.next) { | ||
case 0: | ||
_this$rendererService4 = this.rendererService, getViewportSize = _this$rendererService4.getViewportSize, useFramebuffer = _this$rendererService4.useFramebuffer, clear = _this$rendererService4.clear; | ||
_getViewportSize4 = getViewportSize(), width = _getViewportSize4.width, height = _getViewportSize4.height; | ||
if (this.width !== width || this.height !== height) { | ||
this.pickingFBO.resize({ | ||
width: Math.round(width / PICKSCALE), | ||
height: Math.round(height / PICKSCALE) | ||
}); | ||
this.width = width; | ||
this.height = height; | ||
} | ||
useFramebuffer(this.pickingFBO, function () { | ||
clear({ | ||
framebuffer: _this3.pickingFBO, | ||
color: [0, 0, 0, 0], | ||
stencil: 0, | ||
depth: 1 | ||
}); | ||
layer.hooks.beforePickingEncode.call(); | ||
layer.renderModels(); | ||
layer.hooks.afterPickingEncode.call(); | ||
_this3.pickFromPickingFBO(layer, target); | ||
}); | ||
case 4: | ||
case "end": | ||
return _context3.stop(); | ||
} | ||
} | ||
}, _callee3, this); | ||
})); | ||
function pickingLayer(_x3, _x4) { | ||
return _pickingLayer.apply(this, arguments); | ||
} | ||
return pickingLayer; | ||
}() | ||
}, { | ||
key: "triggerHoverOnLayer", | ||
@@ -338,16 +285,2 @@ value: function triggerHoverOnLayer(layer, target) { | ||
} | ||
}, { | ||
key: "selectFeatureHandle", | ||
value: function selectFeatureHandle(layer, _ref2) { | ||
var featureId = _ref2.featureId; | ||
var pickedColors = (0, _l7Utils.encodePickingColor)(featureId); | ||
this.selectFeature(layer, new Uint8Array(pickedColors)); | ||
} | ||
}, { | ||
key: "highlightFeatureHandle", | ||
value: function highlightFeatureHandle(layer, _ref3) { | ||
var featureId = _ref3.featureId; | ||
var pickedColors = (0, _l7Utils.encodePickingColor)(featureId); | ||
this.highlightPickedFeature(layer, new Uint8Array(pickedColors)); | ||
} | ||
}]); | ||
@@ -354,0 +287,0 @@ return PickingService; |
@@ -85,2 +85,4 @@ "use strict"; | ||
if (_this.$container) { | ||
var _this$$container; | ||
var pixelRatio = window.devicePixelRatio; | ||
@@ -97,2 +99,4 @@ var w = window.innerWidth; | ||
var canvas = (_this$$container = _this.$container) === null || _this$$container === void 0 ? void 0 : _this$$container.getElementsByTagName('canvas')[0]; | ||
_this.rendererService.viewport({ | ||
@@ -109,2 +113,7 @@ x: 0, | ||
if (canvas) { | ||
canvas.width = w * pixelRatio; | ||
canvas.height = h * pixelRatio; | ||
} | ||
_this.render(); | ||
@@ -287,5 +296,5 @@ } | ||
value: function exportPng(type) { | ||
var _this$$container; | ||
var _this$$container2; | ||
var renderCanvas = (_this$$container = this.$container) === null || _this$$container === void 0 ? void 0 : _this$$container.getElementsByTagName('canvas')[0]; | ||
var renderCanvas = (_this$$container2 = this.$container) === null || _this$$container2 === void 0 ? void 0 : _this$$container2.getElementsByTagName('canvas')[0]; | ||
this.render(); | ||
@@ -292,0 +301,0 @@ var layersPng = type === 'jpg' ? renderCanvas === null || renderCanvas === void 0 ? void 0 : renderCanvas.toDataURL('image/jpeg') : renderCanvas === null || renderCanvas === void 0 ? void 0 : renderCanvas.toDataURL('image/png'); |
{ | ||
"name": "@antv/l7-core", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "", | ||
@@ -26,3 +26,3 @@ "main": "lib/index.js", | ||
"@antv/async-hook": "^2.1.0", | ||
"@antv/l7-utils": "^2.1.2", | ||
"@antv/l7-utils": "^2.1.3", | ||
"@babel/runtime": "^7.7.7", | ||
@@ -50,3 +50,3 @@ "@mapbox/tiny-sdf": "^1.1.1", | ||
}, | ||
"gitHead": "8cea3bc05d80e389909dd1828cc64c63c6bc39e4", | ||
"gitHead": "6730b38cdfc8ba2fed5de530871a44fa351eff6f", | ||
"publishConfig": { | ||
@@ -53,0 +53,0 @@ "access": "public" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1350686
14636
Updated@antv/l7-utils@^2.1.3