VinayBa

Conditonally showing map

Discussion created by VinayBa on Dec 27, 2013
Latest reply on Jan 6, 2014 by JUihlein-esristaff
Hi ALl,

   I want to display map conditionally , that is lets i initailize the map once usign following code


     var extent = esri.geometry.Extent("some values");
     var map= esri.map("mapdiv",{extent});
     var baseLayer = new ArcGisDynamicMapServiceLayer(url);
     map.addLayer(baseLayer);
     var featureLayer = new FeatureLayer(url);
     map.addLayer(baseLayer);
   // sorry if some api  as I am not in front of my code

    

As you noticed i am initalizing map to a particular div . We are planning to implement our app completly ajax based i,e header
and footer sections remains constant where as only the middle portion keeps on changing.On load of website since we show hte map
,when i want to display someother content where map is I have to either overide the existing content and load new content by
doing this i am losing map content hence i have to  reload the map once again if i have to show the map.
I want to avoid doing this .Hence i decided to hide the map div and place it in some other location when i want to load some other content other then the map
and place div back again to original position and display the map.
    I have been able to implement this but i am facing an issue where once i hide the div and display it back agian even though
the map shows up but seenms like all featuer layer graphics are lost , i have implements mouse over which does not work
anything wrong in the approach?

Outcomes