[OpenLayers-Users] Cluster strategy not working

Max Stephan x.zam at gmx.net
Fri Aug 28 08:01:53 EDT 2009


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 this message in context: http://n2.nabble.com/Cluster-strategy-not-working-tp3533851p3534202.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list