This is a slightly revised version of the Cluster Example provided here.
A couple of things I added:
- Works off a URL instead of a data option, like a FeatureLayer.
- Option to add a Font for the Clusters TextSymbol. Default is
10pt
andArial
. - A
zoomOnClick
option that will zoom the map 1 zoom level on the clicked cluster graphic. - Has an
outFields
option for the Features returned.
Although this behaves similar to a FeatureLayer, it does not have all the
optimizations of a FeatureLayer. There is no Vector Tiling for the points. A possible optimization could be to break up the request by
I added the ability to send requests by objectIds
in to multiple queries.objectIds
in chunks of 1000 by default. Can be set in options. I also added a cache for clustered graphics and a clearCache()
method.
A demo can be seen here.