Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behaviour of BasemapToggle with defaultBasemap in some cases #51

Open
sverkerEsriSE opened this issue Apr 16, 2018 · 2 comments

Comments

@sverkerEsriSE
Copy link
Contributor

When setting the defaultBasemap option to something other than the basemap that the underlying web map uses, the app will first show the web maps basemap. When the user then does a basemap toggle, it will show the basemap set as the toggle option. On the next toggle, the app will then show the basemap specified as defaultBasemap.

Or to be more clear:

  1. Create a new Web Map in ArcGIS Portal or AGOL
  2. Use Streets as the basemap
  3. Share as Public Information app
  4. Configure public information app to use the Topographic map as Default Basemap
  5. And the National Geographic map as next Basemap.
  6. When the app loads, it will display the Streets basemap
  7. First click on Toggle will display the National Geographic basemap
  8. Next click on Toggle will display the Topographic basemap.

I believe the end user expects the Basemap Toggle to always toggle between the same two maps.
So either show the basemap set as Default Basemap when the application loads, irregardless of which basemap was used in the web map, or toggle between the "Next basemap" and the basemap that was used on the web map.

It seems like the BasemapToggle dijit code actually should fetch the map's current basemap when toggling, and put that as previous basemap (and default basemap), but for some reasons, it works the way described above.

@driskull
Copy link
Member

Yes this is a known limitation in 3x. The BasemapToggle only recognizes string named basemaps. Basemaps that are set by a webmap or basemap gallery are not recognized.

@sverkerEsriSE
Copy link
Contributor Author

Thanks for clarifying this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants