[OpenLayers-Users] Cluster strategy on markers

Joao Duarte joao.c.duarte at co.sapo.pt
Mon Dec 22 09:59:35 EST 2008


Hi,

Thanks all for the fast replies!

I tried you suggestion of using Vector layers to display markers and it
worked perfectly. Also the shadows are great. After having all of my markers
on a Vector layer, the Cluster strategy worked.

Thanks again.

Regards,
Joao Duarte
http://mapas.sapo.pt

-----Original Message-----
From: Ivan Grcic [mailto:igrcic at gmail.com] 
Sent: segunda-feira, 22 de Dezembro de 2008 08:07
To: Roald de Wit
Cc: Joao Duarte; users at openlayers.org
Subject: Re: [OpenLayers-Users] Cluster strategy on markers

Hi...so you just use vector layer with points that represents
markers...i think this might be usefull to you:

var style= new OpenLayers.Style({
		externalGraphic: "${getIcon}",
                graphicWidth:"${getSize}",
		graphicHeight:"${getSize}",
		graphicOpacity:0.90,
		cursor:'pointer'
               ...
               ...
     }, {
        context: {
          getSize: function(feature) {
			return __getClusterIconSize(feature);
        },
		  getIcon: function(feature){
			return __getClusterIcon(feature);
		}
		}
     });

cheers!

On Mon, Dec 22, 2008 at 2:31 AM, Roald de Wit <roald.dewit at lisasoft.com>
wrote:
> Hi Joao,
>
> The simple answer is: don't use the Markers layer any more. It is sort
> of deprecated and using the Vector layer instead is advisable.
> Do you know you can use icons for displaying your points? From OL 2.7
> onwards you can even use some fancy shadows, see [1].
>
> Cheers, Roald
>
> [1] http://openlayers.org/dev/examples/marker-shadow.html
>
> On Sat, 2008-12-20 at 05:04 +1030, Joao Duarte wrote:
>> Hi,
>>
>>
>>
>> It seems I've been spamming the list. I'm sorry about that but there
>> were some problems with my mail server.
>>
>>
>>
>> I have a doubt about clustering. Is there any form of having marker
>> clustering. I've successful used the cluster strategy on Vector type
>> layers but that strategt can't be applied to Marker Layers right? Is
>> there any workaround for this?
>>
>>
>>
>> Thanks.
>>
>>
>>
>> Regards,
>>
>>
>>
>> João Duarte
>>
>> http://mapas.sapo.pt
>>
>>
> --
> Roald de Wit
> Software Engineer
> roald.dewit at lisasoft.com
>
> Commercial Support for Open Source GIS Software
> http://lisasoft.com/LISAsoft/SupportedProducts/
>
>
> The contents of this email are confidential and may be subject to legal or
professional privilege and copyright. No representation is made that this
email is free of viruses or other defects. If you have received this
communication in error, you may not copy or distribute any part of it or
otherwise disclose its contents to anyone. Please advise the sender of your
incorrect receipt of this correspondence.
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



-- 
Ivan Grcic




More information about the Users mailing list