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

Method getFeatures

src/openlayers/mapping/WebMap.js:2519–2549  ·  view source on GitHub ↗

* @private * @function WebMap.prototype.getFeatures * @description 从地图中获取feature * @param {Object} fields - 图层信息 * @param {number} layerInfo - 图层index * @param {number} success - 成功回调 * @param {number} faild - 失败回调

(fields, layerInfo, success, faild)

Source from the content-addressed store, hash-verified

2517 * @param {number} faild - 失败回调
2518 */
2519 getFeatures(fields, layerInfo, success, faild) {
2520 var that = this;
2521 var source = layerInfo.dataSource;
2522 var fileCode = layerInfo.projection;
2523 queryFeatureBySQL(
2524 source.url,
2525 source.layerName,
2526 null,
2527 fields,
2528 null,
2529 function (result) {
2530 var recordsets = result.result.recordsets[0];
2531 var features = recordsets.features.features;
2532
2533 var featuresObj = that.parseGeoJsonData2Feature(
2534 {
2535 allDatas: {
2536 features
2537 },
2538 fileCode: fileCode,
2539 featureProjection: that.baseProjection
2540 },
2541 'JSON'
2542 );
2543 success(featuresObj);
2544 },
2545 function (err) {
2546 faild(err);
2547 }
2548 );
2549 }
2550
2551 /**
2552 * @private

Callers 13

ChartViewSpec.jsFile · 0.45
successCallbackFunction · 0.45
GraphSpec.jsFile · 0.45
addLayersMethod · 0.45
ol.jsFile · 0.45
pFunction · 0.45
nFunction · 0.45

Calls 3

queryFeatureBySQLFunction · 0.90
successFunction · 0.85

Tested by

no test coverage detected