[OpenLayers-Users] force update markers layer

Bartłomiej Burkot pomiarowiec10 at poczta.onet.pl
Mon Mar 12 11:49:59 EDT 2012


Hello Jan,

I think you have the same problem as my. Just add "resFactor to the BBOX.Strategy".
http://dev.openlayers.org/docs/files/OpenLayers/Strategy/BBOX-js.html#OpenLayers.Strategy.BBOX.resFactor
Try using something like:

new OpenLayers.Layer.Vector("Punkte", {
	strategies: [new OpenLayers.Strategy.BBOX({resFactor:1})],
	protocol: new OpenLayers.Protocol.HTTP({
		url: "text_layer_generator/points.php",
		format: new OpenLayers.Format.Text({
			extractStyles:false
		})
	})
});

I hope it helps.

Bartek



W dniu 2012-03-09 22:25, Jan Hartmann pisze:
> I tried Layer.Markers.redraw(), but thet didn't solve the problem: the 
> markers only moved to their new position,when their lonlats had been 
> changed, after an addition zoomin or zoomout. In your map the markers 
> always remain on the same spot.
>
> Cheers,
>
> Jan
>
> On 03/08/2012 07:55 PM, Jürgen Dankoweit wrote:
>> Hello Jan,
>>
>> Am 08.03.2012 16:43, schrieb Jan Hartmann:
>>> Well, first removing and then adding all markers from the markers layer
>>> will force the update. Not elegant, but it works.
>>>
>>> Jan
>>>
>>> On 03/07/2012 04:27 PM, Jan Hartmann wrote:
>>>> Hi,
>>>>
>>>> How do I force a redraw on a markers layer? I have a regular WMS map
>>>> with markers that have their lonlat-values updated from a database. I
>>>> can force a redraw of the WMS layer with mergenewparams(), but that is
>>>> not possible with the markers layer. That means that the when the
>>>> lonlat values are updated and I move the map, the markers remain in
>>>> their original positions. Only when I zoom in or out, the marker
>>>> positions are updated. Can I do something about that?
>> What about calling layer.redraw();
>> For my weather site I had to solve the same problem. The solution was
>> calling the redraw methode of the markers layer.
>> Look herehttp://www.dankoweit.de/cgi-bin/metar_karte.pl?1  and at the
>> source code of the page.
>>
>> Juergen
>>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120312/e70d9e3b/attachment-0001.html


More information about the Users mailing list