[OpenLayers-Users] how to update POIs or markers on open street maps without refreshing the whole map

helmi helmi03 at gmail.com
Fri Oct 30 16:43:51 EDT 2009


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 <h.harraz at gmail.com> 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
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091031/626c2dd5/attachment.html


More information about the Users mailing list