@deck.gl/geo-layers 8.7.0-beta.6 → 8.7.0-beta.7
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/dist/dist.dev.js +216 -149
- package/dist/es5/geo-cell-layer/GeoCellLayer.js +112 -0
- package/dist/es5/geo-cell-layer/GeoCellLayer.js.map +1 -0
- package/dist/es5/h3-layers/h3-cluster-layer.js +10 -59
- package/dist/es5/h3-layers/h3-cluster-layer.js.map +1 -1
- package/dist/es5/index.js +8 -0
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/quadkey-layer/quadkey-layer.js +69 -0
- package/dist/es5/quadkey-layer/quadkey-layer.js.map +1 -0
- package/dist/es5/quadkey-layer/quadkey-utils.js +51 -0
- package/dist/es5/quadkey-layer/quadkey-utils.js.map +1 -0
- package/dist/es5/s2-layer/s2-layer.js +10 -68
- package/dist/es5/s2-layer/s2-layer.js.map +1 -1
- package/dist/es5/tile-layer/utils.js +1 -1
- package/dist/es5/tile-layer/utils.js.map +1 -1
- package/dist/esm/geo-cell-layer/GeoCellLayer.js +68 -0
- package/dist/esm/geo-cell-layer/GeoCellLayer.js.map +1 -0
- package/dist/esm/h3-layers/h3-cluster-layer.js +7 -51
- package/dist/esm/h3-layers/h3-cluster-layer.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/quadkey-layer/quadkey-layer.js +26 -0
- package/dist/esm/quadkey-layer/quadkey-layer.js.map +1 -0
- package/dist/esm/quadkey-layer/quadkey-utils.js +24 -0
- package/dist/esm/quadkey-layer/quadkey-utils.js.map +1 -0
- package/dist/esm/s2-layer/s2-layer.js +6 -59
- package/dist/esm/s2-layer/s2-layer.js.map +1 -1
- package/dist/esm/tile-layer/utils.js +1 -1
- package/dist/esm/tile-layer/utils.js.map +1 -1
- package/dist.min.js +2 -2
- package/package.json +2 -2
- package/src/geo-cell-layer/GeoCellLayer.js +80 -0
- package/src/h3-layers/h3-cluster-layer.js +8 -64
- package/src/index.ts +1 -0
- package/src/quadkey-layer/quadkey-layer.js +22 -0
- package/src/quadkey-layer/quadkey-utils.js +28 -0
- package/src/s2-layer/s2-layer.js +9 -75
- package/src/tile-layer/utils.js +4 -4
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
+
|
|
16
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
+
|
|
18
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
+
|
|
20
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
21
|
+
|
|
22
|
+
var _core = require("@deck.gl/core");
|
|
23
|
+
|
|
24
|
+
var _layers = require("@deck.gl/layers");
|
|
25
|
+
|
|
26
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
27
|
+
|
|
28
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
29
|
+
|
|
30
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
31
|
+
|
|
32
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
33
|
+
|
|
34
|
+
var defaultProps = _objectSpread({}, _layers.PolygonLayer.defaultProps);
|
|
35
|
+
|
|
36
|
+
var GeoCellLayer = function (_CompositeLayer) {
|
|
37
|
+
(0, _inherits2.default)(GeoCellLayer, _CompositeLayer);
|
|
38
|
+
|
|
39
|
+
var _super = _createSuper(GeoCellLayer);
|
|
40
|
+
|
|
41
|
+
function GeoCellLayer() {
|
|
42
|
+
(0, _classCallCheck2.default)(this, GeoCellLayer);
|
|
43
|
+
return _super.apply(this, arguments);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
(0, _createClass2.default)(GeoCellLayer, [{
|
|
47
|
+
key: "indexToBounds",
|
|
48
|
+
value: function indexToBounds() {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}, {
|
|
52
|
+
key: "renderLayers",
|
|
53
|
+
value: function renderLayers() {
|
|
54
|
+
var _this$props = this.props,
|
|
55
|
+
elevationScale = _this$props.elevationScale,
|
|
56
|
+
extruded = _this$props.extruded,
|
|
57
|
+
wireframe = _this$props.wireframe,
|
|
58
|
+
filled = _this$props.filled,
|
|
59
|
+
stroked = _this$props.stroked,
|
|
60
|
+
lineWidthUnits = _this$props.lineWidthUnits,
|
|
61
|
+
lineWidthScale = _this$props.lineWidthScale,
|
|
62
|
+
lineWidthMinPixels = _this$props.lineWidthMinPixels,
|
|
63
|
+
lineWidthMaxPixels = _this$props.lineWidthMaxPixels,
|
|
64
|
+
lineJointRounded = _this$props.lineJointRounded,
|
|
65
|
+
lineMiterLimit = _this$props.lineMiterLimit,
|
|
66
|
+
lineDashJustified = _this$props.lineDashJustified,
|
|
67
|
+
getElevation = _this$props.getElevation,
|
|
68
|
+
getFillColor = _this$props.getFillColor,
|
|
69
|
+
getLineColor = _this$props.getLineColor,
|
|
70
|
+
getLineWidth = _this$props.getLineWidth;
|
|
71
|
+
var _this$props2 = this.props,
|
|
72
|
+
updateTriggers = _this$props2.updateTriggers,
|
|
73
|
+
material = _this$props2.material,
|
|
74
|
+
transitions = _this$props2.transitions;
|
|
75
|
+
var CellLayer = this.getSubLayerClass('cell', _layers.PolygonLayer);
|
|
76
|
+
return new CellLayer({
|
|
77
|
+
filled: filled,
|
|
78
|
+
wireframe: wireframe,
|
|
79
|
+
extruded: extruded,
|
|
80
|
+
elevationScale: elevationScale,
|
|
81
|
+
stroked: stroked,
|
|
82
|
+
lineWidthUnits: lineWidthUnits,
|
|
83
|
+
lineWidthScale: lineWidthScale,
|
|
84
|
+
lineWidthMinPixels: lineWidthMinPixels,
|
|
85
|
+
lineWidthMaxPixels: lineWidthMaxPixels,
|
|
86
|
+
lineJointRounded: lineJointRounded,
|
|
87
|
+
lineMiterLimit: lineMiterLimit,
|
|
88
|
+
lineDashJustified: lineDashJustified,
|
|
89
|
+
material: material,
|
|
90
|
+
transitions: transitions,
|
|
91
|
+
getElevation: getElevation,
|
|
92
|
+
getFillColor: getFillColor,
|
|
93
|
+
getLineColor: getLineColor,
|
|
94
|
+
getLineWidth: getLineWidth
|
|
95
|
+
}, this.getSubLayerProps({
|
|
96
|
+
id: 'cell',
|
|
97
|
+
updateTriggers: {
|
|
98
|
+
getElevation: updateTriggers.getElevation,
|
|
99
|
+
getFillColor: updateTriggers.getFillColor,
|
|
100
|
+
getLineColor: updateTriggers.getLineColor,
|
|
101
|
+
getLineWidth: updateTriggers.getLineWidth
|
|
102
|
+
}
|
|
103
|
+
}), this.indexToBounds());
|
|
104
|
+
}
|
|
105
|
+
}]);
|
|
106
|
+
return GeoCellLayer;
|
|
107
|
+
}(_core.CompositeLayer);
|
|
108
|
+
|
|
109
|
+
exports.default = GeoCellLayer;
|
|
110
|
+
GeoCellLayer.layerName = 'GeoCellLayer';
|
|
111
|
+
GeoCellLayer.defaultProps = defaultProps;
|
|
112
|
+
//# sourceMappingURL=GeoCellLayer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/geo-cell-layer/GeoCellLayer.js"],"names":["defaultProps","PolygonLayer","GeoCellLayer","props","elevationScale","extruded","wireframe","filled","stroked","lineWidthUnits","lineWidthScale","lineWidthMinPixels","lineWidthMaxPixels","lineJointRounded","lineMiterLimit","lineDashJustified","getElevation","getFillColor","getLineColor","getLineWidth","updateTriggers","material","transitions","CellLayer","getSubLayerClass","getSubLayerProps","id","indexToBounds","CompositeLayer","layerName"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;;;;;AAEA,IAAMA,YAAY,qBACbC,qBAAaD,YADA,CAAlB;;IAIqBE,Y;;;;;;;;;;;;WAEnB,yBAAgB;AACd,aAAO,IAAP;AACD;;;WAED,wBAAe;AAEb,wBAiBI,KAAKC,KAjBT;AAAA,UACEC,cADF,eACEA,cADF;AAAA,UAEEC,QAFF,eAEEA,QAFF;AAAA,UAGEC,SAHF,eAGEA,SAHF;AAAA,UAIEC,MAJF,eAIEA,MAJF;AAAA,UAKEC,OALF,eAKEA,OALF;AAAA,UAMEC,cANF,eAMEA,cANF;AAAA,UAOEC,cAPF,eAOEA,cAPF;AAAA,UAQEC,kBARF,eAQEA,kBARF;AAAA,UASEC,kBATF,eASEA,kBATF;AAAA,UAUEC,gBAVF,eAUEA,gBAVF;AAAA,UAWEC,cAXF,eAWEA,cAXF;AAAA,UAYEC,iBAZF,eAYEA,iBAZF;AAAA,UAaEC,YAbF,eAaEA,YAbF;AAAA,UAcEC,YAdF,eAcEA,YAdF;AAAA,UAeEC,YAfF,eAeEA,YAfF;AAAA,UAgBEC,YAhBF,eAgBEA,YAhBF;AAoBA,yBAAgD,KAAKhB,KAArD;AAAA,UAAOiB,cAAP,gBAAOA,cAAP;AAAA,UAAuBC,QAAvB,gBAAuBA,QAAvB;AAAA,UAAiCC,WAAjC,gBAAiCA,WAAjC;AAGA,UAAMC,SAAS,GAAG,KAAKC,gBAAL,CAAsB,MAAtB,EAA8BvB,oBAA9B,CAAlB;AACA,aAAO,IAAIsB,SAAJ,CACL;AACEhB,QAAAA,MAAM,EAANA,MADF;AAEED,QAAAA,SAAS,EAATA,SAFF;AAIED,QAAAA,QAAQ,EAARA,QAJF;AAKED,QAAAA,cAAc,EAAdA,cALF;AAOEI,QAAAA,OAAO,EAAPA,OAPF;AAQEC,QAAAA,cAAc,EAAdA,cARF;AASEC,QAAAA,cAAc,EAAdA,cATF;AAUEC,QAAAA,kBAAkB,EAAlBA,kBAVF;AAWEC,QAAAA,kBAAkB,EAAlBA,kBAXF;AAYEC,QAAAA,gBAAgB,EAAhBA,gBAZF;AAaEC,QAAAA,cAAc,EAAdA,cAbF;AAcEC,QAAAA,iBAAiB,EAAjBA,iBAdF;AAgBEM,QAAAA,QAAQ,EAARA,QAhBF;AAiBEC,QAAAA,WAAW,EAAXA,WAjBF;AAmBEN,QAAAA,YAAY,EAAZA,YAnBF;AAoBEC,QAAAA,YAAY,EAAZA,YApBF;AAqBEC,QAAAA,YAAY,EAAZA,YArBF;AAsBEC,QAAAA,YAAY,EAAZA;AAtBF,OADK,EAyBL,KAAKM,gBAAL,CAAsB;AACpBC,QAAAA,EAAE,EAAE,MADgB;AAEpBN,QAAAA,cAAc,EAAE;AACdJ,UAAAA,YAAY,EAAEI,cAAc,CAACJ,YADf;AAEdC,UAAAA,YAAY,EAAEG,cAAc,CAACH,YAFf;AAGdC,UAAAA,YAAY,EAAEE,cAAc,CAACF,YAHf;AAIdC,UAAAA,YAAY,EAAEC,cAAc,CAACD;AAJf;AAFI,OAAtB,CAzBK,EAkCL,KAAKQ,aAAL,EAlCK,CAAP;AAoCD;;;EApEuCC,oB;;;AAuE1C1B,YAAY,CAAC2B,SAAb,GAAyB,cAAzB;AACA3B,YAAY,CAACF,YAAb,GAA4BA,YAA5B","sourcesContent":["import {CompositeLayer} from '@deck.gl/core';\nimport {PolygonLayer} from '@deck.gl/layers';\n\nconst defaultProps = {\n ...PolygonLayer.defaultProps\n};\n\nexport default class GeoCellLayer extends CompositeLayer {\n // Implement to generate props to create geometry\n indexToBounds() {\n return null;\n }\n\n renderLayers() {\n // Rendering props underlying layer\n const {\n elevationScale,\n extruded,\n wireframe,\n filled,\n stroked,\n lineWidthUnits,\n lineWidthScale,\n lineWidthMinPixels,\n lineWidthMaxPixels,\n lineJointRounded,\n lineMiterLimit,\n lineDashJustified,\n getElevation,\n getFillColor,\n getLineColor,\n getLineWidth\n } = this.props;\n\n // Accessor props for underlying layers\n const {updateTriggers, material, transitions} = this.props;\n\n // Filled Polygon Layer\n const CellLayer = this.getSubLayerClass('cell', PolygonLayer);\n return new CellLayer(\n {\n filled,\n wireframe,\n\n extruded,\n elevationScale,\n\n stroked,\n lineWidthUnits,\n lineWidthScale,\n lineWidthMinPixels,\n lineWidthMaxPixels,\n lineJointRounded,\n lineMiterLimit,\n lineDashJustified,\n\n material,\n transitions,\n\n getElevation,\n getFillColor,\n getLineColor,\n getLineWidth\n },\n this.getSubLayerProps({\n id: 'cell',\n updateTriggers: {\n getElevation: updateTriggers.getElevation,\n getFillColor: updateTriggers.getFillColor,\n getLineColor: updateTriggers.getLineColor,\n getLineWidth: updateTriggers.getLineWidth\n }\n }),\n this.indexToBounds()\n );\n }\n}\n\nGeoCellLayer.layerName = 'GeoCellLayer';\nGeoCellLayer.defaultProps = defaultProps;\n"],"file":"GeoCellLayer.js"}
|
|
@@ -17,13 +17,11 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
17
17
|
|
|
18
18
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
19
|
|
|
20
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
21
|
-
|
|
22
20
|
var _h3Js = require("h3-js");
|
|
23
21
|
|
|
24
22
|
var _core = require("@deck.gl/core");
|
|
25
23
|
|
|
26
|
-
var
|
|
24
|
+
var _GeoCellLayer2 = _interopRequireDefault(require("../geo-cell-layer/GeoCellLayer"));
|
|
27
25
|
|
|
28
26
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
29
27
|
|
|
@@ -35,21 +33,17 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
35
33
|
|
|
36
34
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
41
|
-
|
|
42
|
-
var defaultProps = _objectSpread(_objectSpread({}, _layers.PolygonLayer.defaultProps), {}, {
|
|
36
|
+
var defaultProps = {
|
|
43
37
|
getHexagons: {
|
|
44
38
|
type: 'accessor',
|
|
45
39
|
value: function value(d) {
|
|
46
40
|
return d.hexagons;
|
|
47
41
|
}
|
|
48
42
|
}
|
|
49
|
-
}
|
|
43
|
+
};
|
|
50
44
|
|
|
51
|
-
var H3ClusterLayer = function (
|
|
52
|
-
(0, _inherits2.default)(H3ClusterLayer,
|
|
45
|
+
var H3ClusterLayer = function (_GeoCellLayer) {
|
|
46
|
+
(0, _inherits2.default)(H3ClusterLayer, _GeoCellLayer);
|
|
53
47
|
|
|
54
48
|
var _super = _createSuper(H3ClusterLayer);
|
|
55
49
|
|
|
@@ -112,61 +106,18 @@ var H3ClusterLayer = function (_CompositeLayer) {
|
|
|
112
106
|
}
|
|
113
107
|
}
|
|
114
108
|
}, {
|
|
115
|
-
key: "
|
|
116
|
-
value: function
|
|
117
|
-
|
|
118
|
-
elevationScale = _this$props.elevationScale,
|
|
119
|
-
extruded = _this$props.extruded,
|
|
120
|
-
wireframe = _this$props.wireframe,
|
|
121
|
-
filled = _this$props.filled,
|
|
122
|
-
stroked = _this$props.stroked,
|
|
123
|
-
lineWidthScale = _this$props.lineWidthScale,
|
|
124
|
-
lineWidthMinPixels = _this$props.lineWidthMinPixels,
|
|
125
|
-
lineWidthMaxPixels = _this$props.lineWidthMaxPixels,
|
|
126
|
-
lineJointRounded = _this$props.lineJointRounded,
|
|
127
|
-
lineMiterLimit = _this$props.lineMiterLimit,
|
|
128
|
-
lineDashJustified = _this$props.lineDashJustified,
|
|
129
|
-
material = _this$props.material,
|
|
130
|
-
getFillColor = _this$props.getFillColor,
|
|
131
|
-
getLineColor = _this$props.getLineColor,
|
|
132
|
-
getLineWidth = _this$props.getLineWidth,
|
|
133
|
-
getLineDashArray = _this$props.getLineDashArray,
|
|
134
|
-
getElevation = _this$props.getElevation,
|
|
135
|
-
transitions = _this$props.transitions,
|
|
136
|
-
updateTriggers = _this$props.updateTriggers;
|
|
137
|
-
var SubLayerClass = this.getSubLayerClass('cluster-region', _layers.PolygonLayer);
|
|
138
|
-
return new SubLayerClass({
|
|
139
|
-
filled: filled,
|
|
140
|
-
wireframe: wireframe,
|
|
141
|
-
extruded: extruded,
|
|
142
|
-
elevationScale: elevationScale,
|
|
143
|
-
stroked: stroked,
|
|
144
|
-
lineWidthScale: lineWidthScale,
|
|
145
|
-
lineWidthMinPixels: lineWidthMinPixels,
|
|
146
|
-
lineWidthMaxPixels: lineWidthMaxPixels,
|
|
147
|
-
lineJointRounded: lineJointRounded,
|
|
148
|
-
lineMiterLimit: lineMiterLimit,
|
|
149
|
-
lineDashJustified: lineDashJustified,
|
|
150
|
-
material: material,
|
|
151
|
-
transitions: transitions,
|
|
152
|
-
getFillColor: this.getSubLayerAccessor(getFillColor),
|
|
153
|
-
getLineColor: this.getSubLayerAccessor(getLineColor),
|
|
154
|
-
getLineWidth: this.getSubLayerAccessor(getLineWidth),
|
|
155
|
-
getLineDashArray: this.getSubLayerAccessor(getLineDashArray),
|
|
156
|
-
getElevation: this.getSubLayerAccessor(getElevation)
|
|
157
|
-
}, this.getSubLayerProps({
|
|
158
|
-
id: 'cluster-region',
|
|
159
|
-
updateTriggers: updateTriggers
|
|
160
|
-
}), {
|
|
109
|
+
key: "indexToBounds",
|
|
110
|
+
value: function indexToBounds() {
|
|
111
|
+
return {
|
|
161
112
|
data: this.state.polygons,
|
|
162
113
|
getPolygon: function getPolygon(d) {
|
|
163
114
|
return d.polygon;
|
|
164
115
|
}
|
|
165
|
-
}
|
|
116
|
+
};
|
|
166
117
|
}
|
|
167
118
|
}]);
|
|
168
119
|
return H3ClusterLayer;
|
|
169
|
-
}(
|
|
120
|
+
}(_GeoCellLayer2.default);
|
|
170
121
|
|
|
171
122
|
exports.default = H3ClusterLayer;
|
|
172
123
|
H3ClusterLayer.defaultProps = defaultProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/h3-layers/h3-cluster-layer.js"],"names":["defaultProps","
|
|
1
|
+
{"version":3,"sources":["../../../src/h3-layers/h3-cluster-layer.js"],"names":["defaultProps","getHexagons","type","value","d","hexagons","H3ClusterLayer","props","oldProps","changeFlags","dataChanged","updateTriggers","data","polygons","iterable","objectInfo","object","index","multiPolygon","polygon","push","getSubLayerRow","setState","state","getPolygon","GeoCellLayer","layerName"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;;;;;;;;;;;AAEA,IAAMA,YAAY,GAAG;AACnBC,EAAAA,WAAW,EAAE;AAACC,IAAAA,IAAI,EAAE,UAAP;AAAmBC,IAAAA,KAAK,EAAE,eAAAC,CAAC;AAAA,aAAIA,CAAC,CAACC,QAAN;AAAA;AAA3B;AADM,CAArB;;IAIqBC,c;;;;;;;;;;;;WACnB,2BAA4C;AAAA,UAA/BC,KAA+B,QAA/BA,KAA+B;AAAA,UAAxBC,QAAwB,QAAxBA,QAAwB;AAAA,UAAdC,WAAc,QAAdA,WAAc;;AAC1C,UACEA,WAAW,CAACC,WAAZ,IACCD,WAAW,CAACE,cAAZ,IAA8BF,WAAW,CAACE,cAAZ,CAA2BV,WAF5D,EAGE;AACA,YAAOW,IAAP,GAA4BL,KAA5B,CAAOK,IAAP;AAAA,YAAaX,WAAb,GAA4BM,KAA5B,CAAaN,WAAb;AACA,YAAMY,QAAQ,GAAG,EAAjB;;AAEA,8BAA+B,0BAAeD,IAAf,CAA/B;AAAA,YAAOE,QAAP,mBAAOA,QAAP;AAAA,YAAiBC,UAAjB,mBAAiBA,UAAjB;;AAJA,mDAKqBD,QALrB;AAAA;;AAAA;AAKA,8DAA+B;AAAA,gBAApBE,MAAoB;AAC7BD,YAAAA,UAAU,CAACE,KAAX;AACA,gBAAMZ,QAAQ,GAAGJ,WAAW,CAACe,MAAD,EAASD,UAAT,CAA5B;AACA,gBAAMG,YAAY,GAAG,+BAAoBb,QAApB,EAA8B,IAA9B,CAArB;;AAH6B,wDAKPa,YALO;AAAA;;AAAA;AAK7B,qEAAoC;AAAA,oBAAzBC,OAAyB;AAClCN,gBAAAA,QAAQ,CAACO,IAAT,CAAc,KAAKC,cAAL,CAAoB;AAACF,kBAAAA,OAAO,EAAPA;AAAD,iBAApB,EAA+BH,MAA/B,EAAuCD,UAAU,CAACE,KAAlD,CAAd;AACD;AAP4B;AAAA;AAAA;AAAA;AAAA;AAQ9B;AAbD;AAAA;AAAA;AAAA;AAAA;;AAeA,aAAKK,QAAL,CAAc;AAACT,UAAAA,QAAQ,EAARA;AAAD,SAAd;AACD;AACF;;;WAED,yBAAgB;AACd,aAAO;AACLD,QAAAA,IAAI,EAAE,KAAKW,KAAL,CAAWV,QADZ;AAELW,QAAAA,UAAU,EAAE,oBAAApB,CAAC;AAAA,iBAAIA,CAAC,CAACe,OAAN;AAAA;AAFR,OAAP;AAID;;;EA7ByCM,sB;;;AAgC5CnB,cAAc,CAACN,YAAf,GAA8BA,YAA9B;AACAM,cAAc,CAACoB,SAAf,GAA2B,gBAA3B","sourcesContent":["import {h3SetToMultiPolygon} from 'h3-js';\n\nimport {createIterable} from '@deck.gl/core';\nimport GeoCellLayer from '../geo-cell-layer/GeoCellLayer';\n\nconst defaultProps = {\n getHexagons: {type: 'accessor', value: d => d.hexagons}\n};\n\nexport default class H3ClusterLayer extends GeoCellLayer {\n updateState({props, oldProps, changeFlags}) {\n if (\n changeFlags.dataChanged ||\n (changeFlags.updateTriggers && changeFlags.updateTriggers.getHexagons)\n ) {\n const {data, getHexagons} = props;\n const polygons = [];\n\n const {iterable, objectInfo} = createIterable(data);\n for (const object of iterable) {\n objectInfo.index++;\n const hexagons = getHexagons(object, objectInfo);\n const multiPolygon = h3SetToMultiPolygon(hexagons, true);\n\n for (const polygon of multiPolygon) {\n polygons.push(this.getSubLayerRow({polygon}, object, objectInfo.index));\n }\n }\n\n this.setState({polygons});\n }\n }\n\n indexToBounds() {\n return {\n data: this.state.polygons,\n getPolygon: d => d.polygon\n };\n }\n}\n\nH3ClusterLayer.defaultProps = defaultProps;\nH3ClusterLayer.layerName = 'H3ClusterLayer';\n"],"file":"h3-cluster-layer.js"}
|
package/dist/es5/index.js
CHANGED
|
@@ -17,6 +17,12 @@ Object.defineProperty(exports, "S2Layer", {
|
|
|
17
17
|
return _s2Layer.default;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
+
Object.defineProperty(exports, "QuadkeyLayer", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function get() {
|
|
23
|
+
return _quadkeyLayer.default;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
20
26
|
Object.defineProperty(exports, "TileLayer", {
|
|
21
27
|
enumerable: true,
|
|
22
28
|
get: function get() {
|
|
@@ -70,6 +76,8 @@ var _greatCircleLayer = _interopRequireDefault(require("./great-circle-layer/gre
|
|
|
70
76
|
|
|
71
77
|
var _s2Layer = _interopRequireDefault(require("./s2-layer/s2-layer"));
|
|
72
78
|
|
|
79
|
+
var _quadkeyLayer = _interopRequireDefault(require("./quadkey-layer/quadkey-layer"));
|
|
80
|
+
|
|
73
81
|
var _tileLayer = _interopRequireDefault(require("./tile-layer/tile-layer"));
|
|
74
82
|
|
|
75
83
|
var _tripsLayer = _interopRequireDefault(require("./trips-layer/trips-layer"));
|
package/dist/es5/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA","sourcesContent":["// Copyright (c) 2015 - 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n/* eslint-disable max-len */\n\nexport {default as GreatCircleLayer} from './great-circle-layer/great-circle-layer';\nexport {default as S2Layer} from './s2-layer/s2-layer';\nexport {default as QuadkeyLayer} from './quadkey-layer/quadkey-layer';\nexport {default as TileLayer} from './tile-layer/tile-layer';\nexport {default as TripsLayer} from './trips-layer/trips-layer';\nexport {default as H3ClusterLayer} from './h3-layers/h3-cluster-layer';\nexport {default as H3HexagonLayer} from './h3-layers/h3-hexagon-layer';\nexport {default as Tile3DLayer} from './tile-3d-layer/tile-3d-layer';\nexport {default as TerrainLayer} from './terrain-layer/terrain-layer';\nexport {default as MVTLayer} from './mvt-layer/mvt-layer';\n\nexport {getURLFromTemplate as _getURLFromTemplate} from './tile-layer/utils';\n"],"file":"index.js"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
+
|
|
16
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
+
|
|
18
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
+
|
|
20
|
+
var _GeoCellLayer2 = _interopRequireDefault(require("../geo-cell-layer/GeoCellLayer"));
|
|
21
|
+
|
|
22
|
+
var _quadkeyUtils = require("./quadkey-utils");
|
|
23
|
+
|
|
24
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
25
|
+
|
|
26
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
27
|
+
|
|
28
|
+
var defaultProps = {
|
|
29
|
+
getQuadkey: {
|
|
30
|
+
type: 'accessor',
|
|
31
|
+
value: function value(d) {
|
|
32
|
+
return d.quadkey;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var QuadkeyLayer = function (_GeoCellLayer) {
|
|
38
|
+
(0, _inherits2.default)(QuadkeyLayer, _GeoCellLayer);
|
|
39
|
+
|
|
40
|
+
var _super = _createSuper(QuadkeyLayer);
|
|
41
|
+
|
|
42
|
+
function QuadkeyLayer() {
|
|
43
|
+
(0, _classCallCheck2.default)(this, QuadkeyLayer);
|
|
44
|
+
return _super.apply(this, arguments);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
(0, _createClass2.default)(QuadkeyLayer, [{
|
|
48
|
+
key: "indexToBounds",
|
|
49
|
+
value: function indexToBounds() {
|
|
50
|
+
var _this$props = this.props,
|
|
51
|
+
data = _this$props.data,
|
|
52
|
+
getQuadkey = _this$props.getQuadkey;
|
|
53
|
+
return {
|
|
54
|
+
data: data,
|
|
55
|
+
_normalize: false,
|
|
56
|
+
positionFormat: 'XY',
|
|
57
|
+
getPolygon: function getPolygon(x, objectInfo) {
|
|
58
|
+
return (0, _quadkeyUtils.getQuadkeyPolygon)(getQuadkey(x, objectInfo));
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}]);
|
|
63
|
+
return QuadkeyLayer;
|
|
64
|
+
}(_GeoCellLayer2.default);
|
|
65
|
+
|
|
66
|
+
exports.default = QuadkeyLayer;
|
|
67
|
+
QuadkeyLayer.layerName = 'QuadkeyLayer';
|
|
68
|
+
QuadkeyLayer.defaultProps = defaultProps;
|
|
69
|
+
//# sourceMappingURL=quadkey-layer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/quadkey-layer/quadkey-layer.js"],"names":["defaultProps","getQuadkey","type","value","d","quadkey","QuadkeyLayer","props","data","_normalize","positionFormat","getPolygon","x","objectInfo","GeoCellLayer","layerName"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,IAAMA,YAAY,GAAG;AACnBC,EAAAA,UAAU,EAAE;AAACC,IAAAA,IAAI,EAAE,UAAP;AAAmBC,IAAAA,KAAK,EAAE,eAAAC,CAAC;AAAA,aAAIA,CAAC,CAACC,OAAN;AAAA;AAA3B;AADO,CAArB;;IAIqBC,Y;;;;;;;;;;;;WACnB,yBAAgB;AACd,wBAA2B,KAAKC,KAAhC;AAAA,UAAOC,IAAP,eAAOA,IAAP;AAAA,UAAaP,UAAb,eAAaA,UAAb;AAEA,aAAO;AACLO,QAAAA,IAAI,EAAJA,IADK;AAELC,QAAAA,UAAU,EAAE,KAFP;AAGLC,QAAAA,cAAc,EAAE,IAHX;AAILC,QAAAA,UAAU,EAAE,oBAACC,CAAD,EAAIC,UAAJ;AAAA,iBAAmB,qCAAkBZ,UAAU,CAACW,CAAD,EAAIC,UAAJ,CAA5B,CAAnB;AAAA;AAJP,OAAP;AAMD;;;EAVuCC,sB;;;AAa1CR,YAAY,CAACS,SAAb,GAAyB,cAAzB;AACAT,YAAY,CAACN,YAAb,GAA4BA,YAA5B","sourcesContent":["import GeoCellLayer from '../geo-cell-layer/GeoCellLayer';\nimport {getQuadkeyPolygon} from './quadkey-utils';\n\nconst defaultProps = {\n getQuadkey: {type: 'accessor', value: d => d.quadkey}\n};\n\nexport default class QuadkeyLayer extends GeoCellLayer {\n indexToBounds() {\n const {data, getQuadkey} = this.props;\n\n return {\n data,\n _normalize: false,\n positionFormat: 'XY',\n getPolygon: (x, objectInfo) => getQuadkeyPolygon(getQuadkey(x, objectInfo))\n };\n }\n}\n\nQuadkeyLayer.layerName = 'QuadkeyLayer';\nQuadkeyLayer.defaultProps = defaultProps;\n"],"file":"quadkey-layer.js"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.quadkeyToWorldBounds = quadkeyToWorldBounds;
|
|
9
|
+
exports.getQuadkeyPolygon = getQuadkeyPolygon;
|
|
10
|
+
|
|
11
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
|
+
|
|
13
|
+
var _webMercator = require("@math.gl/web-mercator");
|
|
14
|
+
|
|
15
|
+
var TILE_SIZE = 512;
|
|
16
|
+
|
|
17
|
+
function quadkeyToWorldBounds(quadkey) {
|
|
18
|
+
var x = 0;
|
|
19
|
+
var y = 0;
|
|
20
|
+
var mask = 1 << quadkey.length;
|
|
21
|
+
var scale = mask / TILE_SIZE;
|
|
22
|
+
|
|
23
|
+
for (var i = 0; i < quadkey.length; i++) {
|
|
24
|
+
mask >>= 1;
|
|
25
|
+
var q = parseInt(quadkey[i]);
|
|
26
|
+
if (q % 2) x |= mask;
|
|
27
|
+
if (q > 1) y |= mask;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return [[x / scale, TILE_SIZE - y / scale], [(x + 0.99) / scale, TILE_SIZE - (y + 0.99) / scale]];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function getQuadkeyPolygon(quadkey) {
|
|
34
|
+
var _quadkeyToWorldBounds = quadkeyToWorldBounds(quadkey),
|
|
35
|
+
_quadkeyToWorldBounds2 = (0, _slicedToArray2.default)(_quadkeyToWorldBounds, 2),
|
|
36
|
+
topLeft = _quadkeyToWorldBounds2[0],
|
|
37
|
+
bottomRight = _quadkeyToWorldBounds2[1];
|
|
38
|
+
|
|
39
|
+
var _worldToLngLat = (0, _webMercator.worldToLngLat)(topLeft),
|
|
40
|
+
_worldToLngLat2 = (0, _slicedToArray2.default)(_worldToLngLat, 2),
|
|
41
|
+
w = _worldToLngLat2[0],
|
|
42
|
+
n = _worldToLngLat2[1];
|
|
43
|
+
|
|
44
|
+
var _worldToLngLat3 = (0, _webMercator.worldToLngLat)(bottomRight),
|
|
45
|
+
_worldToLngLat4 = (0, _slicedToArray2.default)(_worldToLngLat3, 2),
|
|
46
|
+
e = _worldToLngLat4[0],
|
|
47
|
+
s = _worldToLngLat4[1];
|
|
48
|
+
|
|
49
|
+
return [e, n, e, s, w, s, w, n, e, n];
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=quadkey-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/quadkey-layer/quadkey-utils.js"],"names":["TILE_SIZE","quadkeyToWorldBounds","quadkey","x","y","mask","length","scale","i","q","parseInt","getQuadkeyPolygon","topLeft","bottomRight","w","n","e","s"],"mappings":";;;;;;;;;;;;AAAA;;AAEA,IAAMA,SAAS,GAAG,GAAlB;;AAEO,SAASC,oBAAT,CAA8BC,OAA9B,EAAuC;AAC5C,MAAIC,CAAC,GAAG,CAAR;AACA,MAAIC,CAAC,GAAG,CAAR;AACA,MAAIC,IAAI,GAAG,KAAKH,OAAO,CAACI,MAAxB;AACA,MAAMC,KAAK,GAAGF,IAAI,GAAGL,SAArB;;AAEA,OAAK,IAAIQ,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGN,OAAO,CAACI,MAA5B,EAAoCE,CAAC,EAArC,EAAyC;AACvCH,IAAAA,IAAI,KAAK,CAAT;AACA,QAAMI,CAAC,GAAGC,QAAQ,CAACR,OAAO,CAACM,CAAD,CAAR,CAAlB;AACA,QAAIC,CAAC,GAAG,CAAR,EAAWN,CAAC,IAAIE,IAAL;AACX,QAAII,CAAC,GAAG,CAAR,EAAWL,CAAC,IAAIC,IAAL;AACZ;;AACD,SAAO,CACL,CAACF,CAAC,GAAGI,KAAL,EAAYP,SAAS,GAAGI,CAAC,GAAGG,KAA5B,CADK,EAEL,CAAC,CAACJ,CAAC,GAAG,IAAL,IAAaI,KAAd,EAAqBP,SAAS,GAAG,CAACI,CAAC,GAAG,IAAL,IAAaG,KAA9C,CAFK,CAAP;AAID;;AAEM,SAASI,iBAAT,CAA2BT,OAA3B,EAAoC;AACzC,8BAA+BD,oBAAoB,CAACC,OAAD,CAAnD;AAAA;AAAA,MAAOU,OAAP;AAAA,MAAgBC,WAAhB;;AACA,uBAAe,gCAAcD,OAAd,CAAf;AAAA;AAAA,MAAOE,CAAP;AAAA,MAAUC,CAAV;;AACA,wBAAe,gCAAcF,WAAd,CAAf;AAAA;AAAA,MAAOG,CAAP;AAAA,MAAUC,CAAV;;AACA,SAAO,CAACD,CAAD,EAAID,CAAJ,EAAOC,CAAP,EAAUC,CAAV,EAAaH,CAAb,EAAgBG,CAAhB,EAAmBH,CAAnB,EAAsBC,CAAtB,EAAyBC,CAAzB,EAA4BD,CAA5B,CAAP;AACD","sourcesContent":["import {worldToLngLat} from '@math.gl/web-mercator';\n\nconst TILE_SIZE = 512;\n\nexport function quadkeyToWorldBounds(quadkey) {\n let x = 0;\n let y = 0;\n let mask = 1 << quadkey.length;\n const scale = mask / TILE_SIZE;\n\n for (let i = 0; i < quadkey.length; i++) {\n mask >>= 1;\n const q = parseInt(quadkey[i]);\n if (q % 2) x |= mask;\n if (q > 1) y |= mask;\n }\n return [\n [x / scale, TILE_SIZE - y / scale],\n [(x + 0.99) / scale, TILE_SIZE - (y + 0.99) / scale]\n ];\n}\n\nexport function getQuadkeyPolygon(quadkey) {\n const [topLeft, bottomRight] = quadkeyToWorldBounds(quadkey);\n const [w, n] = worldToLngLat(topLeft);\n const [e, s] = worldToLngLat(bottomRight);\n return [e, n, e, s, w, s, w, n, e, n];\n}\n"],"file":"quadkey-utils.js"}
|
|
@@ -17,11 +17,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
17
17
|
|
|
18
18
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
19
|
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
var _core = require("@deck.gl/core");
|
|
23
|
-
|
|
24
|
-
var _layers = require("@deck.gl/layers");
|
|
20
|
+
var _GeoCellLayer2 = _interopRequireDefault(require("../geo-cell-layer/GeoCellLayer"));
|
|
25
21
|
|
|
26
22
|
var _s2Utils = require("./s2-utils");
|
|
27
23
|
|
|
@@ -29,21 +25,17 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
29
25
|
|
|
30
26
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
31
27
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
35
|
-
|
|
36
|
-
var defaultProps = _objectSpread(_objectSpread({}, _layers.PolygonLayer.defaultProps), {}, {
|
|
28
|
+
var defaultProps = {
|
|
37
29
|
getS2Token: {
|
|
38
30
|
type: 'accessor',
|
|
39
31
|
value: function value(d) {
|
|
40
32
|
return d.token;
|
|
41
33
|
}
|
|
42
34
|
}
|
|
43
|
-
}
|
|
35
|
+
};
|
|
44
36
|
|
|
45
|
-
var S2Layer = function (
|
|
46
|
-
(0, _inherits2.default)(S2Layer,
|
|
37
|
+
var S2Layer = function (_GeoCellLayer) {
|
|
38
|
+
(0, _inherits2.default)(S2Layer, _GeoCellLayer);
|
|
47
39
|
|
|
48
40
|
var _super = _createSuper(S2Layer);
|
|
49
41
|
|
|
@@ -53,73 +45,23 @@ var S2Layer = function (_CompositeLayer) {
|
|
|
53
45
|
}
|
|
54
46
|
|
|
55
47
|
(0, _createClass2.default)(S2Layer, [{
|
|
56
|
-
key: "
|
|
57
|
-
value: function
|
|
48
|
+
key: "indexToBounds",
|
|
49
|
+
value: function indexToBounds() {
|
|
58
50
|
var _this$props = this.props,
|
|
59
51
|
data = _this$props.data,
|
|
60
52
|
getS2Token = _this$props.getS2Token;
|
|
61
|
-
|
|
62
|
-
elevationScale = _this$props2.elevationScale,
|
|
63
|
-
extruded = _this$props2.extruded,
|
|
64
|
-
wireframe = _this$props2.wireframe,
|
|
65
|
-
filled = _this$props2.filled,
|
|
66
|
-
stroked = _this$props2.stroked,
|
|
67
|
-
lineWidthUnits = _this$props2.lineWidthUnits,
|
|
68
|
-
lineWidthScale = _this$props2.lineWidthScale,
|
|
69
|
-
lineWidthMinPixels = _this$props2.lineWidthMinPixels,
|
|
70
|
-
lineWidthMaxPixels = _this$props2.lineWidthMaxPixels,
|
|
71
|
-
lineJointRounded = _this$props2.lineJointRounded,
|
|
72
|
-
lineMiterLimit = _this$props2.lineMiterLimit,
|
|
73
|
-
lineDashJustified = _this$props2.lineDashJustified,
|
|
74
|
-
getElevation = _this$props2.getElevation,
|
|
75
|
-
getFillColor = _this$props2.getFillColor,
|
|
76
|
-
getLineColor = _this$props2.getLineColor,
|
|
77
|
-
getLineWidth = _this$props2.getLineWidth,
|
|
78
|
-
getLineDashArray = _this$props2.getLineDashArray;
|
|
79
|
-
var _this$props3 = this.props,
|
|
80
|
-
updateTriggers = _this$props3.updateTriggers,
|
|
81
|
-
material = _this$props3.material;
|
|
82
|
-
var CellLayer = this.getSubLayerClass('cell', _layers.PolygonLayer);
|
|
83
|
-
return new CellLayer({
|
|
84
|
-
filled: filled,
|
|
85
|
-
wireframe: wireframe,
|
|
86
|
-
extruded: extruded,
|
|
87
|
-
elevationScale: elevationScale,
|
|
88
|
-
stroked: stroked,
|
|
89
|
-
lineWidthUnits: lineWidthUnits,
|
|
90
|
-
lineWidthScale: lineWidthScale,
|
|
91
|
-
lineWidthMinPixels: lineWidthMinPixels,
|
|
92
|
-
lineWidthMaxPixels: lineWidthMaxPixels,
|
|
93
|
-
lineJointRounded: lineJointRounded,
|
|
94
|
-
lineMiterLimit: lineMiterLimit,
|
|
95
|
-
lineDashJustified: lineDashJustified,
|
|
96
|
-
material: material,
|
|
97
|
-
getElevation: getElevation,
|
|
98
|
-
getFillColor: getFillColor,
|
|
99
|
-
getLineColor: getLineColor,
|
|
100
|
-
getLineWidth: getLineWidth,
|
|
101
|
-
getLineDashArray: getLineDashArray
|
|
102
|
-
}, this.getSubLayerProps({
|
|
103
|
-
id: 'cell',
|
|
104
|
-
updateTriggers: {
|
|
105
|
-
getElevation: updateTriggers.getElevation,
|
|
106
|
-
getFillColor: updateTriggers.getFillColor,
|
|
107
|
-
getLineColor: updateTriggers.getLineColor,
|
|
108
|
-
getLineWidth: updateTriggers.getLineWidth,
|
|
109
|
-
getLineDashArray: updateTriggers.getLineDashArray
|
|
110
|
-
}
|
|
111
|
-
}), {
|
|
53
|
+
return {
|
|
112
54
|
data: data,
|
|
113
55
|
_normalize: false,
|
|
114
56
|
positionFormat: 'XY',
|
|
115
57
|
getPolygon: function getPolygon(x, objectInfo) {
|
|
116
58
|
return (0, _s2Utils.getS2Polygon)(getS2Token(x, objectInfo));
|
|
117
59
|
}
|
|
118
|
-
}
|
|
60
|
+
};
|
|
119
61
|
}
|
|
120
62
|
}]);
|
|
121
63
|
return S2Layer;
|
|
122
|
-
}(
|
|
64
|
+
}(_GeoCellLayer2.default);
|
|
123
65
|
|
|
124
66
|
exports.default = S2Layer;
|
|
125
67
|
S2Layer.layerName = 'S2Layer';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/s2-layer/s2-layer.js"],"names":["defaultProps","
|
|
1
|
+
{"version":3,"sources":["../../../src/s2-layer/s2-layer.js"],"names":["defaultProps","getS2Token","type","value","d","token","S2Layer","props","data","_normalize","positionFormat","getPolygon","x","objectInfo","GeoCellLayer","layerName"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA;;AACA;;;;;;AAEA,IAAMA,YAAY,GAAG;AACnBC,EAAAA,UAAU,EAAE;AAACC,IAAAA,IAAI,EAAE,UAAP;AAAmBC,IAAAA,KAAK,EAAE,eAAAC,CAAC;AAAA,aAAIA,CAAC,CAACC,KAAN;AAAA;AAA3B;AADO,CAArB;;IAIqBC,O;;;;;;;;;;;;WACnB,yBAAgB;AACd,wBAA2B,KAAKC,KAAhC;AAAA,UAAOC,IAAP,eAAOA,IAAP;AAAA,UAAaP,UAAb,eAAaA,UAAb;AAEA,aAAO;AACLO,QAAAA,IAAI,EAAJA,IADK;AAELC,QAAAA,UAAU,EAAE,KAFP;AAGLC,QAAAA,cAAc,EAAE,IAHX;AAILC,QAAAA,UAAU,EAAE,oBAACC,CAAD,EAAIC,UAAJ;AAAA,iBAAmB,2BAAaZ,UAAU,CAACW,CAAD,EAAIC,UAAJ,CAAvB,CAAnB;AAAA;AAJP,OAAP;AAMD;;;EAVkCC,sB;;;AAarCR,OAAO,CAACS,SAAR,GAAoB,SAApB;AACAT,OAAO,CAACN,YAAR,GAAuBA,YAAvB","sourcesContent":["// Copyright (c) 2015 - 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport GeoCellLayer from '../geo-cell-layer/GeoCellLayer';\nimport {getS2Polygon} from './s2-utils';\n\nconst defaultProps = {\n getS2Token: {type: 'accessor', value: d => d.token}\n};\n\nexport default class S2Layer extends GeoCellLayer {\n indexToBounds() {\n const {data, getS2Token} = this.props;\n\n return {\n data,\n _normalize: false,\n positionFormat: 'XY',\n getPolygon: (x, objectInfo) => getS2Polygon(getS2Token(x, objectInfo))\n };\n }\n}\n\nS2Layer.layerName = 'S2Layer';\nS2Layer.defaultProps = defaultProps;\n"],"file":"s2-layer.js"}
|
|
@@ -55,7 +55,7 @@ var urlType = {
|
|
|
55
55
|
exports.urlType = urlType;
|
|
56
56
|
|
|
57
57
|
function transformBox(bbox, modelMatrix) {
|
|
58
|
-
var transformedCoords = [modelMatrix.
|
|
58
|
+
var transformedCoords = [modelMatrix.transformAsPoint([bbox[0], bbox[1]]), modelMatrix.transformAsPoint([bbox[2], bbox[1]]), modelMatrix.transformAsPoint([bbox[0], bbox[3]]), modelMatrix.transformAsPoint([bbox[2], bbox[3]])];
|
|
59
59
|
var transformedBox = [Math.min.apply(Math, (0, _toConsumableArray2.default)(transformedCoords.map(function (i) {
|
|
60
60
|
return i[0];
|
|
61
61
|
}))), Math.min.apply(Math, (0, _toConsumableArray2.default)(transformedCoords.map(function (i) {
|