Skip to content

Commit 100dbd0

Browse files
committed
添加TurfLayer,DeckglLayer,Turf的单元测试 review by songym
1 parent ca4d75c commit 100dbd0

File tree

7 files changed

+62616
-0
lines changed

7 files changed

+62616
-0
lines changed

test/leaflet/overlay/TurfLayerSpec.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { TurfLayer } from '../../../src/leaflet/overlay/TurfLayer';
2+
import * as turf from '@turf/turf';
3+
describe('leaflet_Turf', () => {
4+
var opt_options;
5+
var serviceResult;
6+
7+
it('parse,parseOption,rocess_Measurement.along,', (done) => {
8+
opt_options = {
9+
attributions: " ",
10+
features: " ",
11+
format: "",
12+
logo: "",
13+
projection: "",
14+
wrapX: "",
15+
};
16+
var turfLayer = new TurfLayer(opt_options);
17+
expect(turfLayer).not.toBeNull();;
18+
var type = "Measurement.along";
19+
var line = turf.lineString([[-83, 30], [-84, 36], [-78, 41]]);
20+
var options = { units: 'miles' };
21+
22+
var args = {
23+
line: line,
24+
distance: 10,
25+
units: "kilometers"
26+
};
27+
var addFeaturesToMap = false;
28+
29+
turfLayer.process(type, args, (result) => {
30+
serviceResult = result
31+
}, addFeaturesToMap);
32+
expect(serviceResult).not.toBeNull();
33+
expect(serviceResult.geometry).not.toBeNull();
34+
done();
35+
});
36+
});

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy