[OpenLayers-Users] Cluster strategy not working

Jerome Freyre jerome.freyre at hispeed.ch
Fri Aug 28 08:10:45 EDT 2009


Can you also show us your method that parse and add the feature to the  
layer?

I think another good way to explore is to use firefox and firebug.

With firebug, you can add breakpoints and the go step-by-step...


Whith that, you should put a breakpoint into your method that parse  
and add features to layer and another one into the cluster strategy  
(Think to not use the OpenLayers minimised but the complete source) to  
see if software run into the class correctly...


Hope my english is quite understandable.... :)



Jérome



Le 28 août 09 à 14:01, Max Stephan (via Nabble) a écrit :

> Hi Jerome,
>
> thanks for your reply. I already tried that but it causes an error  
> ("this.layer.events" is null or no object) and the map content isn 
> ´t shown.
>
> Any other ideas?
>
> Greets,
> Max Stephan
> Jerome Freyre wrote:
> Hi Max,
>
> Personnally, when I use Cluster Strategy, I create separatly the  
> strategy and the I activate it.
>
> 		
> 			var strat = new OpenLayers.Strategy.Cluster({distance:20});
> 			vectorLayer = new OpenLayers.Layer.Vector("Vektorlayer",{
> 			strategies: [
> 				strategy
> 			],
> 			styleMap: vectorStyle2, maxResolution: 19});
> 			strat.activate();
>
>
> Hope it will be usefull....
>
> Sincerly,
> Jérome
>
> Max Stephan wrote:
> Hi everybody,
>
> I`m having problems getting the cluster strategy to work. It simply  
> makes no difference in terms of appearance if I add it to the  
> VectorLayer or not.
>
> This is my code for the layer:
> 		vectorLayer = new OpenLayers.Layer.Vector("Vektorlayer",{
> 			strategies: [
> 				new OpenLayers.Strategy.Cluster({distance:20})
> 			],
> 			styleMap: vectorStyle2, maxResolution: 19});
>
>
> The reason why I want to add it is that I have 480 Features  
> alltogether on my map and even when zooming into some areas there  
> are still around 150 features left in the bbox causing  
> InternetExplorer to slow down (don´t know if it´s the same case  
> with Firefox, but I gotta use IE to use ADODB-Connection to an  
> Access Database in the Intranet).
>
> Those features are created and added step by step with an addVector- 
> method I have implemented that reads out the coordinates and  
> attributes of the database for a single feature and then jumps to  
> the next entry and repeats the procedure till all features have been  
> added.
>
> greets and thx in advance
> Max Stephan
>
>
> View message @ http://n2.nabble.com/Cluster-strategy-not-working-tp3533851p3534202.html
> To unsubscribe from Re: Cluster strategy not working, click here.
>


-- 
View this message in context: http://n2.nabble.com/Cluster-strategy-not-working-tp3533851p3534250.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090828/241fe674/attachment.html


More information about the Users mailing list