I have a basemap layer that I published and placed on my application and this layer has a number of blank areas that shows up as white areas since the background of the layer itself is white.

Is there any way of changing this to a different color such as black?

I tried changing the data frame color before publishing the layer however this had no impact on the application itself.


Quite simple , Just Add a line of css in your webApp in which you change the background of the map div container :

if you're using js api 2.x-3.x :

#map_root {

if you're using js api 4.x :

.esri-view-root {
  • This did the trick thanks! As for some reason the color wasn't being changed for be in map initialization in the js file. – Maeglin77 Mar 10 '17 at 10:29

[api 4.x :] You can change the background basemap by finding the class containing the background and changing them in style or file css. I hope it helps you.

.esri-display-object{ background:#111; //background black }

  • 1
    This could be a valid answer, but it lacks any explanation, especially considering there's already an answer for the 4.x API and this is different (ie. why should this one be used instead?) – Evil Genius Jun 13 '18 at 11:30
  • 1
    agree that is could indeed be a correct and valid answer but there is little explanation as to what is going on – Sam Jun 13 '18 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.