Problem to set map in centre

I want to use OSM in my project.
After display OSM and pointer on particular area. I need to call that function on particular time refresh so that
pointer(image) could change according to new lat,lon which comming from database. But when call this function browser scroll bar increase automaticaly on every refresh rate. and also pointer don’t set on given lat,lon.
Also I need to draw line on map so that user can see the route line.
Plz tell me from where I can get these functions and how to use them.

Could you show us an example, show us you page and code… And if you have questions on how to use openlayers, I’m sure there are a lot more experienced people over at

Mailing Lists:

IRC: irc://

Drawing a line on the map using OpenLayers can be done with vectors. Another way is to render a transparent image on the server containing the line and load that into the client.

To load new data in OpenLayers periodically (e.g. to update your current GPS position) can be done using JavaScript timers.

I suggest you take a look a the OpenLayers example and pick one that comes close to your needs to start with.

Problem to set map in centre I solved.
Next problem is that I want to draw line according to array of latitude,longitude.
So that I can show vehicle route e.g vehicle on which road going.

Here is an example using open layers to dynamically view OSM database contents.

It’s very well done.