<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: basemapLayerIds &amp; map.getBasemap() are null when using arcgisUtils.createMap in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437302#M40280</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tommy,&lt;/P&gt;&lt;P&gt;We're getting into confusing territory here, but in WebmapJSON a single baseMap can be composed of multiple individual basemapLayers (ex: gray basemap + reference labels) that are drawn simultaneously.&amp;nbsp; This means that the baseMap - title tag makes the appropriate equivalent to a basemapLayerId in the map object itself, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;thanks for chiming in.&amp;nbsp; are you just suggesting that it'd be helpful for the JSAPI to make sure 'title' (if present) is returned by a call to map.getBasemap() or am i missing something else?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Feb 2015 16:16:24 GMT</pubDate>
    <dc:creator>JohnGravois</dc:creator>
    <dc:date>2015-02-19T16:16:24Z</dc:date>
    <item>
      <title>basemapLayerIds &amp; map.getBasemap() are null when using arcgisUtils.createMap</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437297#M40275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an application using the &lt;A href="https://developers.arcgis.com/javascript/jsapi/esri.arcgis.utils-amd.html#createmap"&gt;arcgisUtils.createMap&lt;/A&gt; method. In the application, properly formatted WebMapJson is passed into the createMap() method and a working map is returned. However, I have a problem with the returned map when accessing the map.&lt;A href="https://developers.arcgis.com/javascript/jsapi/map-amd.html#basemaplayerids"&gt;basemapLayerIds&lt;/A&gt; property or using map.&lt;A href="https://developers.arcgis.com/javascript/jsapi/map-amd.html#getbasemap"&gt;getBasemap&lt;/A&gt;() and map.setBasemap(). Basically, in the response map the basemapLayerIds property is null, which affects the getBasemap() and setBasemap() methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further, if I do call the map.setBasemap() method a second basemap will get added to the map underneath the original basemap that was uspplied in the JSON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This Esri JS API &lt;A href="https://developers.arcgis.com/javascript/jssamples/ags_createwebmapitem.html"&gt;sample&lt;/A&gt; has the same issue from what I can tell. Run this &lt;A href="https://developers.arcgis.com/javascript/jssamples/ags_createwebmapitem.html"&gt;sample&lt;/A&gt; in debug mode and put a breakpoint before the legend is started (or change the map to a global variable) and test the basemapLayerId property and getBasemap() method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Is this an oversight in the JS API?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;In the meantime, to get around this issue, I'm just traversing the WebMapJson in my code and if the baseMapLayers array is populated then I am manually populating the response Map's basemapLayerIds array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Any insight is much appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 14:22:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437297#M40275</guid>
      <dc:creator>TommyBramble</dc:creator>
      <dc:date>2015-01-12T14:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: basemapLayerIds &amp; map.getBasemap() are null when using arcgisUtils.createMap</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437298#M40276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;based on the baseMap spec &lt;A href="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/baseMap/02r30000003w000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;, i would expect the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;response.map.getBasemap();
&amp;gt;&amp;gt;&amp;gt; "World_Terrain_Base"&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'll do some snooping and let you know what i find, but it looks like we are currently just parsing the JSON and adding the basemap layers to the map without actually handling them as an explicit basemap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is this causing any major difficulty in your project, or is it just more of a minor annoyance?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:34:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437298#M40276</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2021-12-11T19:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: basemapLayerIds &amp; map.getBasemap() are null when using arcgisUtils.createMap</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437299#M40277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;looking at this a little more, i actually can see the logic in how we're doing things now.&amp;nbsp; the &lt;A href="https://developers.arcgis.com/javascript/jsapi/basemap-amd.html"&gt;Basemap&lt;/A&gt; object in the API has both a 'title' and 'id' property.&amp;nbsp; i'd guess we don't use title from the WebMap JSON automatically to set the 'id' in case there are spaces in the name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this makes your workaround seem a pretty sensible approach.&amp;nbsp; all that being said, im happy to dig in deeper if it turns out the current behavior causes deeper underlying problems.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Feb 2015 23:06:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437299#M40277</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2015-02-18T23:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: basemapLayerIds &amp; map.getBasemap() are null when using arcgisUtils.createMap</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437300#M40278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; This is a issue for the Web AppBuilder product as the only option that is available is to use a web map and the fact that getBasemap function and setBasemap have this issue definitely has caused me some heartache in WAB widget development.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 02:18:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437300#M40278</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-02-19T02:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: basemapLayerIds &amp; map.getBasemap() are null when using arcgisUtils.createMap</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437301#M40279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it helps, here is the block I use in the deferred response of the createMap() method to populate the basemapLayerIds property:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp; map.basemapLayerIds = [];
&amp;nbsp;&amp;nbsp; for (var i = 0, length = config.itemData.baseMap.baseMapLayers.length; i &amp;lt; length; i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var b = config.itemData.baseMap.baseMapLayers&lt;I&gt;;&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.basemapLayerIds.push(b.id);
&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After running the above code the getBasemap() and setBasemap() methods work without problems for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my particular application I know there will be a basemap in my WebMapJson, otherwise you might want to add logic to verify the parent object(s) exist (baseMap, baseMapLayers).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:34:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437301#M40279</guid>
      <dc:creator>TommyBramble</dc:creator>
      <dc:date>2021-12-11T19:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: basemapLayerIds &amp; map.getBasemap() are null when using arcgisUtils.createMap</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437302#M40280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tommy,&lt;/P&gt;&lt;P&gt;We're getting into confusing territory here, but in WebmapJSON a single baseMap can be composed of multiple individual basemapLayers (ex: gray basemap + reference labels) that are drawn simultaneously.&amp;nbsp; This means that the baseMap - title tag makes the appropriate equivalent to a basemapLayerId in the map object itself, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;thanks for chiming in.&amp;nbsp; are you just suggesting that it'd be helpful for the JSAPI to make sure 'title' (if present) is returned by a call to map.getBasemap() or am i missing something else?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 16:16:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437302#M40280</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2015-02-19T16:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: basemapLayerIds &amp; map.getBasemap() are null when using arcgisUtils.createMap</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437303#M40281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; That would be a good start. As it is right now the basemapLayerIds property does not even return anything when using a web map. My biggest concern is the basemapLayerIds and setBasemap do not function properly when using a web map. If map.getBasemap() could return 'custom' or something generic would work too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 16:24:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437303#M40281</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-02-19T16:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: basemapLayerIds &amp; map.getBasemap() are null when using arcgisUtils.createMap</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437304#M40282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would have to disagree here. From what I have observed you would not use the title. You would use the individual basemap layer ids.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if a WebMapJson baseMapLayers collection has two layers (like the hybrid imagery basemap would), then the map.basemapLayerIds would have two values (i.e. ["layer0", "layer1"]).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a layer in the baseMapLayers collection in the WebMapJson doesn't have the "id" property assigned then the API would need to auto assign the ids (i.e. "layer0"). This is similar to the behavior I've observed with the API already I believe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Correct me if I'm wrong, but in order for setBasemap() and getBasemap() to function correctly then .basemapLayerIds need to have the ids of each basemap layer. Not the title of the collection of basemap layers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 16:45:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437304#M40282</guid>
      <dc:creator>TommyBramble</dc:creator>
      <dc:date>2015-02-19T16:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: basemapLayerIds &amp; map.getBasemap() are null when using arcgisUtils.createMap</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437305#M40283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tommy,&lt;/P&gt;&lt;P&gt;i think i was the only one confused in my last post.&amp;nbsp; despite its appropriate name, i didn't realize that for normally instantiated maps, map.basemapLayerIds returns an array of individual layerIds, and not a basemap title like 'topo' or 'osm'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'll definitely pass along this feedback to the team.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 16:46:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437305#M40283</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2015-02-19T16:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: basemapLayerIds &amp; map.getBasemap() are null when using arcgisUtils.createMap</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437306#M40284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;beat ya to it &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;agreed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 16:47:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437306#M40284</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2015-02-19T16:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: basemapLayerIds &amp; map.getBasemap() are null when using arcgisUtils.createMap</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437307#M40285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Haha, yeah ya did. I'll refresh before hitting post next time. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 16:49:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437307#M40285</guid>
      <dc:creator>TommyBramble</dc:creator>
      <dc:date>2015-02-19T16:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: basemapLayerIds &amp; map.getBasemap() are null when using arcgisUtils.createMap</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437308#M40286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/2203"&gt;John Gravois&lt;/A&gt;​&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any update on this issue? Do you know if it be considered a bug? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 17:01:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437308#M40286</guid>
      <dc:creator>TommyBramble</dc:creator>
      <dc:date>2015-03-23T17:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: basemapLayerIds &amp; map.getBasemap() are null when using arcgisUtils.createMap</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437309#M40287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;its definitely a bug.&amp;nbsp; don't quote me, but i heard that basemap handling is improved in 4.x (due out for beta release next month).&amp;nbsp; if you want/need an official tracking number, you'd have to log a ticket with technical support (and reference this thread) so that they can export something public.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also, my apologies for never getting back to you on the other DotDensityRenderer thing we chatted about.&amp;nbsp; at first pass looking at your repro case that looked like a bug to me too, but it would be helpful if you could pass it on to tech support as well for them to take a deeper look.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 17:12:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437309#M40287</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2015-03-23T17:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: basemapLayerIds &amp; map.getBasemap() are null when using arcgisUtils.createMap</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437310#M40288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cool, I just didn't want to let this slide since it seemed like a legit oversight (regarding the basemaps).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will follow up with support on the DotDensity issue. We actually have a very simple work around in place for that, but wanted to let you guys know since what is documented in the API does not appear to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for the info and the quick reply!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 17:25:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/basemaplayerids-map-getbasemap-are-null-when-using/m-p/437310#M40288</guid>
      <dc:creator>TommyBramble</dc:creator>
      <dc:date>2015-03-23T17:25:48Z</dc:date>
    </item>
  </channel>
</rss>

