@antv/l7-layers 2.20.19 → 2.20.20

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.
@@ -31,12 +31,12 @@ export function readRasterValue(tile, mapService, x, y) {
31
31
  }
32
32
  export function readPixel(x, y, rendererService) {
33
33
  var readPixels = rendererService.readPixels,
34
- getContainer = rendererService.getContainer;
34
+ getViewportSize = rendererService.getViewportSize;
35
35
  var xInDevicePixel = x * DOM.DPR;
36
36
  var yInDevicePixel = y * DOM.DPR;
37
- var _getContainerSize = getContainerSize(getContainer()),
38
- width = _getContainerSize.width,
39
- height = _getContainerSize.height;
37
+ var _getViewportSize = getViewportSize(),
38
+ width = _getViewportSize.width,
39
+ height = _getViewportSize.height;
40
40
  width *= DOM.DPR;
41
41
  height *= DOM.DPR;
42
42
  if (xInDevicePixel > width - 1 * DOM.DPR || xInDevicePixel < 0 || yInDevicePixel > height - 1 * DOM.DPR || yInDevicePixel < 0) {
@@ -51,14 +51,4 @@ export function readPixel(x, y, rendererService) {
51
51
  data: new Uint8Array(1 * 1 * 4)
52
52
  });
53
53
  return pickedColors;
54
- }
55
- function getContainerSize(container) {
56
- if (container.getContext) {
57
- return {
58
- width: container.width / DOM.DPR,
59
- height: container.height / DOM.DPR
60
- };
61
- } else {
62
- return container.getBoundingClientRect();
63
- }
64
54
  }
@@ -6,7 +6,3 @@ export declare const tileVectorParser: string[];
6
6
  * @returns
7
7
  */
8
8
  export declare function isTileGroup(layer: ILayer): boolean;
9
- export declare function getContainerSize(container: HTMLCanvasElement | HTMLElement): DOMRect | {
10
- width: number;
11
- height: number;
12
- };
@@ -1,4 +1,3 @@
1
- import { DOM } from '@antv/l7-utils';
2
1
  export var tileVectorParser = ['mvt', 'geojsonvt', 'testTile'];
3
2
 
4
3
  /**
@@ -9,14 +8,4 @@ export var tileVectorParser = ['mvt', 'geojsonvt', 'testTile'];
9
8
  export function isTileGroup(layer) {
10
9
  var source = layer.getSource();
11
10
  return tileVectorParser.includes(source.parser.type);
12
- }
13
- export function getContainerSize(container) {
14
- if (container.getContext) {
15
- return {
16
- width: container.width / DOM.DPR,
17
- height: container.height / DOM.DPR
18
- };
19
- } else {
20
- return container.getBoundingClientRect();
21
- }
22
11
  }
@@ -39,12 +39,12 @@ function readRasterValue(tile, mapService, x, y) {
39
39
  }
40
40
  function readPixel(x, y, rendererService) {
41
41
  var readPixels = rendererService.readPixels,
42
- getContainer = rendererService.getContainer;
42
+ getViewportSize = rendererService.getViewportSize;
43
43
  var xInDevicePixel = x * _l7Utils.DOM.DPR;
44
44
  var yInDevicePixel = y * _l7Utils.DOM.DPR;
45
- var _getContainerSize = getContainerSize(getContainer()),
46
- width = _getContainerSize.width,
47
- height = _getContainerSize.height;
45
+ var _getViewportSize = getViewportSize(),
46
+ width = _getViewportSize.width,
47
+ height = _getViewportSize.height;
48
48
  width *= _l7Utils.DOM.DPR;
49
49
  height *= _l7Utils.DOM.DPR;
50
50
  if (xInDevicePixel > width - 1 * _l7Utils.DOM.DPR || xInDevicePixel < 0 || yInDevicePixel > height - 1 * _l7Utils.DOM.DPR || yInDevicePixel < 0) {
@@ -59,14 +59,4 @@ function readPixel(x, y, rendererService) {
59
59
  data: new Uint8Array(1 * 1 * 4)
60
60
  });
61
61
  return pickedColors;
62
- }
63
- function getContainerSize(container) {
64
- if (container.getContext) {
65
- return {
66
- width: container.width / _l7Utils.DOM.DPR,
67
- height: container.height / _l7Utils.DOM.DPR
68
- };
69
- } else {
70
- return container.getBoundingClientRect();
71
- }
72
62
  }
@@ -3,10 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getContainerSize = getContainerSize;
7
6
  exports.isTileGroup = isTileGroup;
8
7
  exports.tileVectorParser = void 0;
9
- var _l7Utils = require("@antv/l7-utils");
10
8
  var tileVectorParser = exports.tileVectorParser = ['mvt', 'geojsonvt', 'testTile'];
11
9
 
12
10
  /**
@@ -17,14 +15,4 @@ var tileVectorParser = exports.tileVectorParser = ['mvt', 'geojsonvt', 'testTile
17
15
  function isTileGroup(layer) {
18
16
  var source = layer.getSource();
19
17
  return tileVectorParser.includes(source.parser.type);
20
- }
21
- function getContainerSize(container) {
22
- if (container.getContext) {
23
- return {
24
- width: container.width / _l7Utils.DOM.DPR,
25
- height: container.height / _l7Utils.DOM.DPR
26
- };
27
- } else {
28
- return container.getBoundingClientRect();
29
- }
30
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/l7-layers",
3
- "version": "2.20.19",
3
+ "version": "2.20.20",
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.20.19",
31
- "@antv/l7-maps": "2.20.19",
32
- "@antv/l7-source": "2.20.19",
33
- "@antv/l7-utils": "2.20.19",
30
+ "@antv/l7-core": "2.20.20",
31
+ "@antv/l7-maps": "2.20.20",
32
+ "@antv/l7-source": "2.20.20",
33
+ "@antv/l7-utils": "2.20.20",
34
34
  "@babel/runtime": "^7.7.7",
35
35
  "@mapbox/martini": "^0.2.0",
36
36
  "@turf/clone": "^6.5.0",
@@ -52,7 +52,7 @@
52
52
  "reflect-metadata": "^0.1.13"
53
53
  },
54
54
  "devDependencies": {
55
- "@antv/l7-test-utils": "2.20.19",
55
+ "@antv/l7-test-utils": "2.20.20",
56
56
  "@types/d3-array": "^2.0.0",
57
57
  "@types/d3-color": "^1.2.2",
58
58
  "@types/d3-interpolate": "1.1.6",
@@ -61,7 +61,7 @@
61
61
  "@types/gl-matrix": "^2.4.5",
62
62
  "@types/lodash": "^4.14.138"
63
63
  },
64
- "gitHead": "7a7fb59e506d8d970d296fa6efc7e668513a25f6",
64
+ "gitHead": "1966dbadf9efee8d69d22beb4d89947c158da634",
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  }