Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Commonmark migration
Source Link

Context: I am trying to simply create a 'Save Button' from selection of basemap in basemap gallery...

The only thing missing is I cannot find the 'well known string ids' from the basemaps in the basemap gallery for which I can use to reference later, i.e. streets, streets-vector, topo dark-gray, etc etc.

I am getting the objects responses with the below on any change of selection to the basemap gallery, I am seemingly getting EVERYTHING back but the 'well known string ids' in which I can save and use later to render that basemap. I am getting the title and property ID but the ids to change the map, i.e. topo are no where to be found within the object responses.

basemapGallery.watch('activeBasemap', function(newBasemap, property, object) 
      console.log('new active basemap', {newBasemap, property, object});
.......... // also have tried pulling in the basemap obj here as well

i.e. I can programmatically, manually, change the basemap in my application or in the dev console with the below.

myapp.widgets.basemapManager.basemapGallery.activeBasemap = "streets"

The docs lead me to believe I can use portal item id to reference the basemaps but this did not work. I have tried to reference it every which way in accordance to the above line.

Below is a screenshot of my watch function after a selection has been made to the basemap gallery. No named string ids to change the map found, i.e. 'dark-grey' 'topo' 'streets' etc.

enter image description here

enter image description here

Context: I am trying to simply create a 'Save Button' from selection of basemap in basemap gallery...

The only thing missing is I cannot find the 'well known string ids' from the basemaps in the basemap gallery for which I can use to reference later, i.e. streets, streets-vector, topo dark-gray, etc etc.

I am getting the objects responses with the below on any change of selection to the basemap gallery, I am seemingly getting EVERYTHING back but the 'well known string ids' in which I can save and use later to render that basemap. I am getting the title and property ID but the ids to change the map, i.e. topo are no where to be found within the object responses.

basemapGallery.watch('activeBasemap', function(newBasemap, property, object) 
      console.log('new active basemap', {newBasemap, property, object});
.......... // also have tried pulling in the basemap obj here as well

i.e. I can programmatically, manually, change the basemap in my application or in the dev console with the below.

myapp.widgets.basemapManager.basemapGallery.activeBasemap = "streets"

The docs lead me to believe I can use portal item id to reference the basemaps but this did not work. I have tried to reference it every which way in accordance to the above line.

Below is a screenshot of my watch function after a selection has been made to the basemap gallery. No named string ids to change the map found, i.e. 'dark-grey' 'topo' 'streets' etc.

enter image description here

enter image description here

Context: I am trying to simply create a 'Save Button' from selection of basemap in basemap gallery...

The only thing missing is I cannot find the 'well known string ids' from the basemaps in the basemap gallery for which I can use to reference later, i.e. streets, streets-vector, topo dark-gray, etc etc.

I am getting the objects responses with the below on any change of selection to the basemap gallery, I am seemingly getting EVERYTHING back but the 'well known string ids' in which I can save and use later to render that basemap. I am getting the title and property ID but the ids to change the map, i.e. topo are no where to be found within the object responses.

basemapGallery.watch('activeBasemap', function(newBasemap, property, object) 
      console.log('new active basemap', {newBasemap, property, object});
.......... // also have tried pulling in the basemap obj here as well

i.e. I can programmatically, manually, change the basemap in my application or in the dev console with the below.

myapp.widgets.basemapManager.basemapGallery.activeBasemap = "streets"

The docs lead me to believe I can use portal item id to reference the basemaps but this did not work. I have tried to reference it every which way in accordance to the above line.

Below is a screenshot of my watch function after a selection has been made to the basemap gallery. No named string ids to change the map found, i.e. 'dark-grey' 'topo' 'streets' etc.

enter image description here

enter image description here

Bumped by Community user
naming
Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

how How to get base map ids from basemap gallery arcgis jsArcGIS JS (i.e. topo)

edited title
Link

Get string-id of basemaps in how to get base map ids from basemap gallery arcgis js (i.e. topo)

edited body
Source Link
Loading
edited body
Source Link
Loading
title case
Link
Vince
  • 20.3k
  • 16
  • 48
  • 65
Loading
Source Link
Loading