API 3.45 : hide scalebar on the map

201
2
Jump to solution
a month ago
LionelGOUBET
New Contributor II

Hi,

is it possible to hide the scale bar on the map through the api,
I didn't see any option on the map ...


Otherwise I have to go through the dom to hide it?

 

Thanks for your help

 

LionelGOUBET_0-1711721107195.png

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Sage_Wall
Esri Contributor

Hi @LionelGOUBET ,

Somewhere in your app you are likely adding the scalebar.  It's not included by default.  Find where you are adding the scalebar and simply remove that part from your code.

Or, if you want to be able to hide it and show it again use the scalebar.hide and show methods.

https://developers.arcgis.com/javascript/3/jsapi/scalebar-amd.html

 

  var scalebar = new Scalebar({
    map: map,
    attachTo: "top-right"
  });

 

 

View solution in original post

2 Replies
Sage_Wall
Esri Contributor

Hi @LionelGOUBET ,

Somewhere in your app you are likely adding the scalebar.  It's not included by default.  Find where you are adding the scalebar and simply remove that part from your code.

Or, if you want to be able to hide it and show it again use the scalebar.hide and show methods.

https://developers.arcgis.com/javascript/3/jsapi/scalebar-amd.html

 

  var scalebar = new Scalebar({
    map: map,
    attachTo: "top-right"
  });

 

 

LionelGOUBET
New Contributor II

all my excuses, I did not have this code in my all app ...

 

Thanks you very much  ... sorry again