@@ -10,14 +10,51 @@ return {
10
10
push : function ( feature , point ) {
11
11
var factory = this . _getFactory ( feature ) ;
12
12
if ( ! factory ) return ;
13
+
14
+ var _coords = feature . getCoords ( ) ,
15
+ _point = feature . map . getCoords ( point )
16
+ ;
17
+ if ( feature . getCoordsType ( ) == "LineString" ) {
18
+ _coords . push ( _point ) ;
19
+ if ( feature . coords != _coords ) {
20
+ feature . coords . push ( point ) ;
21
+ }
22
+ }
23
+
13
24
factory . push ( feature , point ) ;
14
25
} ,
15
26
16
27
set : function ( feature , index , point ) {
17
28
var factory = this . _getFactory ( feature ) ;
18
29
if ( ! factory ) return ;
30
+
31
+ var _coords = feature . getCoords ( ) ,
32
+ _point = feature . map . getCoords ( point )
33
+ ;
34
+ if ( feature . getCoordsType ( ) == "LineString" ) {
35
+ _coords [ index ] = _point ;
36
+ if ( feature . coords != _coords ) {
37
+ feature . coords [ index ] = point ;
38
+ }
39
+ }
40
+
19
41
factory . set ( feature , index , point ) ;
20
42
} ,
43
+
44
+ remove : function ( feature , index ) {
45
+ var factory = this . _getFactory ( feature ) ;
46
+ if ( ! factory ) return ;
47
+
48
+ var _coords = feature . getCoords ( ) ;
49
+ if ( feature . getCoordsType ( ) == "LineString" ) {
50
+ _coords . splice ( index , 1 ) ;
51
+ if ( feature . coords != _coords ) {
52
+ feature . coords . splice ( index , 1 ) ;
53
+ }
54
+ }
55
+
56
+ factory . remove ( feature , index ) ;
57
+ } ,
21
58
22
59
_getFactory : function ( feature ) {
23
60
return feature . map . engine . getFactory ( dependency ) ;
0 commit comments