[OSM-dev] On Zoom out markers should get combine.

Pierre Béland pierzenh at yahoo.fr
Tue May 20 13:35:28 UTC 2014


There are various OpenLayer classes to add markers over the map. The Vector class is more recent and more flexible then the Marker class.  You should find cluster openlayers cluster examples on internet. searching for openlayers osgeo stylemap strategy cluster  new OpenLayers.Strategy

There is also a discussion group for OpenLayers users at http://lists.osgeo.org/pipermail/openlayers-users where you should find better answers related to OpenLayers.

These examples should show you how to define a strategy with a particular function to control the styleMap. You can for example group specifiying a distance. You can control the size of the marker based on the number of points. You can also replace with various icons.

See for example this discussion : http://www.feedpopular.com/openlayers-cluster-strategy-different-styles.html
and this presentation http://presentations.opengeo.org/2009_FOSS4G/ol_vector_mayhem.pdf


 De : Hardik Pancholi <hardik.pancholi at gatewaytechnolabs.com>
À : Yves <yvecai at gmail.com>; dev at openstreetmap.org 
Envoyé le : Mardi 20 mai 2014 2h48
Objet : Re: [OSM-dev] On Zoom out markers should get combine.


Thanks for early reply. I checked the examples of clustering markers. 

Cluster strategy threshold is the example what I want. But I am confused with use of vector layer. Here Points are used from vector layer class. In my example I am using  OpenLayers.Layer.Markers("Markers"). Multiple markers are there on map and I want to combine them same as in cluster example. I also want to change the color of markers and want to show the count of markers on marker icon. 

In clustering example I am getting the number of markers at point, but it is when I do mouse over on it. I want the count when I do Zoom In or Zoom out.

Hardik Pancholi

>From: Yves [mailto:yvecai at gmail.com]
>To: Hardik Pancholi [mailto:hardik.pancholi at gatewaytechnolabs.com], dev at openstreetmap.org
>Sent: Fri, 16 May 2014 16:54:12 +0000
>Subject: Re: [OSM-dev] On Zoom out markers should get combine.
>Whatever lib you use for your map, the word you are looking for is 'cluster', like in 'clustering markers'.
>On 16 mai 2014 16:20:23 UTC+02:00, Hardik Pancholi <hardik.pancholi at gatewaytechnolabs.com> wrote:
>>I am facing one problem while showing multiple markers on map. When there are multiple markers at nearest location then it looks really messy. 
>>I want to show nearest markers as single marker and also want to show the number on that single maker, so I can know how many points are there.  This should done on basis of zoom level. 
>>If I do zoom in then number of nearest markers count should decrease. On maximum zoom out number of nearest points should increase and it should be visible as single marker with count on marker.
>>Hardik Pancholi 
>>dev mailing list
>>dev at openstreetmap.org
>Envoyé de mon téléphone Android avec K-9 Mail. Excusez la brièveté. 

dev mailing list
dev at openstreetmap.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20140520/85d4989c/attachment.html>

More information about the dev mailing list