Select to view content in your preferred language

ArcGIS Javascript API change Home Button image

5615
4
Jump to solution
05-20-2015 10:34 AM
JosephRogan
Occasional Contributor

How can I change the image/icon of the HomeButton (and other) widgets easily using the ArcGIS Javascript API?  Do I need to need to follow something like the "Create a Re-usable Widget" guide, or is there an nice easy way to just specify my own image url?

Thanks!

1 Solution
4 Replies
JosephRogan
Occasional Contributor

Thanks!

0 Kudos
ChrisSergent
Deactivated User

If this worked for you I can mark Tim Witt's answer as correct. I don't know if you see that option since I created this group.

JosephRogan
Occasional Contributor

Yes, that helped.  In addition to the info in the links I also added some css, because by removing the span's text, there was essentially no element left to click on and trigger the action of the home button.  I had to make the span's text cover the entire button, not overflow, be transparent and not selectable. Actually there was a little more because I had to make the selectable text transparent as well since my work only uses ie9 and some of those items don't work.

.customButton span {

    color: rgba(0,0,0,0);

    line-height: 35px;

    display:block;

    overflow:hidden;

    -webkit-touch-callout: none;

    -webkit-user-select: none;

    -khtml-user-select: none;

    -moz-user-select: none;

    -ms-user-select: none;

    user-select: none;

}