AnsweredAssumed Answered

How to Point Cluster With Dynamic Data In ArcGIS API

Question asked by BEHSEINI on Aug 27, 2015

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]);
    }
    });`

 

Can you please let me know how I can bind this points with Cluster Points in ArcGIS API sample?

Thanks

Outcomes