MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / onAdd

Method onAdd

src/maplibregl/overlay/FGBLayer.js:82–106  ·  view source on GitHub ↗

* @function FGBLayer.prototype.onAdd * @param {maplibregl.Map} map - MapLibreGL Map 对象。

(map)

Source from the content-addressed store, hash-verified

80 * @param {maplibregl.Map} map - MapLibreGL Map 对象。
81 */
82 onAdd(map) {
83 this.map = map;
84 let extent = [];
85 if (this.strategy === 'bbox') {
86 const bounds = this.map.getBounds().toArray();
87 extent = [
88 bounds[0][0],
89 bounds[0][1],
90 bounds[1][0],
91 bounds[1][1]
92 ];
93 this.map.on('moveend', this._updateFeaturesFn);
94 }
95
96 if (this.extent) {
97 const intersectExtent = getIntersection(this.extent, extent);
98 if (intersectExtent && intersectExtent.length) {
99 extent = intersectExtent;
100 } else {
101 extent = this.extent;
102 }
103 }
104 this.renderer = new FGBLayerRenderer(this.options);
105 this._handleFeatures(extent);
106 }
107 /**
108 * @function FGBLayer.prototype.render
109 */

Callers

nothing calls this directly

Calls 5

_handleFeaturesMethod · 0.95
getIntersectionFunction · 0.90
toArrayMethod · 0.45
getBoundsMethod · 0.45
onMethod · 0.45

Tested by

no test coverage detected