Skip to content

CandoImage/OL3ClusterSpiderfier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Cluster Spiderfier for Openlayers 3

Initial Developers:

Inspired by https://github.com/alrocar/OLSpiderfy

How it works

The interaction will listen to events on sources which are instances of ol.source.Cluster and show each feature of the e.g. clicked cluster around the clustered feature.

Usage

Simply add the plugin as interaction:

var map = new ol.Map({
  layers: [raster, clusters],
  renderer: 'canvas',
  interactions: ol.interaction.defaults().extend([new ol.interaction.ClusterSpiderfier()]),
  target: 'map',
  view: new ol.View({
    center: [0, 0],
    zoom: 2
  })
});

Options

  • displayGeometry: The geometry type to use for drawing the opening display: circle or spiral. Default: circle
  • radius: The radius to use when drawing the opening geometry. Default: 50

Properties

When accessing a spiderfied feature you can access the layer the spider originates from using the property originLayer. Example:

feature.get('originLayer')

About

OL3ClusterSpiderfier POC

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published