Refer this http://openlayers.org/pipermail/users/2009-June/012274.html
My example code:
function setLonLat(marker, lonlat) {
var newPx = map.getLayerPxFromLonLat(newLonLat);
marker.moveTo(newPx);
}
var marker = new OpenLayers.Marker(new OpenLayers.LonLat(102.2168, 3.09185),
new OpenLayers.Icon());
var markers = new OpenLayers.Layer.Markers( "Markers" );
markers.addMarker(marker);
map.addLayer(markers);
// To move the marker
var newLonLat = new OpenLayers.LonLat(102.1399, 5.72857);
setLonLat(marker, newLonLat);
>> I mean I wanted to build an apoplication that uploads my current position
like every 5 mins or so, is this the best way to do it?
On Fri, Oct 30, 2009 at 5:39 AM, Hany Harraz <[email protected]> wrote:
> Hi All,
> I'm thinking of building a website that has openstreetmaps integrated to
> it, I need to show my position on the map each time I send my coordinates
> from my mobile, is there a way to show this without refreshing the page?
> like adding a layer that shows a pointer to some coordinates and can be
> refreshed without refreshing the whole page or map?
>
> --
> With best Regards
> Hany Harraz
>
> _______________________________________________
> Users mailing list
> [email protected]
> http://openlayers.org/mailman/listinfo/users
>
>
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users