8.1.1 BasemapToggle

8.1.1 BasemapToggle (deprecated)

There are four key steps in implementing this widget:

  1. Set the basemap property of the Map object to the basemap you want the user to see when the app loads.
  2. Create the new BasemapToggle object, associating it with a View.
  3. Set the BasemapToggle’s nextBasemap property to the other basemap you’d like the user to be able to switch to.
  4. Add the widget to the desired screen location.

See the Pen L8_BasemapToggle_widget by Jim Detwiler (@jimdetwiler) on CodePen.