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

Method _handleFeatures

src/openlayers/overlay/FGB.js:109–141  ·  view source on GitHub ↗
(url, extent)

Source from the content-addressed store, hash-verified

107 }
108
109 async _handleFeatures(url, extent) {
110 let rect = {};
111 if (extent && extent.length) {
112 rect = {
113 minX: extent[0],
114 minY: extent[1],
115 maxX: extent[2],
116 maxY: extent[3]
117 };
118 }
119 const fgb = deserialize(url, rect);
120 let featureList = [];
121 const throttleFn = throttle(() => {
122 this.addFeatures(featureList);
123 featureList = [];
124 }, this.renderInterval, { trailing: true, leading: false });
125 for await (let feature of fgb) {
126 let id = feature.properties[this._idField];
127 if (id && !this._validatedId) {
128 this._validatedId = true;
129 this._checked = true;
130 }
131 feature = new GeoJSON().readFeature(feature);
132 if (id && this._checked) {
133 feature.setId(id);
134 }
135 if (this.options.featureLoader && typeof this.options.featureLoader === 'function') {
136 feature = this.options.featureLoader(feature);
137 }
138 featureList.push(feature);
139 throttleFn();
140 }
141 }
142
143 async _getStream(url) {
144 return await FetchRequest.get(url, {}, { withoutFormatSuffix: true }).then(function (response) {

Callers 2

constructorMethod · 0.95
FGBLayer.jsFile · 0.45

Calls 4

pushMethod · 0.80
throttleFunction · 0.50
addFeaturesMethod · 0.45
setIdMethod · 0.45

Tested by

no test coverage detected