[OpenLayers-Users] Layer.Vector with multiple data sources

Alexandre Dube adube at mapgears.com
Fri Jan 9 08:37:27 EST 2009


I just read an other interesting thread Andreas Hocevar posted :
<<

You can make the BBOX strategy aggressive by instantiating your BBOX
strategy like this:

new OpenLayers.Strategy.BBOX(invalidBounds: function(){return true;});

This will cause features to be fetched also if you zoom in.

 >>

  That's a behavior I should keep in mind while creating the separate 
strategy, but I'm not sure about one thing : would the new strategy 
require a BBOX or Fixed one ?  The main idea of the custom strategy is 
to change the params of the layer while zooming and depending on the 
zoom level, but while we zoom in, the layer doesn't fetch new features 
by default, it keeps old ones.  So the above Andreas idea could do the 
trick, but it's applied to the BBOX strategy.

  So my final question is : should I have in mind that my custom 
strategy would be dependent ?

  Thanks,

Alexandre

Eric Lemoine wrote:
> Yeah I agree, the re-configuration of the protocol could go in a
> separate, custom strategy.
>
> Cheers,
>
> Eric
>
> 2009/1/8, Andreas Hocevar <ahocevar at opengeo.org>:
>   
>> On Thu, Jan 8, 2009 at 6:42 PM, Alexandre Dube <adube at mapgears.com> wrote:
>>     
>>> Andreas Hocevar wrote:
>>>       
>>>> Alexandre Dube wrote:
>>>> It should be easy to customize the strategy you are using (I assume
>>>> Fixed or BBOX) to change the url and/or params of the protocol on the
>>>> zoomend event (similar to the moveend event handler in the BBOX
>>>> strategy). This strategy would then have to know the urls/params for
>>>> each zoom level, and you would just interact with one vector layer.
>>>>
>>>>         
>>> Exactly.  It's a common practice on the web to have data normalized by
>>> scales, so it would be quite useful to have such an upgrade.
>>>
>>> So, you would modify both BBOX and Fixed ?  Do others have opinions
>>> about it ?
>>>       
>> No, I'd encourage you to do this on the application level because it
>> is less than 10 lines of code. If this is to become part of
>> OpenLayers, it should be a separate strategy (a layer can have
>> multiple strategies).
>>
>> Regards,
>> Andreas.
>>
>> --
>> Andreas Hocevar
>> OpenGeo - http://opengeo.org/
>> Expert service straight from the developers.
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>>     


-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the Users mailing list