samirgambhir

Base map disappears when zooming in

Discussion created by samirgambhir on Oct 2, 2012
Latest reply on Oct 3, 2012 by samirgambhir
Hi,
Any action (using comboox list) to zoom to a selected sub-geography of the country makes the base map disappear from my application. Further, if I try to zoom in using the zoom slider, the ESRI street map disappears as well. Furthermore, if I select the entire country using the combobox (i.e. calling the full extent of the base map), all my map services are visible. I have looked up various posts here and checked the wkid issue as well, but haven't been able to resolve it. Please help.
Here is part of my JS code:

function getStateExt(State) {
var mapExtent;
if (State != "All India") {
   var myState = State.toUpperCase();
   mapExtent = new esri.geometry.Extent();
   var queryTask = new esri.tasks.QueryTask("http://nsmhpc7007:8399/arcgis/rest/services/wch3/MapServer/9");
   dojo.connect(queryTask, "onComplete", function(featureSet) {
    var features = featureSet.features;
    stateExtent = features[0].geometry.getExtent();
    mapExtent.xmin = stateExtent.xmin - 150000;
    mapExtent.ymin = stateExtent.ymin - 75000;
    mapExtent.xmax = stateExtent.xmax + 150000;
    mapExtent.ymax = stateExtent.ymax + 75000;
    map.setExtent(mapExtent);
   });
   var qState = new esri.tasks.Query();
   qState.where = "name = '" + myState + "'";
   qState.returnGeometry = true;
   qState.outFields = ["name"];
   queryTask.execute(qState);
  } else if (State == "All India") {
   mapExtent = new esri.geometry.Extent();
   mapExtent = iniExtentM; /*iniExtentM is set in the init() function as iniExtentM = new esri.geometry.Extent({
  "xmin" : 6906469.033685486,
  "ymin" : 507780.9570028302,
  "xmax" : 11085388.124604845,
  "ymax" : 4734224.864539183,
  "spatialReference" : {
   "wkid" : 102100
  }
});*/
map.setExtent(mapExtent);
  }
 
}

Thanks
Samir

Outcomes