[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 18:49:44 EDT 2009
These browser nowadays pretty good at handling bigger DOM. As recommended in
http://trac.openlayers.org/wiki/FrequentlyAskedQuestions, you should keep
~100-200 Features in vector layer. marker.moveTo() for number of markers
within 100-200 should be OK.
>> this looks pretty easy, but for few number of markers, what if I have
more than one won't that be very consuming to the resources?!
from what I understand I will have to keep a reference of all markers used.
On Sat, Oct 31, 2009 at 4:43 AM, helmi <helmi03 at gmail.com> wrote:
> 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/5035f59a/attachment.html
More information about the Users
mailing list