dojo.declare('esri.ux.layers.ClusterLayer', esri.layers.GraphicsLayer, {
Got it to work to a degree:
used the following for esri.ux.layers.ClusterLayer-debug.js file.
define([
"dojo/_base/declare",
"esri/layers/GraphicsLayer",
"dojox/lang/functional",
"dojox/lang/functional/lambda",
"dojox/lang/functional/curry",
"dojox/lang/functional/fold"
], function (
declare, GraphicsLayer
) {
return declare([GraphicsLayer], {
constructor: function (options) {
... //rest of it like the esri.ux.layers.ClusterLayer-debug.js file
// sorry may not be allowed to post the rest of it due to company privacy
// please see below comments
});
});
Also at every "new esri.geometry.Point(...)" statement has to be converted to new esri.geometry.Point(..., this._map.spatialReference) where the spatial reference has to be specified, else it will default to 4326.
Also lot of the references to map was bombing out as null. I just replaced them with this._map which is being set in the constructor.
I was working on this today too. Looks like you got a lot further than this beginner (me) did.
I tried your solution and updated the index.html with
<script src="//js.arcgis.com/3.12/"></script>
and receive a mulitpleDefine error. any ideas?
I created an updated version of the ClusterLayer that works with services, similar to a FeatureLayer, but with same added sugar.
You can read more about it here.
Esri ClusterFeatureLayer - odoenet
Here is a GeoNet blog post here
The source code can be found here
Thank you. That provided me with enough info to get esri.ux.layers.ClusterLayer-debug.js working with the latest JS API.
I'm just tracking down one last issue with mouse over infoWindows
Scripts, which you posted is very good, but thay haven't "flare effect". I need this functionality together with the script above. I'm novice in JavaScript and I can't do it. Can you give me some advice or can you implement this functionality? I think that for someone who knows how it will be easy.
Someone put together a FlareClusterLayer that may be what you are looking for.
Rene,
The script, which you post is script for json data. Can you describe how can i change it for featurelayer?