File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,7 @@ olx.interaction.InteractionOptions.prototype.handleEvent;
178
178
* overlays: (ol.Collection.<ol.Overlay>|Array.<ol.Overlay>|undefined),
179
179
* renderer: (ol.RendererType|Array.<ol.RendererType|string>|string|undefined),
180
180
* target: (Element|string|undefined),
181
+ * updateVectorsWhileAnimating: (boolean|undefined),
181
182
* view: (ol.View|undefined)}}
182
183
* @api
183
184
*/
@@ -294,6 +295,16 @@ olx.MapOptions.prototype.renderer;
294
295
olx . MapOptions . prototype . target ;
295
296
296
297
298
+ /**
299
+ * When set to true, vectors will be rendered immediately as they pan into view.
300
+ * This means that no vectors will be shown clipped, but the setting will have a
301
+ * performance impact for large amounts of vector data.
302
+ * Default is `false`.
303
+ * @type {boolean|undefined }
304
+ */
305
+ olx . MapOptions . prototype . updateVectorsWhileAnimating ;
306
+
307
+
297
308
/**
298
309
* The map's view. No layer sources will be fetched unless this is specified at
299
310
* construction time or through {@link ol.Map#setView}.
Original file line number Diff line number Diff line change @@ -187,6 +187,14 @@ ol.Map = function(options) {
187
187
this . pixelRatio_ = goog . isDef ( options . pixelRatio ) ?
188
188
options . pixelRatio : ol . has . DEVICE_PIXEL_RATIO ;
189
189
190
+ /**
191
+ * @type {boolean }
192
+ * @private
193
+ */
194
+ this . updateVectorsWhileAnimating_ =
195
+ goog . isDef ( options . updateVectorsWhileAnimating ) ?
196
+ options . updateVectorsWhileAnimating : false ;
197
+
190
198
/**
191
199
* @private
192
200
* @type {Object }
@@ -1234,6 +1242,7 @@ ol.Map.prototype.renderFrame_ = function(time) {
1234
1242
animate : false ,
1235
1243
attributions : { } ,
1236
1244
coordinateToPixelMatrix : this . coordinateToPixelMatrix_ ,
1245
+ updateVectorsWhileAnimating : this . updateVectorsWhileAnimating_ ,
1237
1246
extent : null ,
1238
1247
focus : goog . isNull ( this . focus_ ) ? viewState . center : this . focus_ ,
1239
1248
index : this . frameIndex_ ++ ,
Original file line number Diff line number Diff line change @@ -169,7 +169,8 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame =
169
169
frameState . attributions , vectorSource . getAttributions ( ) ) ;
170
170
this . updateLogos ( frameState , vectorSource ) ;
171
171
172
- if ( ! this . dirty_ && ( frameState . viewHints [ ol . ViewHint . ANIMATING ] ||
172
+ if ( ! this . dirty_ && ( ! frameState . updateVectorsWhileAnimating &&
173
+ frameState . viewHints [ ol . ViewHint . ANIMATING ] ||
173
174
frameState . viewHints [ ol . ViewHint . INTERACTING ] ) ) {
174
175
return true ;
175
176
}
You can’t perform that action at this time.
0 commit comments