[OpenLayers-Users] Vector Feature Clustering

Alexandre Dube adube at mapgears.com
Tue Jun 14 13:04:16 EDT 2011


Hello,

   You could compare your code with one of the cluster examples.  That 
could help you find out what the issue is.
http://openlayers.org/dev/examples/?q=cluster

   If that doesn't help, reading this could :
http://docs.openlayers.org/help/minimize.html

Kind regards,

Alexandre


On 11-06-14 11:53 AM, shitake83 wrote:
> Hi guys.
>
> Im really struggling to get the cluster feature to work.
>
> This is how my layer is defined :
> I have a map with 300+ Vector Markers, some of the Markers are at the same
> spot (such as Hospitals with multilple Doctors - which is not so unlikely
> ).
> So I want to be able to have my Features clustered.
>
> vectorLayer = new OpenLayers.Layer.Vector("Markers Layer",{
> 		styleMap: new OpenLayers.StyleMap(
> 			{"default": new OpenLayers.Style(OpenLayers.Util.applyDefaults({
> 				        externalGraphic:
> "http://openlayers.org/dev/img/marker-green.png",
> 					graphicOpacity: 1,
> 					rotation: 0,
> 					pointRadius: 10},
>
> OpenLayers.Feature.Vector.style["default"])),
> 					"select": new OpenLayers.Style({
> 						externalGraphic: "http://openlayers.org/dev/img/marker-blue.png"})
> 				})
> 			});
>
> var strategy = new OpenLayers.Strategy.Cluster({distance: 15, threshold:
> 3});
>
> Whenever i add the "strategy" to the layer definition, the map stops
> showing.
> It may seem very easy to complete this task. But ive been struggling over a
> week now, eventhough there are some examples (which i dont fully
> understand).
>
> If im missing something along the way, feel free to point me into the right
> direction.
> All help is appreciated. Thanks.
>
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/Vector-Feature-Clustering-tp6474651p6474651.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users


-- 
Alexandre Dubé
Mapgears
www.mapgears.com



More information about the Users mailing list