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

Function DataFlowService

test/maplibregl/mapping/WebMapV2Spec.js:11–142  ·  view source on GitHub ↗
(serviceUrl)

Source from the content-addressed store, hash-verified

9import { Canvg } from 'canvg';
10
11function DataFlowService(serviceUrl) {
12 const dataflowFeature = {
13 geometry: {
14 type: 'Point',
15 coordinates: [116.588918, 40.07108]
16 },
17 properties: {
18 id: 1
19 }
20 };
21 const dataflowData = JSON.stringify(dataflowFeature);
22 this.initBroadcast = () => {
23 return this;
24 };
25 this.broadcast = () => {
26 return this;
27 };
28 this.initSubscribe = () => {
29 return {
30 on: (event, callback) => {
31 if (event === 'messageSucceeded') {
32 if (serviceUrl.includes('MultiLineString')) {
33 callback({
34 featureResult: {
35 geometry: {
36 type: 'MultiLineString',
37 coordinates: [
38 [
39 [0, 0],
40 [10, 10]
41 ]
42 ]
43 },
44 properties: {
45 id: 1
46 }
47 }
48 });
49 } else if (serviceUrl.includes('LineString')) {
50 callback({
51 featureResult: {
52 geometry: {
53 type: 'LineString',
54 coordinates: [
55 [0, 0],
56 [10, 10]
57 ]
58 },
59 properties: {
60 id: 1
61 }
62 }
63 });
64 } else if (serviceUrl.includes('Line')) {
65 callback({
66 featureResult: {
67 geometry: {
68 type: 'Line',

Callers

nothing calls this directly

Calls 1

callbackFunction · 0.70

Tested by

no test coverage detected