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

Method createDataflowService

src/openlayers/mapping/WebMap.js:4139–4152  ·  view source on GitHub ↗

* @private * @function WebMap.prototype.createDataflowService * @description 将feature添加到数据流图层 * @param {Object} layerInfo - 图层参数 * @param {Object} callback - 回调函数

(layerInfo, callback)

Source from the content-addressed store, hash-verified

4137 * @param {Object} callback - 回调函数
4138 */
4139 createDataflowService(layerInfo, callback) {
4140 let that = this;
4141 let dataflowService = new DataFlowService(layerInfo.wsUrl).initSubscribe();
4142 dataflowService.on('messageSucceeded', function (e) {
4143 let geojson = JSON.parse(e.value.data);
4144 let feature = transformTools.readFeature(geojson, {
4145 dataProjection: layerInfo.projection || 'EPSG:4326',
4146 featureProjection: that.baseProjection || 'EPSG:4326'
4147 });
4148 feature.setProperties({ attributes: geojson.properties });
4149 callback(feature);
4150 });
4151 layerInfo.dataflowService = dataflowService;
4152 }
4153
4154 /**
4155 * @private

Callers 2

createDataflowLayerMethod · 0.95

Calls 4

callbackFunction · 0.50
initSubscribeMethod · 0.45
onMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected