MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / constructor

Method constructor

src/openlayers/overlay/FGB.js:74–107  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

72
73export class FGB extends VectorSource {
74 constructor(options) {
75 const baseOptions = Object.assign({ strategy: bbox, useSpatialIndex: false }, options);
76 delete baseOptions.url;
77 delete baseOptions.extent;
78 delete baseOptions.idField;
79 super(baseOptions);
80 this.options = options || {};
81 this.strategy = baseOptions.strategy;
82 this.url = this.options.url;
83 this.extent = this.options.extent;
84 this._idField = this.options.idField || 'SmID';
85 this._validatedId = false;
86 this._checked = false;
87 this.renderInterval = this.options.renderInterval !== undefined ? this.options.renderInterval : 500;
88 this.setLoader(async function (extent) {
89 if (this.strategy === bbox) {
90 if (!this._validatedId) {
91 this.clear();
92 }
93 if (this.extent) {
94 const intersectExtent = getIntersection(this.extent, extent);
95 extent = (intersectExtent && intersectExtent.length) ? intersectExtent : this.extent;
96 }
97 }
98 if (!this.extent && (this.strategy === all || !isFinite(extent[0]))) {
99 extent = [];
100 }
101 let fgbStream;
102 if (!Object.keys(extent).length) {
103 fgbStream = await this._getStream(this.url);
104 }
105 this._handleFeatures((fgbStream && fgbStream.body) || this.url, extent);
106 });
107 }
108
109 async _handleFeatures(url, extent) {
110 let rect = {};

Callers

nothing calls this directly

Calls 4

_getStreamMethod · 0.95
_handleFeaturesMethod · 0.95
getIntersectionFunction · 0.90
clearMethod · 0.45

Tested by

no test coverage detected