@@ -32,6 +32,7 @@ L.Renderer = L.Layer.extend({
32
32
initialize : function ( options ) {
33
33
L . setOptions ( this , options ) ;
34
34
L . stamp ( this ) ;
35
+ this . _layers = this . _layers || { } ;
35
36
} ,
36
37
37
38
onAdd : function ( ) {
@@ -45,17 +46,20 @@ L.Renderer = L.Layer.extend({
45
46
46
47
this . getPane ( ) . appendChild ( this . _container ) ;
47
48
this . _update ( ) ;
49
+ this . on ( 'update' , this . _updatePaths , this ) ;
48
50
} ,
49
51
50
52
onRemove : function ( ) {
51
53
L . DomUtil . remove ( this . _container ) ;
54
+ this . off ( 'update' , this . _updatePaths , this ) ;
52
55
} ,
53
56
54
57
getEvents : function ( ) {
55
58
var events = {
56
59
viewreset : this . _reset ,
57
60
zoom : this . _onZoom ,
58
- moveend : this . _update
61
+ moveend : this . _update ,
62
+ zoomend : this . _onZoomEnd
59
63
} ;
60
64
if ( this . _zoomAnimated ) {
61
65
events . zoomanim = this . _onAnimZoom ;
@@ -91,6 +95,22 @@ L.Renderer = L.Layer.extend({
91
95
_reset : function ( ) {
92
96
this . _update ( ) ;
93
97
this . _updateTransform ( this . _center , this . _zoom ) ;
98
+
99
+ for ( var id in this . _layers ) {
100
+ this . _layers [ id ] . _reset ( ) ;
101
+ }
102
+ } ,
103
+
104
+ _onZoomEnd : function ( ) {
105
+ for ( var id in this . _layers ) {
106
+ this . _layers [ id ] . _project ( ) ;
107
+ }
108
+ } ,
109
+
110
+ _updatePaths : function ( ) {
111
+ for ( var id in this . _layers ) {
112
+ this . _layers [ id ] . _update ( ) ;
113
+ }
94
114
} ,
95
115
96
116
_update : function ( ) {
0 commit comments