ArcGIS API is using this Demo to illustrate how Point clustering works with JSON data. In my case I am generating some point graphics from MySQL Database by a jQuery AJAX request like following code: As you can see I am storing the data in project and then access to project.Longitude, project.Latitude to create the points

request.done(function( mapInfo) {
    for (var i = 0; i < mapInfo.length; i++) {
            var project = mapInfo[i];
            var point = new Point(project.Longitude, project.Latitude); 
            var pointSymbol = new SimpleMarkerSymbol(); 
            var pointInfoTemplate = new InfoTemplate(); 
            pointInfoTemplate.setTitle("Project Details");
            pointInfoTemplate.setContent('//JSON Data');
            var pointGraphic = new Graphic(point, pointSymbol).setInfoTemplate(pointInfoTemplate);
for (i = 0; i < points.length; ++i) {

How can I bind this points with Cluster Points in ArcGIS API sample?


In your example code you have lat and lon. In the sample that you linked to, in the function addClusters is where you can use that same lat/lon:

screenshot from https://developers.arcgis.com/javascript/jssamples/layers_point_clustering.html

So basically if you follow the sample, putting in your lat/lon in the place I highlighted above, it should work for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.