Select to view content in your preferred language

Best practice for multiple FeatureLayer URLs

354
4
06-27-2023 10:30 AM
Paco
by
Occasional Contributor

Hello all.    I have a situation where I want to add 'basemap' trails to a Webapp.  however,  it looks like there is no existing compilation of the multitude of trails,  only individually Hosted feature services for each trail.

I'm assuming there is no way to include a list/array of service URLs to one new FeatureLayer variable?

or is there a practice of creating a separate JS file listing the multitude of service URLs then Source that file?

I would merge the published trail Features myself and host them in AGOL as one Service,  but I cannot download the Service features locally.

thanks!

0 Kudos
4 Replies
JoelBennett
MVP Regular Contributor

Have you considered the GroupLayer type?  It might be a viable solution for what you're trying to accomplish.

Paco
by
Occasional Contributor

Thanks for the reply Joel.   this certainly looks more like the 'grouping' I'm looking for. 

 the biggest reason for this effort would be to simplify my main.JS script, and list all the multiple Services in an external JS file.   i've made a few attempts and have run into the FeatureLayer not being defined.  I think im missing a few simple things,   but wanted to clarify my reasoning - a cleaner main.js file.

any more support ideas welcomed!  thx

0 Kudos
TonyContreras_Frisco_TX
Occasional Contributor III

If the layers you want to use do not change frequently, you could use the Merge Layers tool in AGO. This tool consumes credits and the output will count for data storing credit usage. 

Another option is to use this article to add all the services to a map and try moving them all to the Basemap.

Paco
by
Occasional Contributor

Thanks Tony.   they are actually not our Services,  so sadly I wouldn't trust the external source to keep the URLs the same over time.   I suppose that is an issue with any outside source data Services.   thx

0 Kudos