Skip to content
Advertisement

create a map point for each member of an array js ArcGIS API

I’ve created an array of volcanoes with latitudes and longitudes from a geoJSON file. I would like to see if its possible to create a loop which iterates through the array to create points with the values.

Previously when I have attempted this I am presented with an empty map if it even loads.

My array is created such as var div = document.getElementById(‘divholder’);

JavaScript

I’m looking to produce a variable like this

JavaScript

When attempting this without a for loop my plots do not point. Is there some issue with the values? or can they not be used with a map

Thanks!

Advertisement

Answer

I was able to create a simple for loop which has now plotted all of the volcanoes. The map code looks like this.

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement