AnsweredAssumed Answered

How to plot multiple points on a map?

Question asked by Marsharks on Nov 10, 2017
Latest reply on Nov 13, 2017 by Marsharks

I have tried to follow the example at


The first issue I have is that I am not using any URL to get my data.  I have a .cshtml page and my data is stored in my ViewBag, which I store in a script variable.



var data = [{"MAST_REL":"704834405041S00676","XCoordinate":-95.455847,"YCoordinate":29.912856},{"MAST_REL":"706050261041C40974","XCoordinate":-95.465469,"YCoordinate":30.074337}];



Secondly, I get an error message: Object doesn't support property or method 'then' which is thrown from the createGraphics method.  My abbreviated code:


view.then(function() {


.then(createLayer) // when graphics are created, create the layer




function createGraphics() {


// Create an array of Graphics from each GeoJSON feature

return, i) {

return {

geometry: new Point({

x: feature.XCoordinate,

y: feature.YCoordinate


// select only the attributes you care about

attributes: {

ObjectID: i,




//depth: feature.geometry.coordinates[2] + " km",












The last couple of issues.  I am not familiar with JavaScript nor the GIS ESRI Api.   Thanks.  Also, the "Source Code" button is not working or I don't know how to use that either. I'd think you would highlight the source code and select it.