@antv/l7-layers 2.8.45 → 2.9.0
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.d.ts +3 -1
- package/es/core/BaseLayer.js +23 -3
- package/es/core/BaseLayer.js.map +1 -1
- package/es/core/BaseModel.d.ts +2 -1
- package/es/core/BaseModel.js +3 -0
- package/es/core/BaseModel.js.map +1 -1
- package/es/core/interface.d.ts +12 -0
- package/es/core/interface.js.map +1 -1
- package/es/image/models/image.js.map +1 -1
- package/es/line/index.d.ts +1 -1
- package/es/line/index.js +7 -1
- package/es/line/index.js.map +1 -1
- package/es/line/models/index.d.ts +1 -1
- package/es/line/models/index.js +5 -1
- package/es/line/models/index.js.map +1 -1
- package/es/line/models/tile.d.ts +20 -0
- package/es/line/models/tile.js +327 -0
- package/es/line/models/tile.js.map +1 -0
- package/es/plugins/ShaderUniformPlugin.js +3 -1
- package/es/plugins/ShaderUniformPlugin.js.map +1 -1
- package/es/point/index.d.ts +1 -1
- package/es/point/index.js +8 -2
- package/es/point/index.js.map +1 -1
- package/es/point/models/index.d.ts +1 -1
- package/es/point/models/index.js +5 -1
- package/es/point/models/index.js.map +1 -1
- package/es/point/models/tile.d.ts +31 -0
- package/es/point/models/tile.js +291 -0
- package/es/point/models/tile.js.map +1 -0
- package/es/polygon/index.js +6 -0
- package/es/polygon/index.js.map +1 -1
- package/es/polygon/models/index.d.ts +1 -1
- package/es/polygon/models/index.js +5 -1
- package/es/polygon/models/index.js.map +1 -1
- package/es/polygon/models/tile.d.ts +16 -0
- package/es/polygon/models/tile.js +137 -0
- package/es/polygon/models/tile.js.map +1 -0
- package/es/raster/index.d.ts +2 -2
- package/es/raster/index.js +4 -4
- package/es/raster/index.js.map +1 -1
- package/es/raster/models/index.js +1 -1
- package/es/raster/models/index.js.map +1 -1
- package/es/raster/models/raster.d.ts +1 -0
- package/es/raster/models/raster.js +8 -2
- package/es/raster/models/raster.js.map +1 -1
- package/es/tile/interface.d.ts +28 -0
- package/es/tile/interface.js +2 -0
- package/es/tile/interface.js.map +1 -0
- package/es/tile/manager/tileConfigManager.d.ts +17 -0
- package/es/tile/manager/tileConfigManager.js +123 -0
- package/es/tile/manager/tileConfigManager.js.map +1 -0
- package/es/tile/manager/tileLayerManager.d.ts +34 -0
- package/es/tile/manager/tileLayerManager.js +283 -0
- package/es/tile/manager/tileLayerManager.js.map +1 -0
- package/es/tile/manager/tilePickerManager.d.ts +20 -0
- package/es/tile/manager/tilePickerManager.js +164 -0
- package/es/tile/manager/tilePickerManager.js.map +1 -0
- package/es/tile/models/tileModel.d.ts +8 -0
- package/es/tile/models/tileModel.js +61 -0
- package/es/tile/models/tileModel.js.map +1 -0
- package/es/tile/tileFactory/base.d.ts +40 -0
- package/es/tile/tileFactory/base.js +352 -0
- package/es/tile/tileFactory/base.js.map +1 -0
- package/es/tile/tileFactory/index.d.ts +5 -0
- package/es/tile/tileFactory/index.js +30 -0
- package/es/tile/tileFactory/index.js.map +1 -0
- package/es/tile/tileFactory/line.d.ts +12 -0
- package/es/tile/tileFactory/line.js +65 -0
- package/es/tile/tileFactory/line.js.map +1 -0
- package/es/tile/tileFactory/point.d.ts +12 -0
- package/es/tile/tileFactory/point.js +65 -0
- package/es/tile/tileFactory/point.js.map +1 -0
- package/es/tile/tileFactory/polygon.d.ts +12 -0
- package/es/tile/tileFactory/polygon.js +65 -0
- package/es/tile/tileFactory/polygon.js.map +1 -0
- package/es/tile/tileFactory/raster.d.ts +12 -0
- package/es/tile/tileFactory/raster.js +61 -0
- package/es/tile/tileFactory/raster.js.map +1 -0
- package/es/tile/tileFactory/rasterData.d.ts +12 -0
- package/es/tile/tileFactory/rasterData.js +75 -0
- package/es/tile/tileFactory/rasterData.js.map +1 -0
- package/es/tile/tileFactory/rasterDataLayer.d.ts +19 -0
- package/es/{core/LayerGroup.js → tile/tileFactory/rasterDataLayer.js} +39 -32
- package/es/tile/tileFactory/rasterDataLayer.js.map +1 -0
- package/es/tile/tileFactory/vectorLayer.d.ts +27 -0
- package/es/tile/tileFactory/vectorLayer.js +131 -0
- package/es/tile/tileFactory/vectorLayer.js.map +1 -0
- package/es/tile/tileLayer/baseTileLayer.d.ts +51 -0
- package/es/tile/tileLayer/baseTileLayer.js +409 -0
- package/es/tile/tileLayer/baseTileLayer.js.map +1 -0
- package/es/tile/tmsTileLayer.d.ts +7 -0
- package/es/tile/tmsTileLayer.js +94 -0
- package/es/tile/tmsTileLayer.js.map +1 -0
- package/es/tile/utils.d.ts +11 -0
- package/es/tile/utils.js +120 -0
- package/es/tile/utils.js.map +1 -0
- package/lib/core/BaseLayer.js +21 -2
- package/lib/core/BaseLayer.js.map +1 -1
- package/lib/core/BaseModel.js +2 -0
- package/lib/core/BaseModel.js.map +1 -1
- package/lib/core/interface.js.map +1 -1
- package/lib/image/models/image.js.map +1 -1
- package/lib/line/index.js +7 -1
- package/lib/line/index.js.map +1 -1
- package/lib/line/models/index.js +7 -1
- package/lib/line/models/index.js.map +1 -1
- package/lib/line/models/tile.js +342 -0
- package/lib/line/models/tile.js.map +1 -0
- package/lib/plugins/ShaderUniformPlugin.js +3 -1
- package/lib/plugins/ShaderUniformPlugin.js.map +1 -1
- package/lib/point/index.js +8 -2
- package/lib/point/index.js.map +1 -1
- package/lib/point/models/index.js +7 -1
- package/lib/point/models/index.js.map +1 -1
- package/lib/point/models/tile.js +308 -0
- package/lib/point/models/tile.js.map +1 -0
- package/lib/polygon/index.js +6 -0
- package/lib/polygon/index.js.map +1 -1
- package/lib/polygon/models/index.js +7 -1
- package/lib/polygon/models/index.js.map +1 -1
- package/lib/polygon/models/tile.js +152 -0
- package/lib/polygon/models/tile.js.map +1 -0
- package/lib/raster/index.js +4 -4
- package/lib/raster/index.js.map +1 -1
- package/lib/raster/models/index.js +2 -2
- package/lib/raster/models/index.js.map +1 -1
- package/lib/raster/models/raster.js +8 -2
- package/lib/raster/models/raster.js.map +1 -1
- package/lib/tile/interface.js +2 -0
- package/lib/tile/interface.js.map +1 -0
- package/lib/tile/manager/tileConfigManager.js +134 -0
- package/lib/tile/manager/tileConfigManager.js.map +1 -0
- package/lib/tile/manager/tileLayerManager.js +291 -0
- package/lib/tile/manager/tileLayerManager.js.map +1 -0
- package/lib/tile/manager/tilePickerManager.js +170 -0
- package/lib/tile/manager/tilePickerManager.js.map +1 -0
- package/lib/tile/models/tileModel.js +73 -0
- package/lib/tile/models/tileModel.js.map +1 -0
- package/lib/tile/tileFactory/base.js +366 -0
- package/lib/tile/tileFactory/base.js.map +1 -0
- package/lib/tile/tileFactory/index.js +60 -0
- package/lib/tile/tileFactory/index.js.map +1 -0
- package/lib/tile/tileFactory/line.js +76 -0
- package/lib/tile/tileFactory/line.js.map +1 -0
- package/lib/tile/tileFactory/point.js +76 -0
- package/lib/tile/tileFactory/point.js.map +1 -0
- package/lib/tile/tileFactory/polygon.js +76 -0
- package/lib/tile/tileFactory/polygon.js.map +1 -0
- package/lib/tile/tileFactory/raster.js +74 -0
- package/lib/tile/tileFactory/raster.js.map +1 -0
- package/lib/tile/tileFactory/rasterData.js +88 -0
- package/lib/tile/tileFactory/rasterData.js.map +1 -0
- package/lib/{core/LayerGroup.js → tile/tileFactory/rasterDataLayer.js} +40 -32
- package/lib/tile/tileFactory/rasterDataLayer.js.map +1 -0
- package/lib/tile/tileFactory/vectorLayer.js +145 -0
- package/lib/tile/tileFactory/vectorLayer.js.map +1 -0
- package/lib/tile/tileLayer/baseTileLayer.js +408 -0
- package/lib/tile/tileLayer/baseTileLayer.js.map +1 -0
- package/lib/tile/tmsTileLayer.js +109 -0
- package/lib/tile/tmsTileLayer.js.map +1 -0
- package/lib/tile/utils.js +142 -0
- package/lib/tile/utils.js.map +1 -0
- package/package.json +7 -5
- package/es/core/LayerGroup.d.ts +0 -9
- package/es/core/LayerGroup.js.map +0 -1
- package/es/raster/models/raste-tile.d.ts +0 -23
- package/es/raster/models/raste-tile.js +0 -285
- package/es/raster/models/raste-tile.js.map +0 -1
- package/lib/core/LayerGroup.js.map +0 -1
- package/lib/raster/models/raste-tile.js +0 -294
- package/lib/raster/models/raste-tile.js.map +0 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
+
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
|
|
11
|
+
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; } }
|
|
12
|
+
|
|
13
|
+
import TileFactory from './base';
|
|
14
|
+
|
|
15
|
+
var VectorPolygonTile = function (_TileFactory) {
|
|
16
|
+
_inherits(VectorPolygonTile, _TileFactory);
|
|
17
|
+
|
|
18
|
+
var _super = _createSuper(VectorPolygonTile);
|
|
19
|
+
|
|
20
|
+
function VectorPolygonTile(option) {
|
|
21
|
+
var _this;
|
|
22
|
+
|
|
23
|
+
_classCallCheck(this, VectorPolygonTile);
|
|
24
|
+
|
|
25
|
+
_this = _super.call(this, option);
|
|
26
|
+
|
|
27
|
+
_defineProperty(_assertThisInitialized(_this), "parentLayer", void 0);
|
|
28
|
+
|
|
29
|
+
_this.parentLayer = option.parent;
|
|
30
|
+
return _this;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_createClass(VectorPolygonTile, [{
|
|
34
|
+
key: "createTile",
|
|
35
|
+
value: function createTile(tile, initOptions) {
|
|
36
|
+
var _this$getFeatureData = this.getFeatureData(tile, initOptions),
|
|
37
|
+
features = _this$getFeatureData.features,
|
|
38
|
+
vectorTileLayer = _this$getFeatureData.vectorTileLayer,
|
|
39
|
+
source = _this$getFeatureData.source;
|
|
40
|
+
|
|
41
|
+
if (features.length === 0) {
|
|
42
|
+
return {
|
|
43
|
+
layers: [],
|
|
44
|
+
layerIDList: []
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
var layer = this.createLayer({
|
|
49
|
+
tile: tile,
|
|
50
|
+
initOptions: initOptions,
|
|
51
|
+
vectorTileLayer: vectorTileLayer,
|
|
52
|
+
source: source
|
|
53
|
+
});
|
|
54
|
+
return {
|
|
55
|
+
layers: [layer],
|
|
56
|
+
layerIDList: [layer.id]
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}]);
|
|
60
|
+
|
|
61
|
+
return VectorPolygonTile;
|
|
62
|
+
}(TileFactory);
|
|
63
|
+
|
|
64
|
+
export { VectorPolygonTile as default };
|
|
65
|
+
//# sourceMappingURL=polygon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tile/tileFactory/polygon.ts"],"names":["TileFactory","VectorPolygonTile","option","parentLayer","parent","tile","initOptions","getFeatureData","features","vectorTileLayer","source","length","layers","layerIDList","layer","createLayer","id"],"mappings":";;;;;;;;;;;;AAIA,OAAOA,WAAP,MAAwB,QAAxB;;IACqBC,iB;;;;;AAGnB,6BAAYC,MAAZ,EAAyC;AAAA;;AAAA;;AACvC,8BAAMA,MAAN;;AADuC;;AAEvC,UAAKC,WAAL,GAAmBD,MAAM,CAACE,MAA1B;AAFuC;AAGxC;;;;WAED,oBAAkBC,IAAlB,EAA8BC,WAA9B,EAAiE;AAC/D,iCAA8C,KAAKC,cAAL,CAC5CF,IAD4C,EAE5CC,WAF4C,CAA9C;AAAA,UAAQE,QAAR,wBAAQA,QAAR;AAAA,UAAkBC,eAAlB,wBAAkBA,eAAlB;AAAA,UAAmCC,MAAnC,wBAAmCA,MAAnC;;AAIA,UAAIF,QAAQ,CAACG,MAAT,KAAoB,CAAxB,EAA2B;AACzB,eAAO;AACLC,UAAAA,MAAM,EAAE,EADH;AAELC,UAAAA,WAAW,EAAE;AAFR,SAAP;AAID;;AAED,UAAMC,KAAK,GAAG,KAAKC,WAAL,CAAiB;AAC7BV,QAAAA,IAAI,EAAJA,IAD6B;AAE7BC,QAAAA,WAAW,EAAXA,WAF6B;AAG7BG,QAAAA,eAAe,EAAfA,eAH6B;AAI7BC,QAAAA,MAAM,EAAEA;AAJqB,OAAjB,CAAd;AAOA,aAAO;AACLE,QAAAA,MAAM,EAAE,CAACE,KAAD,CADH;AAELD,QAAAA,WAAW,EAAE,CAACC,KAAK,CAACE,EAAP;AAFR,OAAP;AAID;;;;EA/B4ChB,W;;SAA1BC,iB","sourcesContent":["import { ILayer, ISubLayerInitOptions } from '@antv/l7-core';\nimport Source from '@antv/l7-source';\nimport { Tile } from '@antv/l7-utils';\nimport { ITileFactoryOptions, ITileStyles } from '../interface';\nimport TileFactory from './base';\nexport default class VectorPolygonTile extends TileFactory {\n public parentLayer: ILayer;\n\n constructor(option: ITileFactoryOptions) {\n super(option);\n this.parentLayer = option.parent;\n }\n\n public createTile(tile: Tile, initOptions: ISubLayerInitOptions) {\n const { features, vectorTileLayer, source } = this.getFeatureData(\n tile,\n initOptions,\n );\n if (features.length === 0) {\n return {\n layers: [],\n layerIDList: [],\n };\n }\n\n const layer = this.createLayer({\n tile,\n initOptions,\n vectorTileLayer,\n source: source as Source,\n });\n\n return {\n layers: [layer],\n layerIDList: [layer.id],\n };\n }\n}\n"],"file":"polygon.js"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ILayer, ISubLayerInitOptions } from '@antv/l7-core';
|
|
2
|
+
import { Tile } from '@antv/l7-utils';
|
|
3
|
+
import { ITileFactoryOptions } from '../interface';
|
|
4
|
+
import TileFactory from './base';
|
|
5
|
+
export default class RasterTile extends TileFactory {
|
|
6
|
+
parentLayer: ILayer;
|
|
7
|
+
constructor(option: ITileFactoryOptions);
|
|
8
|
+
createTile(tile: Tile, initOptions: ISubLayerInitOptions): {
|
|
9
|
+
layers: any[];
|
|
10
|
+
layerIDList: any[];
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
+
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
|
|
11
|
+
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; } }
|
|
12
|
+
|
|
13
|
+
import Source from '@antv/l7-source';
|
|
14
|
+
import ImageLayer from '../../image';
|
|
15
|
+
import TileFactory from './base';
|
|
16
|
+
|
|
17
|
+
var RasterTile = function (_TileFactory) {
|
|
18
|
+
_inherits(RasterTile, _TileFactory);
|
|
19
|
+
|
|
20
|
+
var _super = _createSuper(RasterTile);
|
|
21
|
+
|
|
22
|
+
function RasterTile(option) {
|
|
23
|
+
var _this;
|
|
24
|
+
|
|
25
|
+
_classCallCheck(this, RasterTile);
|
|
26
|
+
|
|
27
|
+
_this = _super.call(this, option);
|
|
28
|
+
|
|
29
|
+
_defineProperty(_assertThisInitialized(_this), "parentLayer", void 0);
|
|
30
|
+
|
|
31
|
+
_this.parentLayer = option.parent;
|
|
32
|
+
return _this;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
_createClass(RasterTile, [{
|
|
36
|
+
key: "createTile",
|
|
37
|
+
value: function createTile(tile, initOptions) {
|
|
38
|
+
var source = new Source(tile.data, {
|
|
39
|
+
parser: {
|
|
40
|
+
type: 'image',
|
|
41
|
+
extent: tile.bounds
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
var layer = this.createLayer({
|
|
45
|
+
L7Layer: ImageLayer,
|
|
46
|
+
tile: tile,
|
|
47
|
+
initOptions: initOptions,
|
|
48
|
+
source: source
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
layers: [layer],
|
|
52
|
+
layerIDList: [layer.id]
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}]);
|
|
56
|
+
|
|
57
|
+
return RasterTile;
|
|
58
|
+
}(TileFactory);
|
|
59
|
+
|
|
60
|
+
export { RasterTile as default };
|
|
61
|
+
//# sourceMappingURL=raster.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tile/tileFactory/raster.ts"],"names":["Source","ImageLayer","TileFactory","RasterTile","option","parentLayer","parent","tile","initOptions","source","data","parser","type","extent","bounds","layer","createLayer","L7Layer","layers","layerIDList","id"],"mappings":";;;;;;;;;;;;AACA,OAAOA,MAAP,MAAmB,iBAAnB;AAEA,OAAOC,UAAP,MAAuB,aAAvB;AAEA,OAAOC,WAAP,MAAwB,QAAxB;;IAEqBC,U;;;;;AAEnB,sBAAYC,MAAZ,EAAyC;AAAA;;AAAA;;AACvC,8BAAMA,MAAN;;AADuC;;AAEvC,UAAKC,WAAL,GAAmBD,MAAM,CAACE,MAA1B;AAFuC;AAGxC;;;;WAED,oBAAkBC,IAAlB,EAA8BC,WAA9B,EAAiE;AAC/D,UAAMC,MAAM,GAAG,IAAIT,MAAJ,CAAWO,IAAI,CAACG,IAAhB,EAAsB;AACnCC,QAAAA,MAAM,EAAE;AACNC,UAAAA,IAAI,EAAE,OADA;AAENC,UAAAA,MAAM,EAAEN,IAAI,CAACO;AAFP;AAD2B,OAAtB,CAAf;AAOA,UAAMC,KAAK,GAAG,KAAKC,WAAL,CAAiB;AAC7BC,QAAAA,OAAO,EAAEhB,UADoB;AAE7BM,QAAAA,IAAI,EAAJA,IAF6B;AAG7BC,QAAAA,WAAW,EAAXA,WAH6B;AAI7BC,QAAAA,MAAM,EAANA;AAJ6B,OAAjB,CAAd;AAOA,aAAO;AACLS,QAAAA,MAAM,EAAE,CAACH,KAAD,CADH;AAELI,QAAAA,WAAW,EAAE,CAACJ,KAAK,CAACK,EAAP;AAFR,OAAP;AAID;;;;EA1BqClB,W;;SAAnBC,U","sourcesContent":["import { ILayer, ISubLayerInitOptions } from '@antv/l7-core';\nimport Source from '@antv/l7-source';\nimport { Tile, TilesetManager } from '@antv/l7-utils';\nimport ImageLayer from '../../image';\nimport { ITileFactoryOptions } from '../interface';\nimport TileFactory from './base';\n\nexport default class RasterTile extends TileFactory {\n public parentLayer: ILayer;\n constructor(option: ITileFactoryOptions) {\n super(option);\n this.parentLayer = option.parent;\n }\n\n public createTile(tile: Tile, initOptions: ISubLayerInitOptions) {\n const source = new Source(tile.data, {\n parser: {\n type: 'image',\n extent: tile.bounds,\n },\n });\n\n const layer = this.createLayer({\n L7Layer: ImageLayer,\n tile,\n initOptions,\n source,\n });\n\n return {\n layers: [layer],\n layerIDList: [layer.id],\n };\n }\n}\n"],"file":"raster.js"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ILayer, ISubLayerInitOptions } from '@antv/l7-core';
|
|
2
|
+
import { Tile } from '@antv/l7-utils';
|
|
3
|
+
import { ITileFactoryOptions } from '../interface';
|
|
4
|
+
import TileFactory from './base';
|
|
5
|
+
export default class RasterTiffTile extends TileFactory {
|
|
6
|
+
parentLayer: ILayer;
|
|
7
|
+
constructor(option: ITileFactoryOptions);
|
|
8
|
+
createTile(tile: Tile, initOptions: ISubLayerInitOptions): {
|
|
9
|
+
layers: ILayer[];
|
|
10
|
+
layerIDList: string[];
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
+
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
|
|
11
|
+
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; } }
|
|
12
|
+
|
|
13
|
+
import { registerLayers } from '../utils';
|
|
14
|
+
import TileFactory from './base';
|
|
15
|
+
import RasterDataLayer from './rasterDataLayer';
|
|
16
|
+
|
|
17
|
+
var RasterTiffTile = function (_TileFactory) {
|
|
18
|
+
_inherits(RasterTiffTile, _TileFactory);
|
|
19
|
+
|
|
20
|
+
var _super = _createSuper(RasterTiffTile);
|
|
21
|
+
|
|
22
|
+
function RasterTiffTile(option) {
|
|
23
|
+
var _this;
|
|
24
|
+
|
|
25
|
+
_classCallCheck(this, RasterTiffTile);
|
|
26
|
+
|
|
27
|
+
_this = _super.call(this, option);
|
|
28
|
+
|
|
29
|
+
_defineProperty(_assertThisInitialized(_this), "parentLayer", void 0);
|
|
30
|
+
|
|
31
|
+
_this.parentLayer = option.parent;
|
|
32
|
+
return _this;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
_createClass(RasterTiffTile, [{
|
|
36
|
+
key: "createTile",
|
|
37
|
+
value: function createTile(tile, initOptions) {
|
|
38
|
+
var opacity = initOptions.opacity,
|
|
39
|
+
domain = initOptions.domain,
|
|
40
|
+
clampHigh = initOptions.clampHigh,
|
|
41
|
+
clampLow = initOptions.clampLow,
|
|
42
|
+
rampColors = initOptions.rampColors,
|
|
43
|
+
mask = initOptions.mask;
|
|
44
|
+
var tiffdata = tile.data;
|
|
45
|
+
var layer = new RasterDataLayer({
|
|
46
|
+
visible: tile.isVisible,
|
|
47
|
+
mask: mask
|
|
48
|
+
}).source(tiffdata.data, {
|
|
49
|
+
parser: {
|
|
50
|
+
type: 'raster',
|
|
51
|
+
width: tiffdata.width,
|
|
52
|
+
height: tiffdata.height,
|
|
53
|
+
extent: tile.bboxPolygon.bbox
|
|
54
|
+
}
|
|
55
|
+
}).style({
|
|
56
|
+
opacity: opacity,
|
|
57
|
+
domain: domain,
|
|
58
|
+
clampHigh: clampHigh,
|
|
59
|
+
clampLow: clampLow,
|
|
60
|
+
rampColors: rampColors
|
|
61
|
+
});
|
|
62
|
+
this.emitEvent([layer], false, tile);
|
|
63
|
+
registerLayers(this.parentLayer, [layer]);
|
|
64
|
+
return {
|
|
65
|
+
layers: [layer],
|
|
66
|
+
layerIDList: [layer.id]
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}]);
|
|
70
|
+
|
|
71
|
+
return RasterTiffTile;
|
|
72
|
+
}(TileFactory);
|
|
73
|
+
|
|
74
|
+
export { RasterTiffTile as default };
|
|
75
|
+
//# sourceMappingURL=rasterData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tile/tileFactory/rasterData.ts"],"names":["registerLayers","TileFactory","RasterDataLayer","RasterTiffTile","option","parentLayer","parent","tile","initOptions","opacity","domain","clampHigh","clampLow","rampColors","mask","tiffdata","data","layer","visible","isVisible","source","parser","type","width","height","extent","bboxPolygon","bbox","style","emitEvent","layers","layerIDList","id"],"mappings":";;;;;;;;;;;;AAGA,SAASA,cAAT,QAA+B,UAA/B;AACA,OAAOC,WAAP,MAAwB,QAAxB;AACA,OAAOC,eAAP,MAA4B,mBAA5B;;IAEqBC,c;;;;;AAGnB,0BAAYC,MAAZ,EAAyC;AAAA;;AAAA;;AACvC,8BAAMA,MAAN;;AADuC;;AAEvC,UAAKC,WAAL,GAAmBD,MAAM,CAACE,MAA1B;AAFuC;AAGxC;;;;WAED,oBAAkBC,IAAlB,EAA8BC,WAA9B,EAAiE;AAC/D,UACEC,OADF,GAOID,WAPJ,CACEC,OADF;AAAA,UAEEC,MAFF,GAOIF,WAPJ,CAEEE,MAFF;AAAA,UAGEC,SAHF,GAOIH,WAPJ,CAGEG,SAHF;AAAA,UAIEC,QAJF,GAOIJ,WAPJ,CAIEI,QAJF;AAAA,UAKEC,UALF,GAOIL,WAPJ,CAKEK,UALF;AAAA,UAMEC,IANF,GAOIN,WAPJ,CAMEM,IANF;AAQA,UAAMC,QAAQ,GAAGR,IAAI,CAACS,IAAtB;AACA,UAAMC,KAAK,GAAG,IAAIf,eAAJ,CAAoB;AAChCgB,QAAAA,OAAO,EAAEX,IAAI,CAACY,SADkB;AAEhCL,QAAAA,IAAI,EAAJA;AAFgC,OAApB,EAIXM,MAJW,CAIJL,QAAQ,CAACC,IAJL,EAIW;AACrBK,QAAAA,MAAM,EAAE;AACNC,UAAAA,IAAI,EAAE,QADA;AAENC,UAAAA,KAAK,EAAER,QAAQ,CAACQ,KAFV;AAGNC,UAAAA,MAAM,EAAET,QAAQ,CAACS,MAHX;AAINC,UAAAA,MAAM,EAAElB,IAAI,CAACmB,WAAL,CAAiBC;AAJnB;AADa,OAJX,EAYXC,KAZW,CAYL;AACLnB,QAAAA,OAAO,EAAPA,OADK;AAELC,QAAAA,MAAM,EAANA,MAFK;AAGLC,QAAAA,SAAS,EAATA,SAHK;AAILC,QAAAA,QAAQ,EAARA,QAJK;AAKLC,QAAAA,UAAU,EAAVA;AALK,OAZK,CAAd;AAmBA,WAAKgB,SAAL,CAAe,CAACZ,KAAD,CAAf,EAAwB,KAAxB,EAA+BV,IAA/B;AAEAP,MAAAA,cAAc,CAAC,KAAKK,WAAN,EAAmB,CAACY,KAAD,CAAnB,CAAd;AAEA,aAAO;AACLa,QAAAA,MAAM,EAAE,CAACb,KAAD,CADH;AAELc,QAAAA,WAAW,EAAE,CAACd,KAAK,CAACe,EAAP;AAFR,OAAP;AAID;;;;EA7CyC/B,W;;SAAvBE,c","sourcesContent":["import { ILayer, ISubLayerInitOptions } from '@antv/l7-core';\nimport { Tile } from '@antv/l7-utils';\nimport { ITileFactoryOptions } from '../interface';\nimport { registerLayers } from '../utils';\nimport TileFactory from './base';\nimport RasterDataLayer from './rasterDataLayer';\n\nexport default class RasterTiffTile extends TileFactory {\n public parentLayer: ILayer;\n\n constructor(option: ITileFactoryOptions) {\n super(option);\n this.parentLayer = option.parent;\n }\n\n public createTile(tile: Tile, initOptions: ISubLayerInitOptions) {\n const {\n opacity,\n domain,\n clampHigh,\n clampLow,\n rampColors,\n mask,\n } = initOptions;\n const tiffdata = tile.data;\n const layer = new RasterDataLayer({\n visible: tile.isVisible,\n mask,\n })\n .source(tiffdata.data, {\n parser: {\n type: 'raster',\n width: tiffdata.width,\n height: tiffdata.height,\n extent: tile.bboxPolygon.bbox,\n },\n })\n .style({\n opacity,\n domain,\n clampHigh,\n clampLow,\n rampColors,\n });\n this.emitEvent([layer], false, tile);\n\n registerLayers(this.parentLayer, [layer]);\n\n return {\n layers: [layer],\n layerIDList: [layer.id],\n };\n }\n}\n"],"file":"rasterData.js"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import BaseLayer from '../../core/BaseLayer';
|
|
2
|
+
import { IRasterLayerStyleOptions } from '../../core/interface';
|
|
3
|
+
import RasterModel from '../../raster/models/raster';
|
|
4
|
+
export default class RasterTiffLayer extends BaseLayer<Partial<IRasterLayerStyleOptions>> {
|
|
5
|
+
type: string;
|
|
6
|
+
buildModels(): void;
|
|
7
|
+
rebuildModels(): void;
|
|
8
|
+
protected getModelType(): typeof RasterModel;
|
|
9
|
+
protected getConfigSchema(): {
|
|
10
|
+
properties: {
|
|
11
|
+
opacity: {
|
|
12
|
+
type: string;
|
|
13
|
+
minimum: number;
|
|
14
|
+
maximum: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
protected getDefaultConfig(): {};
|
|
19
|
+
}
|
|
@@ -10,17 +10,18 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
10
10
|
|
|
11
11
|
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; } }
|
|
12
12
|
|
|
13
|
-
import BaseLayer from '
|
|
13
|
+
import BaseLayer from '../../core/BaseLayer';
|
|
14
|
+
import RasterModel from '../../raster/models/raster';
|
|
14
15
|
|
|
15
|
-
var
|
|
16
|
-
_inherits(
|
|
16
|
+
var RasterTiffLayer = function (_BaseLayer) {
|
|
17
|
+
_inherits(RasterTiffLayer, _BaseLayer);
|
|
17
18
|
|
|
18
|
-
var _super = _createSuper(
|
|
19
|
+
var _super = _createSuper(RasterTiffLayer);
|
|
19
20
|
|
|
20
|
-
function
|
|
21
|
+
function RasterTiffLayer() {
|
|
21
22
|
var _this;
|
|
22
23
|
|
|
23
|
-
_classCallCheck(this,
|
|
24
|
+
_classCallCheck(this, RasterTiffLayer);
|
|
24
25
|
|
|
25
26
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
27
|
args[_key] = arguments[_key];
|
|
@@ -28,44 +29,50 @@ var LayerGroup = function (_BaseLayer) {
|
|
|
28
29
|
|
|
29
30
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
30
31
|
|
|
31
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
32
|
+
_defineProperty(_assertThisInitialized(_this), "type", _this.layerType);
|
|
32
33
|
|
|
33
34
|
return _this;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
_createClass(
|
|
37
|
-
key: "
|
|
38
|
-
value: function
|
|
39
|
-
this.
|
|
37
|
+
_createClass(RasterTiffLayer, [{
|
|
38
|
+
key: "buildModels",
|
|
39
|
+
value: function buildModels() {
|
|
40
|
+
var model = this.getModelType();
|
|
41
|
+
this.layerModel = new model(this);
|
|
42
|
+
this.models = this.layerModel.initModels();
|
|
40
43
|
}
|
|
41
44
|
}, {
|
|
42
|
-
key: "
|
|
43
|
-
value: function
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
layer.destroy();
|
|
45
|
+
key: "rebuildModels",
|
|
46
|
+
value: function rebuildModels() {
|
|
47
|
+
this.models = this.layerModel.buildModels();
|
|
48
|
+
}
|
|
49
|
+
}, {
|
|
50
|
+
key: "getModelType",
|
|
51
|
+
value: function getModelType() {
|
|
52
|
+
return RasterModel;
|
|
51
53
|
}
|
|
52
54
|
}, {
|
|
53
|
-
key: "
|
|
54
|
-
value: function
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
key: "getConfigSchema",
|
|
56
|
+
value: function getConfigSchema() {
|
|
57
|
+
return {
|
|
58
|
+
properties: {
|
|
59
|
+
opacity: {
|
|
60
|
+
type: 'number',
|
|
61
|
+
minimum: 0,
|
|
62
|
+
maximum: 1
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
59
66
|
}
|
|
60
67
|
}, {
|
|
61
|
-
key: "
|
|
62
|
-
value: function
|
|
63
|
-
return
|
|
68
|
+
key: "getDefaultConfig",
|
|
69
|
+
value: function getDefaultConfig() {
|
|
70
|
+
return {};
|
|
64
71
|
}
|
|
65
72
|
}]);
|
|
66
73
|
|
|
67
|
-
return
|
|
74
|
+
return RasterTiffLayer;
|
|
68
75
|
}(BaseLayer);
|
|
69
76
|
|
|
70
|
-
export {
|
|
71
|
-
//# sourceMappingURL=
|
|
77
|
+
export { RasterTiffLayer as default };
|
|
78
|
+
//# sourceMappingURL=rasterDataLayer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tile/tileFactory/rasterDataLayer.ts"],"names":["BaseLayer","RasterModel","RasterTiffLayer","layerType","model","getModelType","layerModel","models","initModels","buildModels","properties","opacity","type","minimum","maximum"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,SAAP,MAAsB,sBAAtB;AAEA,OAAOC,WAAP,MAAwB,4BAAxB;;IAEqBC,e;;;;;;;;;;;;;;;;2DAGG,MAAKC,S;;;;;;;WAC3B,uBAAqB;AACnB,UAAMC,KAAK,GAAG,KAAKC,YAAL,EAAd;AACA,WAAKC,UAAL,GAAkB,IAAIF,KAAJ,CAAU,IAAV,CAAlB;AACA,WAAKG,MAAL,GAAc,KAAKD,UAAL,CAAgBE,UAAhB,EAAd;AACD;;;WAED,yBAAuB;AACrB,WAAKD,MAAL,GAAc,KAAKD,UAAL,CAAgBG,WAAhB,EAAd;AACD;;;WAED,wBAAyB;AACvB,aAAOR,WAAP;AACD;;;WACD,2BAA4B;AAC1B,aAAO;AACLS,QAAAA,UAAU,EAAE;AACVC,UAAAA,OAAO,EAAE;AACPC,YAAAA,IAAI,EAAE,QADC;AAEPC,YAAAA,OAAO,EAAE,CAFF;AAGPC,YAAAA,OAAO,EAAE;AAHF;AADC;AADP,OAAP;AASD;;;WAED,4BAA6B;AAC3B,aAAO,EAAP;AACD;;;;EA/B0Cd,S;;SAAxBE,e","sourcesContent":["import BaseLayer from '../../core/BaseLayer';\nimport { IRasterLayerStyleOptions } from '../../core/interface';\nimport RasterModel from '../../raster/models/raster';\n\nexport default class RasterTiffLayer extends BaseLayer<\n Partial<IRasterLayerStyleOptions>\n> {\n public type: string = this.layerType as string;\n public buildModels() {\n const model = this.getModelType();\n this.layerModel = new model(this);\n this.models = this.layerModel.initModels();\n }\n\n public rebuildModels() {\n this.models = this.layerModel.buildModels();\n }\n\n protected getModelType() {\n return RasterModel;\n }\n protected getConfigSchema() {\n return {\n properties: {\n opacity: {\n type: 'number',\n minimum: 0,\n maximum: 1,\n },\n },\n };\n }\n\n protected getDefaultConfig() {\n return {};\n }\n}\n"],"file":"rasterDataLayer.js"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import BaseLayer from '../../core/BaseLayer';
|
|
2
|
+
import { ILineLayerStyleOptions, IPointLayerStyleOptions, IPolygonLayerStyleOptions } from '../../core/interface';
|
|
3
|
+
import lineFillModel from '../../line/models/tile';
|
|
4
|
+
import pointTextModel from '../../point/models/text';
|
|
5
|
+
import pointFillModel from '../../point/models/tile';
|
|
6
|
+
import polygonFillModel from '../../polygon/models/tile';
|
|
7
|
+
export default class VectorLayer extends BaseLayer<Partial<IPolygonLayerStyleOptions & ILineLayerStyleOptions & IPointLayerStyleOptions>> {
|
|
8
|
+
isVector: boolean;
|
|
9
|
+
type: string;
|
|
10
|
+
private pickedID;
|
|
11
|
+
getPickID(): number | null;
|
|
12
|
+
setPickID(): number | null;
|
|
13
|
+
buildModels(): void;
|
|
14
|
+
rebuildModels(): void;
|
|
15
|
+
protected getModelType(): typeof lineFillModel | typeof pointTextModel | typeof pointFillModel | typeof polygonFillModel;
|
|
16
|
+
protected getPointModel(): typeof pointTextModel | typeof pointFillModel;
|
|
17
|
+
protected getConfigSchema(): {
|
|
18
|
+
properties: {
|
|
19
|
+
opacity: {
|
|
20
|
+
type: string;
|
|
21
|
+
minimum: number;
|
|
22
|
+
maximum: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
protected getDefaultConfig(): {};
|
|
27
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
+
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
|
|
11
|
+
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; } }
|
|
12
|
+
|
|
13
|
+
import BaseLayer from '../../core/BaseLayer';
|
|
14
|
+
import lineFillModel from '../../line/models/tile';
|
|
15
|
+
import pointTextModel from '../../point/models/text';
|
|
16
|
+
import pointFillModel from '../../point/models/tile';
|
|
17
|
+
import polygonFillModel from '../../polygon/models/tile';
|
|
18
|
+
|
|
19
|
+
var VectorLayer = function (_BaseLayer) {
|
|
20
|
+
_inherits(VectorLayer, _BaseLayer);
|
|
21
|
+
|
|
22
|
+
var _super = _createSuper(VectorLayer);
|
|
23
|
+
|
|
24
|
+
function VectorLayer() {
|
|
25
|
+
var _this;
|
|
26
|
+
|
|
27
|
+
_classCallCheck(this, VectorLayer);
|
|
28
|
+
|
|
29
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
30
|
+
args[_key] = arguments[_key];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
34
|
+
|
|
35
|
+
_defineProperty(_assertThisInitialized(_this), "isVector", true);
|
|
36
|
+
|
|
37
|
+
_defineProperty(_assertThisInitialized(_this), "type", _this.layerType);
|
|
38
|
+
|
|
39
|
+
_defineProperty(_assertThisInitialized(_this), "pickedID", null);
|
|
40
|
+
|
|
41
|
+
return _this;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
_createClass(VectorLayer, [{
|
|
45
|
+
key: "getPickID",
|
|
46
|
+
value: function getPickID() {
|
|
47
|
+
return this.pickedID;
|
|
48
|
+
}
|
|
49
|
+
}, {
|
|
50
|
+
key: "setPickID",
|
|
51
|
+
value: function setPickID() {
|
|
52
|
+
return this.pickedID;
|
|
53
|
+
}
|
|
54
|
+
}, {
|
|
55
|
+
key: "buildModels",
|
|
56
|
+
value: function buildModels() {
|
|
57
|
+
var model = this.getModelType();
|
|
58
|
+
this.layerModel = new model(this);
|
|
59
|
+
this.models = this.layerModel.initModels();
|
|
60
|
+
}
|
|
61
|
+
}, {
|
|
62
|
+
key: "rebuildModels",
|
|
63
|
+
value: function rebuildModels() {
|
|
64
|
+
this.models = this.layerModel.buildModels();
|
|
65
|
+
}
|
|
66
|
+
}, {
|
|
67
|
+
key: "getModelType",
|
|
68
|
+
value: function getModelType() {
|
|
69
|
+
switch (this.layerType) {
|
|
70
|
+
case 'PolygonLayer':
|
|
71
|
+
return polygonFillModel;
|
|
72
|
+
|
|
73
|
+
case 'LineLayer':
|
|
74
|
+
return lineFillModel;
|
|
75
|
+
|
|
76
|
+
case 'PointLayer':
|
|
77
|
+
return this.getPointModel();
|
|
78
|
+
|
|
79
|
+
default:
|
|
80
|
+
return pointFillModel;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
key: "getPointModel",
|
|
85
|
+
value: function getPointModel() {
|
|
86
|
+
var layerData = this.getEncodedData();
|
|
87
|
+
|
|
88
|
+
var _this$getLayerConfig = this.getLayerConfig(),
|
|
89
|
+
shape2d = _this$getLayerConfig.shape2d;
|
|
90
|
+
|
|
91
|
+
var item = layerData.find(function (fe) {
|
|
92
|
+
return fe.hasOwnProperty('shape');
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
if (item) {
|
|
96
|
+
var shape = item.shape;
|
|
97
|
+
|
|
98
|
+
if ((shape2d === null || shape2d === void 0 ? void 0 : shape2d.indexOf(shape)) !== -1) {
|
|
99
|
+
return pointFillModel;
|
|
100
|
+
} else {
|
|
101
|
+
return pointTextModel;
|
|
102
|
+
}
|
|
103
|
+
} else {
|
|
104
|
+
return pointFillModel;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
108
|
+
key: "getConfigSchema",
|
|
109
|
+
value: function getConfigSchema() {
|
|
110
|
+
return {
|
|
111
|
+
properties: {
|
|
112
|
+
opacity: {
|
|
113
|
+
type: 'number',
|
|
114
|
+
minimum: 0,
|
|
115
|
+
maximum: 1
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
}, {
|
|
121
|
+
key: "getDefaultConfig",
|
|
122
|
+
value: function getDefaultConfig() {
|
|
123
|
+
return {};
|
|
124
|
+
}
|
|
125
|
+
}]);
|
|
126
|
+
|
|
127
|
+
return VectorLayer;
|
|
128
|
+
}(BaseLayer);
|
|
129
|
+
|
|
130
|
+
export { VectorLayer as default };
|
|
131
|
+
//# sourceMappingURL=vectorLayer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tile/tileFactory/vectorLayer.ts"],"names":["BaseLayer","lineFillModel","pointTextModel","pointFillModel","polygonFillModel","VectorLayer","layerType","pickedID","model","getModelType","layerModel","models","initModels","buildModels","getPointModel","layerData","getEncodedData","getLayerConfig","shape2d","item","find","fe","hasOwnProperty","shape","indexOf","properties","opacity","type","minimum","maximum"],"mappings":";;;;;;;;;;;;AACA,OAAOA,SAAP,MAAsB,sBAAtB;AAMA,OAAOC,aAAP,MAA0B,wBAA1B;AACA,OAAOC,cAAP,MAA2B,yBAA3B;AACA,OAAOC,cAAP,MAA2B,yBAA3B;AACA,OAAOC,gBAAP,MAA6B,2BAA7B;;IAEqBC,W;;;;;;;;;;;;;;;;+DAKQ,I;;2DACL,MAAKC,S;;+DAEO,I;;;;;;;WAElC,qBAAmB;AACjB,aAAO,KAAKC,QAAZ;AACD;;;WAED,qBAAmB;AACjB,aAAO,KAAKA,QAAZ;AACD;;;WAED,uBAAqB;AACnB,UAAMC,KAAK,GAAG,KAAKC,YAAL,EAAd;AACA,WAAKC,UAAL,GAAkB,IAAIF,KAAJ,CAAU,IAAV,CAAlB;AACA,WAAKG,MAAL,GAAc,KAAKD,UAAL,CAAgBE,UAAhB,EAAd;AACD;;;WAED,yBAAuB;AACrB,WAAKD,MAAL,GAAc,KAAKD,UAAL,CAAgBG,WAAhB,EAAd;AACD;;;WAED,wBAAyB;AACvB,cAAQ,KAAKP,SAAb;AACE,aAAK,cAAL;AACE,iBAAOF,gBAAP;;AACF,aAAK,WAAL;AACE,iBAAOH,aAAP;;AACF,aAAK,YAAL;AACE,iBAAO,KAAKa,aAAL,EAAP;;AACF;AACE,iBAAOX,cAAP;AARJ;AAUD;;;WAED,yBAA0B;AACxB,UAAMY,SAAS,GAAG,KAAKC,cAAL,EAAlB;;AACA,iCAAoB,KAAKC,cAAL,EAApB;AAAA,UAAQC,OAAR,wBAAQA,OAAR;;AACA,UAAMC,IAAI,GAAGJ,SAAS,CAACK,IAAV,CAAe,UAACC,EAAD,EAAwB;AAClD,eAAOA,EAAE,CAACC,cAAH,CAAkB,OAAlB,CAAP;AACD,OAFY,CAAb;;AAIA,UAAIH,IAAJ,EAAU;AACR,YAAMI,KAAK,GAAGJ,IAAI,CAACI,KAAnB;;AACA,YAAI,CAAAL,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAEM,OAAT,CAAiBD,KAAjB,OAAsC,CAAC,CAA3C,EAA8C;AAC5C,iBAAOpB,cAAP;AACD,SAFD,MAEO;AACL,iBAAOD,cAAP;AACD;AACF,OAPD,MAOO;AACL,eAAOC,cAAP;AACD;AACF;;;WAED,2BAA4B;AAC1B,aAAO;AACLsB,QAAAA,UAAU,EAAE;AACVC,UAAAA,OAAO,EAAE;AACPC,YAAAA,IAAI,EAAE,QADC;AAEPC,YAAAA,OAAO,EAAE,CAFF;AAGPC,YAAAA,OAAO,EAAE;AAHF;AADC;AADP,OAAP;AASD;;;WAED,4BAA6B;AAC3B,aAAO,EAAP;AACD;;;;EA1EsC7B,S;;SAApBK,W","sourcesContent":["import { IEncodeFeature } from '@antv/l7-core';\nimport BaseLayer from '../../core/BaseLayer';\nimport {\n ILineLayerStyleOptions,\n IPointLayerStyleOptions,\n IPolygonLayerStyleOptions,\n} from '../../core/interface';\nimport lineFillModel from '../../line/models/tile';\nimport pointTextModel from '../../point/models/text';\nimport pointFillModel from '../../point/models/tile';\nimport polygonFillModel from '../../polygon/models/tile';\n\nexport default class VectorLayer extends BaseLayer<\n Partial<\n IPolygonLayerStyleOptions & ILineLayerStyleOptions & IPointLayerStyleOptions\n >\n> {\n public isVector: boolean = true;\n public type: string = this.layerType as string;\n // Tip: 单独被 tile 瓦片的渲染链路使用(用于优化性能)\n private pickedID: number | null = null;\n\n public getPickID() {\n return this.pickedID;\n }\n\n public setPickID() {\n return this.pickedID;\n }\n\n public buildModels() {\n const model = this.getModelType();\n this.layerModel = new model(this);\n this.models = this.layerModel.initModels();\n }\n\n public rebuildModels() {\n this.models = this.layerModel.buildModels();\n }\n\n protected getModelType() {\n switch (this.layerType) {\n case 'PolygonLayer':\n return polygonFillModel;\n case 'LineLayer':\n return lineFillModel;\n case 'PointLayer':\n return this.getPointModel();\n default:\n return pointFillModel;\n }\n }\n\n protected getPointModel() {\n const layerData = this.getEncodedData();\n const { shape2d } = this.getLayerConfig();\n const item = layerData.find((fe: IEncodeFeature) => {\n return fe.hasOwnProperty('shape');\n });\n // only support pointFill & pointText now\n if (item) {\n const shape = item.shape;\n if (shape2d?.indexOf(shape as string) !== -1) {\n return pointFillModel;\n } else {\n return pointTextModel;\n }\n } else {\n return pointFillModel;\n }\n }\n\n protected getConfigSchema() {\n return {\n properties: {\n opacity: {\n type: 'number',\n minimum: 0,\n maximum: 1,\n },\n },\n };\n }\n\n protected getDefaultConfig() {\n return {};\n }\n}\n"],"file":"vectorLayer.js"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { IInteractionTarget, ILayer, IScale, IScaleOptions, ITileLayer, ITileLayerManager, ITileLayerOPtions } from '@antv/l7-core';
|
|
2
|
+
import { Tile, TilesetManager } from '@antv/l7-utils';
|
|
3
|
+
export default class BaseTileLayer implements ITileLayer {
|
|
4
|
+
get children(): ILayer[];
|
|
5
|
+
type: string;
|
|
6
|
+
sourceLayer: string;
|
|
7
|
+
parent: ILayer;
|
|
8
|
+
initedTileset: boolean;
|
|
9
|
+
tilesetManager: TilesetManager | undefined;
|
|
10
|
+
tileLayerManager: ITileLayerManager;
|
|
11
|
+
private lastViewStates;
|
|
12
|
+
private timer;
|
|
13
|
+
private mapService;
|
|
14
|
+
private layerService;
|
|
15
|
+
private pickColors;
|
|
16
|
+
constructor({ parent, rendererService, mapService, layerService, pickingService, }: ITileLayerOPtions);
|
|
17
|
+
/**
|
|
18
|
+
* 直接透传 scale 方法
|
|
19
|
+
* @param field
|
|
20
|
+
* @param cfg
|
|
21
|
+
*/
|
|
22
|
+
scale(field: string | number | IScaleOptions, cfg?: IScale): void;
|
|
23
|
+
/**
|
|
24
|
+
* 渲染瓦片的图层
|
|
25
|
+
*/
|
|
26
|
+
render(): void;
|
|
27
|
+
clearPick(type: string): void;
|
|
28
|
+
/**
|
|
29
|
+
* 清除 select 的选中状态
|
|
30
|
+
*/
|
|
31
|
+
clearPickState(): void;
|
|
32
|
+
/**
|
|
33
|
+
* 瓦片图层独立的拾取逻辑
|
|
34
|
+
* @param target
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
pickLayers(target: IInteractionTarget): boolean;
|
|
38
|
+
tileLoaded(tile: Tile): void;
|
|
39
|
+
tileError(error: Error): void;
|
|
40
|
+
tileUnLoad(tile: Tile): void;
|
|
41
|
+
tileUpdate(): void;
|
|
42
|
+
protected setPickState(layers: ILayer[]): void;
|
|
43
|
+
private bindSubLayerPick;
|
|
44
|
+
private setHighlight;
|
|
45
|
+
private setSelect;
|
|
46
|
+
private selectFeature;
|
|
47
|
+
private bindSubLayerEvent;
|
|
48
|
+
private initTileSetManager;
|
|
49
|
+
private bindTilesetEvent;
|
|
50
|
+
private getCurrentView;
|
|
51
|
+
}
|