Example on how to update features for a vector layer by Updating features of a vectory layer every 5 seconds.
- OpenLayers 3
- Apache or XAMPP
Put the ol-test folder under htdocs
. Then go to http://localhost/ol-test/test.html
in any browser.
When a feature update is needed, you just need to change the features property of vector data source:
vectorLayer.getSource().clear();
vectorLayer.getSource().addFeatures(features);