[OpenLayers-Users] changing style of a WFS layer

Lehtonen, Mika mika at digikartta.net
Tue Nov 25 11:36:46 EST 2008


Hi Ivan,
you might be right. My application "feels" faster after I tried your 
approach. Actually I also discovered something I did wrong in my own 
experiments.
So I thank you all.

- mika -

Ivan Grcic kirjoitti:
> Hi all,
>
> On Tue, Nov 25, 2008 at 4:50 PM, Christopher Schmidt
> <crschmidt at metacarta.com> wrote:
>   
>> On Tue, Nov 25, 2008 at 10:46:32AM -0500, Alexandre Dube wrote:
>>     
>>> I'm glad it worked.  But to my eyes there seems to be a flaw in this
>>> solution : performance.  In the example I gave you, there was a need of
>>> calculating the radius for each features because of the cluster
>>> strategy.  But for you, triggering map.getZoom() for each features that
>>> will end up being all at the same size is pretty useless.
>>>       
>> map.getZoom() is just a property access. There's no significant speed
>> penalty to using it multiple times like this.
>>
>>     
> I wouldnt agree with this. I did same thin few weeks ago, and i have
> to say it was slowing things down pretty much. Instead calling it
> every time, you can just do this:
>
> map.events.register('zoomend', map, function(e){
> 			zoomLevel = map.getZoom()+2;
>         });
>
> where zoomLevel is global variable. Then you just use it inside context:
> ...
>            context: {
>            radius: function() {
>                        return  zoomLevel ;
>                         }
>                  }
>            });
> ...
>
> I think you have to register zoomend event before adding a layer (not
> sure bout that)
> Cheers, Ivan
>
>   
>> Regards,
>> --
>> Christopher Schmidt
>> MetaCarta
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>>     
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>   



More information about the Users mailing list