(url, extent)
| 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) { |
no test coverage detected