Hi All
I am using a scalebar in my map to show zoom in/out level. Currently it is showing mi which I presume it stands for miles and ft which I presume it stands for feet. I am based in South Africa and I need to use the metric system how do I do that?
ScaleBar code:
var scaleBar = new ScaleBar({
view: view
});
// Add widget to the bottom left corner of the view
view.ui.add(scaleBar, {
position: "bottom-left"
});
This how it currently show
and
Kind Regards
Siyabonga Kubeka
Hello,
Take a look at the API reference for ScaleBar https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#style There appears to be a unit value where a metric display can be specified.
Thus your sample code becomes
var scaleBar = new ScaleBar({
view: view,
unit: "metric"
});
// Add widget to the bottom left corner of the view
view.ui.add(scaleBar, {
position: "bottom-left"
});
I cannot get access to the Javascript sandbox this morning to test. https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=map_simple so hopefully I have the syntax correct.
Regards,
Tom
Hwzit
Not sure if this helps below:
# Create scale bar
scalebar = ScaleBar(0.08, "cm", length_fraction=0.25)
ax.add_artist(scalebar)