Some times Map blank after zoom

1823
1
09-23-2015 10:43 AM
JulieBiju
Occasional Contributor

Our web map added with Bing and two dynamic map layers.

Here my problem is after some zoom when I change map option from Bing to dynamic It  is taking minimum 1 minute time to load the map. And some times it is very faster also. See the code below.Where is the problem? Any Idea?Always bing map loading very quickly .Only loading time taking AltareeqEng and AltareeqArb .

I am very new in javascript and help is indeed

function createBasemapGallery() {

                  //AltareeqEng = document.getElementById('TxtAltareeqEng').value;

                  //AltareeqArb = document.getElementById('TxtAltareeqArb').value;

                  AltareeqEng = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapSer...";

                  AltareeqArb = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Petroleum/KGS_OilGasFields_Kansas/MapServ...";

                  //Manually create a list of basemaps to display

                  var basemaps = [];

                  BingMapsRoad = new esri.dijit.Basemap({

                      layers: [new esri.dijit.BasemapLayer({

                          type: "BingMapsRoad"

                      })],

                      id: "bmRoad",

                      title: "BingMaps-Road"

                  });

                  basemaps.push(BingMapsRoad);

                  BingMapsAerial = new esri.dijit.Basemap({

                      layers: [new esri.dijit.BasemapLayer({

                          type: "BingMapsAerial"

                      })],

                      id: "bmAerial",

                      title: "BingMaps-Aerial"

                  });

                  basemaps.push(BingMapsAerial);

                  BingMapsHybrid = new esri.dijit.Basemap({

                      layers: [new esri.dijit.BasemapLayer({

                          type: "BingMapsHybrid"

                      })],

                      id: "bmHybrid",

                      title: "BingMaps-Aerial-Labels"

                  });

                  basemaps.push(BingMapsHybrid);

                

                  TareeqENG = new esri.dijit.Basemap({

                      layers: [new esri.layers.ArcGISDynamicMapServiceLayer(AltareeqEng)],

                      id: "TareeqENG",

                      title: "Al-Tareeq(ENG)"

                  });

                  basemaps.push(TareeqENG);

               

                  TareeqARB = new esri.dijit.Basemap({

                      layers: [new esri.layers.ArcGISDynamicMapServiceLayer(AltareeqArb)],

                      id: "TareeqARB",

                      title: "Al-Tareeq(AR)"

                  });

                  basemaps.push(TareeqARB);

                

                  basemapGallery = new esri.dijit.BasemapGallery({

                      showArcGISBasemaps: false,

                      basemaps: basemaps,

                      bingMapsKey: "ApQHaZPBoOEOX4-UAgLYcLYr74TJszVCtaCXe0Tij5mMpuUTWXegmUcs0qUonSg2",

                      map: map

                  });

              

                  graphicsLayer = new esri.layers.GraphicsLayer();

                  map.addLayer(graphicsLayer);

                  //BasemapGallery.startup isn't needed because we aren't using the default basemap, instead

                  //we are going to create a custom user interface to display the basemaps, in this case a menu.

                  dojo.forEach(basemapGallery.basemaps, function (basemap) {

                      //Add a menu item for each basemap, when the menu items are selected

                      dijit.byId("bingMenu").addChild(new dijit.MenuItem({

                          label: basemap.title,

                          onClick: dojo.hitch(this, function () {

                              this.basemapGallery.select(basemap.id);

                          })

                      }));

                  });

              }

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus

Juile,

   The Bing basemaps are cached tiled layers so they will always perform faster than the ArcGISDynamicMapServiceLayer that your other two layers come from.  Why exactly are you using those layers as a basemap? Normally basemaps would be cached tiled layers.