Hello
Is it possible to change the URL property of a GeoJSONLayer and .refresh(), so that it fetches a new set of data, overwrites the previous one and displays it on the map?
I need a different URL, not just a different query string, which I know it is possible by using .createQuery() .queryFeatures().
Thanks
Solved! Go to Solution.
Hi there,
This cannot be done and goes for all layers. You'd have to create a new instance of GeoJSONLayer for each unique URLs.
Hi there,
This cannot be done and goes for all layers. You'd have to create a new instance of GeoJSONLayer for each unique URLs.
I know this is an old post, but in case anyone comes across this, yes this is possible. I wrote a LinkedIn article on this a while ago: https://www.linkedin.com/pulse/how-load-geojson-from-postgres-using-bounding-box-arcgis-donoghue - how to load GeoJSON using a bounding box. You shouldn't change the URL, you should just change the query string parameters using the custom parameters for the layer. If you really do have different URLs and cannot change them, then you can set up a service that handles the different URLs, and then use that service URL in your app. I occasionally do this when I need to integrate non-ArcGIS systems with ArcGIS Enterprise or ArcGIS Online.