<?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: can the basemap be hidden in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-basemap-be-hidden/m-p/690653#M64275</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you can remove the basemap once it's added to the map. I was unable to find any resources in the documentation, but after some trial and error was able to do so by calling:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt; map._removeBasemap();&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which is extremely useful if you are using your own custom basemaps with Esri's basemaps. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Feb 2017 15:13:11 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2017-02-15T15:13:11Z</dc:date>
    <item>
      <title>can the basemap be hidden</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-basemap-be-hidden/m-p/690646#M64268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When creating a map I've been unable to add layers or do anything if not defining the map.basemap property.&amp;nbsp; Once I do define a basemap, is there way to hide it or get rid of it and have no basemap?&amp;nbsp; I just ask because when panning or zooming after another layer is added on top of the basemap, the map loads the basemap tiles/graphics first then loads the layers on top.&amp;nbsp; In my case I don't want the basemap tiles to have to load at all, seems like extra bandwidth and it looks bad imo when the layer your not supposed to see pops out briefly on zooming or panning.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;map = new esri.Map("map", {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; basemap : "streets"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; });&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;works, but:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;map = new esri.Map("map");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;results in a page where I can't add any layers or see anything at all but the ESRI logo in the bottom right.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2013 18:46:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-basemap-be-hidden/m-p/690646#M64268</guid>
      <dc:creator>KenDeeds</dc:creator>
      <dc:date>2013-02-13T18:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: can the basemap be hidden</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-basemap-be-hidden/m-p/690647#M64269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;According to the ESRI Javascript API documentation&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#Map/MapConst"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#Map/MapConst&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only required param when creating a new map is the the "mapDivId"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var map = new esri.Map("map");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;where "map" = the name of the html div/container that you are using to display the map.&amp;nbsp; All other options are optional.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Confirm that you are specifying to correct divID and it should be a string value. After you have instantiated your map, you can instantiate all your layers and either use map.addLayer(myMapService) or map.addLayers([myMapService1,myMapService2]) to add all your desired map services.&amp;nbsp; You have the option to use the "pre-defined" basemaps if you choose.&amp;nbsp; Also, don't forget that you can specify your spatial ref by passing in a spatial extent. Maybe that is why you are not seeing any of your data when using the ESRI basemaps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2013 18:59:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-basemap-be-hidden/m-p/690647#M64269</guid>
      <dc:creator>DianaBenedict</dc:creator>
      <dc:date>2013-02-13T18:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: can the basemap be hidden</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-basemap-be-hidden/m-p/690648#M64270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I thought that the first layer added to the map had to be a base map (or was treated as such). With that logic, maybe you can just add the basemap but pass the option to make the basemap invisible:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; // Create the map
 var map = new esri.Map("map", {
&amp;nbsp; extent:initExtent //initExtent is a variable w/ your initial extent
 });

 
 // Set up and establish the data layers for the map, beginning with the basemap
 var primaryMapServiceURL = "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer";
 var theBasemap = new esri.layers.ArcGISTiledMapServiceLayer(primaryMapServiceURL, {
&amp;nbsp; visible: false
 });
 map.addLayer(theBasemap);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The above code is from v2.8 of the API..&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:04:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-basemap-be-hidden/m-p/690648#M64270</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2021-12-12T05:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: can the basemap be hidden</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-basemap-be-hidden/m-p/690649#M64271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What kind of data are you trying to add? At version 3.3 we made it easier to have a map with only a graphics or feature layer as the first layer in the map. Check out the following sample for an example of this: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/data_gas_prices"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/data_gas_prices&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2013 14:59:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-basemap-be-hidden/m-p/690649#M64271</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2013-02-14T14:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: can the basemap be hidden</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-basemap-be-hidden/m-p/690650#M64272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I set up an example.&amp;nbsp; In the fist link here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://citgo.bvk.geoconsensus.com/esri/test_no_basemap.php"&gt;http://citgo.bvk.geoconsensus.com/esri/test_no_basemap.php&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do not include the "basemap" attribute in my map definition (view source on it).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in the 2nd link that works the only difference is I define basemap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://citgo.bvk.geoconsensus.com/esri/test_with_basemap.php"&gt;http://citgo.bvk.geoconsensus.com/esri/test_with_basemap.php&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I don't like is in the 2nd example if I zoom or pan quickly (espeically on a slow connection) it loads the basemap first, then the Tiled Map Service that I want to be the only visible layer.&amp;nbsp; When I also add this to onload "map.basemap.hide()" then the map doesn't work on panning or zooming but it hides the basemap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only difference in the two links above is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; map = new esri.Map("map", {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; infoWindow : popup,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; zoom: 6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; });&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;vs&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; map = new esri.Map("map", {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; infoWindow : popup,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; basemap : "streets",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; zoom: 6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; });&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 17:31:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-basemap-be-hidden/m-p/690650#M64272</guid>
      <dc:creator>KenDeeds</dc:creator>
      <dc:date>2013-02-19T17:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: can the basemap be hidden</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-basemap-be-hidden/m-p/690651#M64273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I copied your code and put it into my project and was able to step through the code.&amp;nbsp; I noticed that the mao.OnLoad event does NOT get fired until AFTER the 1st layer has been added&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;so If you want your map to work without a base map then I would suggest that your do not connect your map.addLayer to the onLoad event. Below is what I mean:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; dojo.require("esri.map");
&amp;nbsp; dojo.require("esri.layers.osm");
&amp;nbsp; dojo.require("esri.layers.FeatureLayer");
&amp;nbsp; dojo.require("dijit.dijit");
&amp;nbsp; dojo.require("esri.dijit.Popup");

&amp;nbsp; dojo.addOnLoad(init);
&amp;nbsp; var centerpoint = 0;
&amp;nbsp; var map = 0;
&amp;nbsp; var windowProxy;
&amp;nbsp; var current_open_marker = 0;
&amp;nbsp; var mouseover = 0;

&amp;nbsp; function init() {
&amp;nbsp;&amp;nbsp;&amp;nbsp; esriConfig.defaults.map.zoomDuration = 220;
&amp;nbsp;&amp;nbsp;&amp;nbsp; esriConfig.defaults.map.panDuration = 220;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var popup = new esri.dijit.Popup(null, dojo.create("div"));
&amp;nbsp;&amp;nbsp;&amp;nbsp; map = new esri.Map("map", {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infoWindow: popup,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zoom: 6
&amp;nbsp;&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp;&amp;nbsp; var testlayer = initlayer('http://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer', 'CTGF5889DE7840DB7AC4', 1);

&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(map, "onLoad", function () {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //var testlayer = initlayer('http://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer', 'CTGF5889DE7840DB7AC4', 1);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; testlayer.show();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //map.hideZoomSlider();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(document).ready(function () {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //do future onload code 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp; }

&amp;nbsp; function initlayer(url, id, opacity) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var layer = new esri.layers.ArcGISTiledMapServiceLayer(url, { 'id': id, 'opacity': opacity, 'visible': false });
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayer(layer);
&amp;nbsp;&amp;nbsp;&amp;nbsp; return layer;
&amp;nbsp; }
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:04:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-basemap-be-hidden/m-p/690651#M64273</guid>
      <dc:creator>DianaBenedict</dc:creator>
      <dc:date>2021-12-12T05:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: can the basemap be hidden</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-basemap-be-hidden/m-p/690652#M64274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dianna,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Will give this a try later today, thanks for the help, suggestion makes sense.&amp;nbsp; Will follow up and let you know how it goes.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2013 15:02:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-basemap-be-hidden/m-p/690652#M64274</guid>
      <dc:creator>KenDeeds</dc:creator>
      <dc:date>2013-02-20T15:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: can the basemap be hidden</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-basemap-be-hidden/m-p/690653#M64275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you can remove the basemap once it's added to the map. I was unable to find any resources in the documentation, but after some trial and error was able to do so by calling:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt; map._removeBasemap();&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which is extremely useful if you are using your own custom basemaps with Esri's basemaps. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2017 15:13:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-basemap-be-hidden/m-p/690653#M64275</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-02-15T15:13:11Z</dc:date>
    </item>
  </channel>
</rss>

