* @private * @function WebMap.prototype.getFeatures * @description 从地图中获取feature * @param {Object} fields - 图层信息 * @param {number} layerInfo - 图层index * @param {number} success - 成功回调 * @param {number} faild - 失败回调
(fields, layerInfo, success, faild)
| 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 |
no test coverage detected