Commit 7e04bc0 1 parent 61401c6 commit 7e04bc0 Copy full SHA for 7e04bc0
File tree 3 files changed +38
-0
lines changed
3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -449,6 +449,10 @@ class BaseObject extends maptalks.Eventable(Base) {
449
449
return this ;
450
450
}
451
451
452
+ getPickObject3d ( ) {
453
+ return this . pickObject3d ;
454
+ }
455
+
452
456
453
457
/**
454
458
* more method support
Original file line number Diff line number Diff line change @@ -72,6 +72,9 @@ class FatLine extends BaseObject {
72
72
73
73
_setMaterialRes ( layer , material ) {
74
74
const map = layer . getMap ( ) ;
75
+ if ( ! map ) {
76
+ return this ;
77
+ }
75
78
const size = map . getSize ( ) ;
76
79
const width = size . width ,
77
80
height = size . height ;
@@ -136,5 +139,19 @@ class FatLine extends BaseObject {
136
139
this . _fire ( 'workerload' , { target : this } ) ;
137
140
}
138
141
142
+ _animation ( ) {
143
+ const layer = this . getLayer ( ) ;
144
+ if ( ! layer ) {
145
+ return this ;
146
+ }
147
+ const object3d = this . getObject3d ( ) ;
148
+ const pickObject3d = this . getPickObject3d ( ) ;
149
+ [ object3d , pickObject3d ] . forEach ( object3d => {
150
+ if ( object3d ) {
151
+ this . _setMaterialRes ( layer , ( object3d as any ) . material ) ;
152
+ }
153
+ } ) ;
154
+ }
155
+
139
156
}
140
157
export default FatLine ;
Original file line number Diff line number Diff line change @@ -131,6 +131,9 @@ class FatLines extends MergedMixin(BaseObject) {
131
131
132
132
_setMaterialRes ( layer , material ) {
133
133
const map = layer . getMap ( ) ;
134
+ if ( ! map ) {
135
+ return this ;
136
+ }
134
137
const size = map . getSize ( ) ;
135
138
const width = size . width ,
136
139
height = size . height ;
@@ -280,6 +283,20 @@ class FatLines extends MergedMixin(BaseObject) {
280
283
}
281
284
this . _fire ( 'workerload' , { target : this } ) ;
282
285
}
286
+
287
+ _animation ( ) {
288
+ const layer = this . getLayer ( ) ;
289
+ if ( ! layer ) {
290
+ return this ;
291
+ }
292
+ const object3d = this . getObject3d ( ) ;
293
+ const pickObject3d = this . getPickObject3d ( ) ;
294
+ [ object3d , pickObject3d ] . forEach ( object3d => {
295
+ if ( object3d ) {
296
+ this . _setMaterialRes ( layer , ( object3d as any ) . material ) ;
297
+ }
298
+ } ) ;
299
+ }
283
300
}
284
301
285
302
export default FatLines ;
You can’t perform that action at this time.
0 commit comments