8.8.8 ScaleBar component

The pen below, modeled after the example for the ScaleBar widget, demonstrates the use of the ScaleBar component. Note that the style and unit are conveniently set using HTML attributes.

See the Pen ScaleBar demo - components by Jim Detwiler (@jimdetwiler) on CodePen.

This concludes the demonstration of map components built into Esri's Maps SDK for JS. There are many others and I recommend you take a few minutes to peruse them in the documentation. Some you may find to be of particular interest include (not an exhaustive list):

  • Area Measurement
  • Distance Measurement
  • Bookmarks: typically used to provide access to spatial bookmarks stored with a web map
  • Editor
  • Feature Table
  • Navigation Toggle: for 3D scene navigation
  • Swipe