Both are doable. You need to do a little digging to be sure you are pointing to the correct point when you either change its lonlat or delete it. Then you need to redraw the line.

In my application, I maintained a separate array pointing to the points in my line. Possibly not the most efficient, but it worked.

Michael

On 4/11/2012 12:08 PM, Curtis Olson wrote:
Hi,

I've begun my plunge into openlayers and have a number of things working, but I've run into a question that I haven't been able to answer for myself from the docs and the mailing list archives.

I am building a map that will live track an object (for example: my aircraft location as I fly in the FlightGear flight simulator.)

I would like to leave a trail behind myself showing my recent path (say for the past 10 seconds or the past 10 minutes.) I am imagining a LineString where I can insert new points at one end and remove points from the other end -- as my position updates.

I could create an entirely new LineString and Vector and add that to my layer 10x a second (removing the old feature), but I was hoping I could just build the linestring once, add it too a layer once, and from then on just modify the linestring structure.

Is something like this possible or am I barking up the wrong tree?

I have another sort of similar situation where I may want to additionally modify the point locations of some of the points in the linestring (based on external data coming from the flight simulator.) In otherwords I want to reshape the linestring by adjusting the locations of individual points. Is anything like this possible?

I've been hunting through the examples and the documentation and haven't stumbled on the appropriate magic yet.

Any tips or pointers or nudges for an openlayers newbie?

Thanks,

Curt.
--
Curtis Olson:
http://www.atiak.com - http://aem.umn.edu/~uav/ <http://aem.umn.edu/%7Euav/>
http://www.flightgear.org - http://gallinazo.flightgear.org



_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to