[OpenLayers-Users] Feature dot disappears after moving it a few times
Vasco Correia
v.j.corr at gmail.com
Sun Oct 7 22:51:07 PDT 2012
Hi,
I'm trying to move a point on a vector layer by changing its location every
few seconds and redrawing the layer. This works for a few times, but then
the dot disappears - it's not off the map (it's only going around a few
blocks) and even the getVisibility() and onScreen() return true - it just
doesn't show on screen. Sometimes it will reappear after being invisible
for a few position "jumps". Zoom level seems to affect the behavior - the
dot disappears more easily if I zoom in very close.
I've added zIndex:9999 to the StyleMap, but that didn't change the behavior.
Basically I have a "feature_point" variable (OpenLayers.Geometry.Point) and
this is how I change it's place ("position" comes from an array of
coordinates, should eventually be real location data from a device)
feature_point.geometry.x = position.lon;
feature_point.geometry.y = position.lat;
vector_layer.redraw();
This is run in a function called by setInterval()
Why does it disappear?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121008/5cf84ec2/attachment.html>
More information about the Users
mailing list