Your coordinates appear to be hardcoded into the HTML. If you want the location to change you will need to pull the coordinates in through the server itself through a WFS or some other server based layer.<br clear="all">--<br>
Nathan Gerber<br>
<br><br><div class="gmail_quote">On Mon, Jan 25, 2010 at 5:05 PM,  <span dir="ltr">&lt;<a href="mailto:jbloc1878@googlemail.com">jbloc1878@googlemail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#FFFFFF"><div></div><div><span style="font-size: 13px;">Hi,   i am currently using OS Open Space which i believe is similer to Open Layers.<br><br>I am currenty displaying a map with a marker. However my marker coordinates can change whilst the user is viewing the map so i would like the Marker code to refresh and re-plot the marker every 10 seconds however i cannot work out how to do this. I have tried adding aHTML refresh command &lt;meta http-equiv=&quot;refresh&quot; content=&quot;10&quot;&gt; causes the whole map to refresh.<br>
<br>I tried creating a refresh function that calls the marker function i created that plots the marker as shown below. however the marker looks like it refreshes as the marker flashes every 10 seconds however it does not replot if the coordinates if they have changed. Does anyone have any suggestions for refreshing a function within javascript?<br>
<br>Thanks for any help in advance my code is below<br><br><br>&lt;script type=&quot;text/javascript&quot;&gt;<br><br>var osMap;<br><br>function init()<br>{<br>osMap = new OpenSpace.Map(&#39;map&#39;);<br><br>osMap.setCenter(new OpenSpace.MapPoint(439300, 114760), 8);<br>
<br>}<br><br>function refresh()<br><br>{<br><br>setInterval(&#39;marker()&#39;, 10000);<br><br>}<br><br>function marker()<br>{<br><br>var markers = new OpenLayers.Layer.Markers(&quot;Markers&quot;);<br>osMap.addLayer(markers);<br>
<br>// Default icon<br>var pos = new OpenSpace.MapPoint(438760, 114760);<br>var marker = new OpenLayers.Marker(pos);<br><br>markers.addMarker(marker);<br>}<br><br>&lt;/script&gt;<br>&lt;/head&gt;<br>&lt;body onload=&quot;init(); refresh()&quot;&gt;<br>
<br>Thanks for any help in advance</span><br><br><br></div></div><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
<br></blockquote></div><br>