I have a JS code like this which I have assigned an anonymous function to photos
variable in map.on("load", function() {}
now it seems the photos
is never invoking! as even I tried to do a simple console.log("Is This working")
it is not loading the log!
I am using the second function instead of ESRI's builtin esriRequest();
since the native function is already taking URL
to read JSON file from server but I am making points dynamically on fly. so I tough I must use mu own function here.
var photos;
map.on("load", function() {
domStyle.set(query("a.action.zoomTo")[0], "display", "none");
photos = function(){
for (var i = 0; i < projects.length; i++) {
var point = new Point(projects[i].Longitude, projects[i].Latitude);
var pointSymbol = new SimpleMarkerSymbol();
pointSymbol.setStyle(SimpleMarkerSymbol.STYLE_CIRCLE);
pointSymbol.setSize(9);
var pointInfoTemplate = new InfoTemplate();
pointInfoTemplate.setTitle("Project Details");
pointInfoTemplate.setContent(' ');
var pointGraphic = new Graphic(point, pointSymbol).setInfoTemplate(pointInfoTemplate);
points.push(pointGraphic);
}
for (i = 0; i < points.length; ++i) {
map.graphics.add(points[i]);
}
console.log(points);
};
photos.then(addClusters, error);
});
Can you please let me know why this is not working?