AW: [OpenLayers-Users] How to make Openlayers to request the vector data every manipulation of map

Bartłomiej Burkot pomiarowiec10 at poczta.onet.pl
Fri Mar 9 02:42:52 EST 2012


Perfectly Arnd

why couldn't I find this option in official apidoc?
http://dev.openlayers.org/releases/OpenLayers-2.11/doc/apidocs/files/OpenLayers/Strategy/BBOX-js.html
http://dev.openlayers.org/docs/files/OpenLayers/Strategy/BBOX-js.html#OpenLayers.Strategy.BBOX.resFactor
Why is difference between this docs?

Bartek


> maybe adding the param resFactor to the BBOX.Strategy will solve your 
> problem.
> strategies: [new OpenLayers.Strategy.BBOX({ratio: 1.1, resFactor:1})],
> Arnd
>
> ------------------------------------------------------------------------
> *Von:* openlayers-users-bounces at lists.osgeo.org 
> [mailto:openlayers-users-bounces at lists.osgeo.org] *Im Auftrag von 
> *Bartlomiej Burkot
> *Gesendet:* Donnerstag, 8. März 2012 16:57
> *An:* openlayers-users at lists.osgeo.org
> *Betreff:* [OpenLayers-Users] How to make Openlayers to request the 
> vector data every manipulation of map
>
> Hello,
>
> I think I have exactly the same problem. I have vector layer with many 
> points-markers. I need to limit the number of fetched points from 
> server becouse of performance.
> The vectorlayer use bbox strategy and protocol HTTP:
>
> weather_points_layer = new OpenLayers.Layer.Vector("Wetterpunkte", {
>
>                 strategies: [new OpenLayers.Strategy.BBOX({ratio: 1.1})],
>
>                 protocol: new OpenLayers.Protocol.HTTP({
>                     url: "text_layer_generator/weather_points.php"
>                 ..
>                 })
>             });
>
> The script: weather_points.php limits the number of points using bbox 
> parameter and LIMIT statement in sql query.
> There is the working example: http://mapakrakow.pl/pogoda/test.php
> When I zoomin the points are not fetched from server but from browser 
> cache. Problem is that when you zoomin to - for example  Berlin - you 
> don't see any points. There is not any request in firebug fetching the 
> data.
>
> Running this command:
> weather_points_layer.refresh({force:true});
> in firebug console Openlayers requests and refreshes the data from 
> server correctly and shows points over Berlin.
> I tryed to change cache-control headers in weather_points.php:
>
> #header("Cache-Control: max-age=2"); // HTTP/1.1
> #header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
> #header("Pragma: Cache"); // required
> //header("connection: close");
> //Keep-Alive    timeout=2, max=100
>
> and add the refresh strategy:
> strategies: [new OpenLayers.Strategy.BBOX({ratio: 1.1}), new 
> OpenLayers.Strategy.Refresh()],
>
> but both didn't helped.
> I fond this article: 
> http://stackoverflow.com/questions/2995238/how-to-refresh-reload-a-kml-layer-in-openlayers-dynamic-kml-layer
> But I don't need to refresh vectorlayer in constant time interval but 
> every time when user manipulates the map.
>
> Has someone experience how to solve this problem?
> Thanks for your help.
>
> Bartlomiej Burkot
>
>
> W dniu 2012-03-07 16:56, Jan Hartmann pisze:
>> No, it tried that. According to the documentation, the redraw 
>> function does not take a parameter.
>>
>> Jan
>>
>> On 03/07/2012 04:45 PM, Steve.Toutant at inspq.qc.ca wrote:
>>>
>>> Is this working?
>>> vectorLayer.redraw(true);
>>>
>>>
>>>
>>>
>>> *Jan Hartmann <j.l.h.hartmann at uva.nl>@lists.osgeo.org*
>>> Envoyé par : openlayers-users-bounces at lists.osgeo.org
>>>
>>> 2012-03-07 10:27
>>>
>>> 	
>>> A
>>> 	openlayers-users at lists.osgeo.org
>>> cc
>>> 	
>>> Objet
>>> 	[Polluriel potentiel]  [OpenLayers-Users] force update markers layer
>>>
>>>
>>>
>>> 	
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> 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?
>>>
>>> Jan_______________________________________________
>>> Users mailing list
>>> Users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>>
>>>
>>>
>>
>>
>> _______________________________________________
>> 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/20120309/5d12b23f/attachment-0001.html


More information about the Users mailing list