0

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(); 
 pointSymbol.setStyle(SimpleMarkerSymbol.STYLE_CIRCLE);
 pointSymbol.setSize(12);
 var pointInfoTemplate = new InfoTemplate(); 
 pointInfoTemplate.setTitle("Project Details");
 pointInfoTemplate.setContent('//JSON Data');
 var pointGraphic = new Graphic(point, pointSymbol).setInfoTemplate(pointInfoTemplate);
 points.push(pointGraphic);
}
for (i = 0; i < points.length; ++i) {
 map.graphics.add(points[i]);
}
});`

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

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Aug 27, 2015 at 8:40

1 Answer 1

1

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.

answered Sep 1, 2015 at 14:03

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.