@@ -5,8 +5,9 @@ import { FetchRequest } from '@supermap/iclient-common/util/FetchRequest';
55describe ( 'L7LayerUtil' , ( ) => {
66 const mapstudioWebMap_L7LayersRes = JSON . parse ( mapstudioWebMap_L7Layers ) ;
77
8+ const scene = new mockL7 . Scene ( ) ;
89 const map = {
9- getL7Scene : ( ) => Promise . resolve ( mockL7 . Scene ) ,
10+ getL7Scene : ( ) => Promise . resolve ( scene ) ,
1011 addLayer : ( ) => { } ,
1112 getZoom : ( ) => 3
1213 } ;
@@ -20,7 +21,16 @@ describe('L7LayerUtil', () => {
2021 map,
2122 webMapInfo : { ...mapstudioWebMap_L7LayersRes } ,
2223 l7Layers : mapstudioWebMap_L7LayersRes . layers . filter ( ( layer ) => isL7Layer ( layer ) ) ,
23- spriteDatas : { } ,
24+ spriteDatas : {
25+ shape7 : {
26+ sdf : true ,
27+ pixelRatio : 1 ,
28+ width : 104 ,
29+ x : 0 ,
30+ y : 0 ,
31+ height : 104
32+ }
33+ } ,
2434 options
2535 } ;
2636
@@ -77,75 +87,75 @@ describe('L7LayerUtil', () => {
7787 it ( 'add od layer' , ( done ) => {
7888 const layers = [
7989 {
80- source : 'ms_1554834293_1716384530289_76' ,
81- 'source-layer' : '1554834293$msgeometry' ,
82- minzoom : 0 ,
83- maxzoom : 24 ,
90+ layout : {
91+ 'line-curve-shape' : 'greatcircle' ,
92+ visibility : 'visible' ,
93+ 'line-curve-segment' : 30
94+ } ,
8495 metadata : {
8596 MapStudio : {
8697 title : '国内航班数据_100'
8798 }
8899 } ,
89- id : '国内航班数据_100' ,
90- type : 'line-curve' ,
100+ maxzoom : 24 ,
91101 paint : {
92102 'line-curve-color' : '#ff6b34' ,
103+ 'line-curve-dasharray' : [ 1 , 0 ] ,
93104 'line-curve-opacity' : 1 ,
94105 'line-curve-width' : 1 ,
95- 'line-curve-pattern-opacity' : 1 ,
96- 'line-curve-dasharray' : [ 1 , 0 ]
106+ 'line-curve-pattern-opacity' : 1
97107 } ,
108+ source : 'ms_1554834293_1716875846578_8' ,
109+ 'source-layer' : '1554834293$msgeometry' ,
110+ id : '国内航班数据_100' ,
111+ type : 'line-curve' ,
112+ minzoom : 0
113+ } ,
114+ {
98115 layout : {
99116 'line-curve-shape' : 'greatcircle' ,
117+ 'line-curve-animate-duration' : 4 ,
118+ visibility : 'visible' ,
100119 'line-curve-segment' : 30 ,
101- visibility : 'visible'
102- }
103- } ,
104- {
105- source : 'ms_1554834293_1716384530289_76' ,
106- 'source-layer' : '1554834293$msgeometry' ,
107- minzoom : 0 ,
108- maxzoom : 24 ,
120+ 'line-curve-animate-trailLength' : 0.2 ,
121+ 'line-curve-animate-interval' : 0.4 ,
122+ 'line-curve-pattern-rotate' : 0 ,
123+ 'line-curve-pattern-blend' : 'replace' ,
124+ 'line-curve-pattern-interval' : 20
125+ } ,
109126 metadata : {
110127 MapStudio : {
111128 title : '国内航班数据_100'
112129 }
113130 } ,
114- id : 'ms_composite_国内航班数据_100' ,
115- type : 'line-curve' ,
131+ maxzoom : 24 ,
116132 paint : {
133+ 'line-curve-pattern-color' : 'rgba(126,211,33,1)' ,
117134 'line-curve-color' : '#ff6b34' ,
135+ 'line-curve-pattern' : 'shape7' ,
118136 'line-curve-opacity' : 1 ,
119137 'line-curve-width' : 10 ,
120- 'line-curve-pattern' : 'circle' ,
121- 'line-curve-pattern-color' : 'rgba(89,89,89,1)' ,
122138 'line-curve-pattern-opacity' : 1
123139 } ,
124- layout : {
125- 'line-curve-shape' : 'greatcircle' ,
126- 'line-curve-pattern-rotate' : 0 ,
127- 'line-curve-pattern-interval' : 20 ,
128- 'line-curve-pattern-blend' : 'replace' ,
129- 'line-curve-segment' : 30 ,
130- 'line-curve-animate-duration' : 4 ,
131- 'line-curve-animate-interval' : 0.4 ,
132- 'line-curve-animate-trailLength' : 0.2 ,
133- visibility : 'visible'
134- }
140+ source : 'ms_1554834293_1716875846578_8' ,
141+ 'source-layer' : '1554834293$msgeometry' ,
142+ id : 'ms_composite_国内航班数据_100' ,
143+ type : 'line-curve' ,
144+ minzoom : 0
135145 }
136146 ] ;
137147 const sources = {
138- ms_1554834293_1716384530289_76 : {
139- type : 'geojson' ,
148+ ms_1554834293_1716875846578_8 : {
140149 data : {
141- type : 'supermap-structured-data ' ,
142- dataId : '1554834293 '
150+ dataId : '1554834293 ' ,
151+ type : 'supermap-structured-data '
143152 } ,
144153 od : true ,
145154 originX : '起飞机场x' ,
146155 originY : '起飞机场y' ,
147- destinationX : '降落机场x' ,
148- destinationY : '降落机场y'
156+ destinationX : '到达城市x' ,
157+ destinationY : '到达城市y' ,
158+ type : 'geojson'
149159 }
150160 } ;
151161 const nextOptions = {
0 commit comments