[OpenLayers-Users] displaying dynamic real time data

Heidt, Christopher M. CHRISTOPHER.M.HEIDT at saic.com
Mon Jun 15 09:16:27 EDT 2009


featureLayer.addFeatures() is exactly what you are looking for.

Var wktFormat = new OpenLayers.Format.WKT({});
Var Features = [];
For each linestring:
	Features.push(wktFormat.read(linestring));
End for each
featureLayer.addFeatures(Features)

-----Original Message-----
From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]
On Behalf Of Gerrit Lammert
Sent: Friday, June 12, 2009 8:04 AM
To: users at openlayers.org
Subject: [OpenLayers-Users] displaying dynamic real time data


Hi there.

I'm quite new working with openlayers.
I spent the last couple of days working on something and it is driving
me nuts. :) I want to visualize realtime data from a database as a
track.
To do this I am constantly (every 5 seconds) reading data from the DB as
LINESTRING(), and parse it using "OpenLayers.Layer.GML()" and "format:
OpenLayers.Format.WKT".
This does work, but what i do now is I remove the "old" layer and the
create a new layer with updated data the way described above.
This a) leads to a flicker and b) produces more overhead than necessary.
I would like to rather add new data to the existing layer gradually.
I tried to only retrieve data from the DB that changed after the last
request parse it as a feature and add it to the layer using
.addFeatures(), but I did not succeed.
Is there any example page that deals with this? I searched the web, the
OL-website and the OL-example-page without success.
Please help,

Gerrit
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users



More information about the Users mailing list