I have a .json objects array with data that I want to use in my webmap. What is the best option to add this data (<3000 points) to the map? Should I use a GraphicsLayer object inside which I'll be adding each point as a Graphic with point geometry to? Should I use a FeatureLayer? Are there any examples in the ArcGIS JS docs that someone could point me to?
As it is now, I can add point graphics individually to a Graphic object and then add to a GraphicsLayer using layer.graphics.add(newGraphic). But how can I do this on the fly as the map is receiving data from the json?
Thanks in advance!
Solved! Go to Solution.
Thank you for your reply, Egge-Jan. The data is not in GeoJSON. However, I think converting it to GeoJSON may be my best option, since a simple graphics layer may not scale well up to 3000 points.
What I'm really doing here is fetching data from a Postgres database, returned as a .json object. To use GeoJSON, looks like I'll need to convert the .json to a GeoJSON file and then use it.
Also, what are the limitations of a GeoJSON? Can it hold 3,000 individual records (keys) with 50 values each? So one individual element would have 50 values. I'll be doing some research on this...
I had graphic layer with over 5k points and works fine however if it is easy enough for you to convert it to GeoJSON, that would probably be better practice and will make your life easier in the future to maintain