forked from SuperMap/iClient-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTurfLayerSpec.js
More file actions
36 lines (33 loc) · 1.06 KB
/
TurfLayerSpec.js
File metadata and controls
36 lines (33 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { TurfLayer } from '../../../src/leaflet/overlay/TurfLayer';
import * as turf from '@turf/turf';
describe('leaflet_Turf', () => {
var opt_options;
var serviceResult;
it('parse,parseOption,rocess_Measurement.along,', (done) => {
opt_options = {
attributions: " ",
features: " ",
format: "",
logo: "",
projection: "",
wrapX: "",
};
var turfLayer = new TurfLayer(opt_options);
expect(turfLayer).not.toBeNull();;
var type = "Measurement.along";
var line = turf.lineString([[-83, 30], [-84, 36], [-78, 41]]);
var options = { units: 'miles' };
var args = {
line: line,
distance: 10,
units: "kilometers"
};
var addFeaturesToMap = false;
turfLayer.process(type, args, (result) => {
serviceResult = result
}, addFeaturesToMap);
expect(serviceResult).not.toBeNull();
expect(serviceResult.geometry).not.toBeNull();
done();
});
});