<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Background color for scalebar dijit-Scalrebar visibility on Imagery layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/background-color-for-scalebar-dijit-scalrebar/m-p/588354#M54962</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This worked pretty well for me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;.esriScalebar {padding: 12px 30px; background-color:#ffffff;} &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]21809[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a little extra padding to the left of the scalebar, but it doesn't look too bad overall. I think Dan's suggestion is much more elegant though, the transparency is a nice touch!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Feb 2013 19:19:31 GMT</pubDate>
    <dc:creator>BrittneyGibbons</dc:creator>
    <dc:date>2013-02-14T19:19:31Z</dc:date>
    <item>
      <title>Background color for scalebar dijit-Scalrebar visibility on Imagery layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/background-color-for-scalebar-dijit-scalrebar/m-p/588350#M54958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have observed that scalebar is hard to see when base map is imagery. I am trying to add some background color to it by creating a div (with white background) and adding scale bar to it. However scalebar width changes based on extent so sometimes it goes outside of the div. Also in case of Bing base map Bing logo will appear on left hand side bottom so special handling is required for the same. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a better way to achieve this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Rahul&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2012 14:09:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/background-color-for-scalebar-dijit-scalrebar/m-p/588350#M54958</guid>
      <dc:creator>RahulMetangale1</dc:creator>
      <dc:date>2012-12-07T14:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Background color for scalebar dijit-Scalrebar visibility on Imagery layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/background-color-for-scalebar-dijit-scalrebar/m-p/588351#M54959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Css&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;-----&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.cssScalebarContainer { left: 0; bottom: 0; color: Black; padding: 8px 32px 16px 8px; background-color: White; opacity: 0.7; filter: alpha(opacity=70); border-radius: 4px; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.cssScalebarRuler { border:1px solid black; background-color: Black; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.cssScalebarRulerBlock { background-color: Black; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-----&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Javascript&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;-----&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;/// Do this on load&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;function ftnSetupScalebar() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 'use strict';&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; var oScalebarContainer,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; oScalebarRuler,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; oScalebarRulerBlock,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; oScalebarText,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; i;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; /// Find elements by class (sure wish they had IDs)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; oScalebarContainer = dojo.query('.scalebar_bottom-left');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; oScalebarRuler = dojo.query('.esriScalebarRuler');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; oScalebarRulerBlock = dojo.query('.esriScalebarRulerBlock');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; oScalebarText = dojo.query('.esriScalebarLabel');&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; if (oScalebarContainer !== null &amp;amp;&amp;amp; oScalebarContainer.length &amp;gt; 0) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; dojo.addClass(oScalebarContainer[0], 'cssScalebarContainer');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; if (oScalebarRuler !== null &amp;amp;&amp;amp; oScalebarRuler.length &amp;gt; 0) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; dojo.addClass(oScalebarRuler, 'cssScalebarRuler');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; if (oScalebarRulerBlock !== null &amp;amp;&amp;amp; oScalebarRulerBlock.length &amp;gt; 0) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; oScalebarRulerBlock.addClass('cssScalebarRulerBlock');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; if (oScalebarText !== null &amp;amp;&amp;amp; oScalebarText.length &amp;gt; 0) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; for (i = 0; i &amp;lt; oScalebarText.length; i++) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; oScalebarText&lt;I&gt;.style.color = 'black';&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-----&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Background will resize with scalebar.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Looks like this (click on image below to see actual size):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]19802[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I had the same problem and did this to solve it. I'm hoping to eventually find a cleaner way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not a perfect solution, but works for now. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Dan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2012 18:55:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/background-color-for-scalebar-dijit-scalrebar/m-p/588351#M54959</guid>
      <dc:creator>Dan</dc:creator>
      <dc:date>2012-12-07T18:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Background color for scalebar dijit-Scalebar visibility on Imagery layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/background-color-for-scalebar-dijit-scalrebar/m-p/588352#M54960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Perfect!!! Thank you Dan!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Dec 2012 03:14:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/background-color-for-scalebar-dijit-scalrebar/m-p/588352#M54960</guid>
      <dc:creator>RahulMetangale1</dc:creator>
      <dc:date>2012-12-08T03:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Background color for scalebar dijit-Scalrebar visibility on Imagery layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/background-color-for-scalebar-dijit-scalrebar/m-p/588353#M54961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Glad to help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Dan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2012 12:10:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/background-color-for-scalebar-dijit-scalrebar/m-p/588353#M54961</guid>
      <dc:creator>Dan</dc:creator>
      <dc:date>2012-12-10T12:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Background color for scalebar dijit-Scalrebar visibility on Imagery layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/background-color-for-scalebar-dijit-scalrebar/m-p/588354#M54962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This worked pretty well for me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;.esriScalebar {padding: 12px 30px; background-color:#ffffff;} &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]21809[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a little extra padding to the left of the scalebar, but it doesn't look too bad overall. I think Dan's suggestion is much more elegant though, the transparency is a nice touch!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2013 19:19:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/background-color-for-scalebar-dijit-scalrebar/m-p/588354#M54962</guid>
      <dc:creator>BrittneyGibbons</dc:creator>
      <dc:date>2013-02-14T19:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Background color for scalebar dijit-Scalrebar visibility on Imagery layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/background-color-for-scalebar-dijit-scalrebar/m-p/588355#M54963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My solution was similar:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;$(".esriScalebarRuler").parent().css("background-color", "white");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;$(".esriScalebarRuler").parent().css('padding-left', '15px');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;$(".esriScalebarRuler").parent().css('padding-right', '35px');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;$(".esriScalebarRuler").parent().css('padding-top', '12px');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;$(".esriScalebarRuler").parent().css('padding-bottom', '12px');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This was good for scalebar in right bottom.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Dec 2013 14:18:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/background-color-for-scalebar-dijit-scalrebar/m-p/588355#M54963</guid>
      <dc:creator>OrenGal</dc:creator>
      <dc:date>2013-12-28T14:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Background color for scalebar dijit-Scalrebar visibility on Imagery layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/background-color-for-scalebar-dijit-scalrebar/m-p/588356#M54964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Update: This is how I am doing it now for a dual-type scalebar positioned lower left - all CSS:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* CSS */&lt;/P&gt;&lt;P&gt;.esriScalebar {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; padding: 6px 38px 4px 4px; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; background-color: white;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; border-radius: 4px;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; opacity: 0.6;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; width: auto;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; height: auto;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;.esriScalebar:hover {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; opacity: 0.99;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;.esriScalebarLabel {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; color: black;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; font-family: Trebuchet MS, Verdana, Tahoma;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; font-size: 9pt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;.esriScalebarLine {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; border-color: black; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(May need to tweak CSS for older IE browsers.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See ESRI reference: &lt;A href="https://developers.arcgis.com/javascript/jsapi/scalebar-amd.html" title="https://developers.arcgis.com/javascript/jsapi/scalebar-amd.html"&gt;scalebar-amd | API Reference | ArcGIS API for JavaScript&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 16:17:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/background-color-for-scalebar-dijit-scalrebar/m-p/588356#M54964</guid>
      <dc:creator>Dan</dc:creator>
      <dc:date>2014-07-29T16:17:13Z</dc:date>
    </item>
  </channel>
</rss>

