Can you have a layer's symbology automatically change when you switch basemaps in your web app?

750
2
Jump to solution
12-09-2019 10:32 AM
JessicaSmith1986
New Contributor II

   I created a web app where the default basemap is ESRI's topographic map, which is mostly light colored, so I draw the main layer using a darker color.  When I switch the basemap to imagery, it doesn't show up as well. I'd rather not switch to a color that shows up well on both just because the original color I picked matches so well with the theme of the map.  So is there a way to configure the app so that when you switch basemaps, the symbology of the layer in question would automatically change to a color that is easy to see on imagery? 

Jessica Smith
Humboldt County Assessor's Office
Winnemucca, NV
0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

Which web app are you using? We don't currently have this capability in the configurable apps but it is something we are talking about. If you know JavaScript (or are interested in learning a bit) you could download the app you are using, host it locally on your own web server and make an update to the app to support this behavior.  The 4.x version of the ArcGIS API for JavasScript has a method getBackgroundColorTheme that determines the basemap background and you could use this to check the current basemap and have a light/dark symbology defined. 

colorUtils | ArcGIS API for JavaScript 4.13 

View solution in original post

2 Replies
KellyHutchins
Esri Frequent Contributor

Which web app are you using? We don't currently have this capability in the configurable apps but it is something we are talking about. If you know JavaScript (or are interested in learning a bit) you could download the app you are using, host it locally on your own web server and make an update to the app to support this behavior.  The 4.x version of the ArcGIS API for JavasScript has a method getBackgroundColorTheme that determines the basemap background and you could use this to check the current basemap and have a light/dark symbology defined. 

colorUtils | ArcGIS API for JavaScript 4.13 

JessicaSmith1986
New Contributor II

I used the launchpad theme in Web AppBuilder, which was able to accommodate every other idea I had except for this.  If this capability ever does get incorporated into the configurable apps, that would be great!  JavaScript isn't quite in my wheelhouse yet, but I'll keep that in mind.  Thank you for your help! 

Jessica Smith
Humboldt County Assessor's Office
Winnemucca, NV
0 Kudos