Hello everyone,
I'm working on an app which use arcgis online map,
arcgisUtils.createMap(webmapId, "mapDiv").then(function(response) {
map = response.map;
And I would like to change the basemap like this sample, after many tries I wonder if it's possible to do it with a webmapId. If it's possible I'd appreciate some tips if possible...
Thanks you vm !
Anyone ?
Never thought about that. (So I am totally guessing what may work here.)
Have you tried ... ?
1. Put "arcgisUtils.createMap(webmapId, "mapDiv").then(function(response) { map = response.map;}" inside a function that accept webmapId paramter?
2. Create a toggle button to toggle between map id's?
Of course, the potential problem may be that there are more than one base layer/map in the map, but you can find out.
Diane,
The current BasemapToggle widget doesn't support ArcGIS Online web maps. We hope to add support for working with web maps to this widget at a future release. That said it is possible to get this to work by 'hacking' in a fix until widget support is available. I've attached a zip file that includes a code sample showing how to use the Basemap Toggle widget with a web map.
Thanks you for this, I will try to make it work.
EDIT: Made it work so ty vm both of you for your help
Hi Kelly,
Any chance you guys have added built-in support for this yet?
Thanks,
Chris
I think we have what you're looking for at 4x: