[OpenLayers-Users] How to refresh layer vector?

StevenDenHartog steven.den.hartog at gmail.com
Mon Jun 17 06:17:39 PDT 2013


adidas wrote
> Hello! How to refresh layer vector?
> Trying:
> _function refreshAllLayers() {__
> __    lineLayer.refresh( { force: true } );__
> __    lineLayer_halo.refresh( { force: true } );__
> __}_
> ...
> _
> <button onclick="javascript: refreshAllLayers()">
> Refresh
> </button>
> _

Hey there!
Are you still having problems with this? The way the refresh function works
is that it refreshes the data in the vector layer, but it does not actually
cause a redraw of the layer. Please try the following:

_function refreshAllLayers() {__
__    lineLayer.refresh( { force: true } );__
__    lineLayer_halo.refresh( { force: true } );__
__    lineLayer.redraw();__
__    lineLayer_halo.redraw();__
__}_
I hope this solved the problem!



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/How-to-refresh-layer-vector-tp5059906p5060588.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list