Select to view content in your preferred language

basemap not visible after initial load in IE9

1224
6
04-04-2013 12:42 PM
deleted-user-ugCMpXci8bn5
Deactivated User
Hello..I think this question is related to either/or raw Javascript and JQuery..but I think it is also related to the ArcGIS Javascript API map class, so I'll ask it here..my problem is also an IE9 issue; the app works fine in Chrome and FF.

I have a web app where a map opens up in its own div on a map click.  After loading the app for the first time, the basmap opens as expected (at first the map is only the basemap with no other layers)...but when I close the map div, then open it again, the basemap appears for about 1 second, then vanishes...but the background color, and zoom button, remain...

the map is set up in HTML this way

     
      <div class="map-content">
     <div class="map-close" style="display: none;"><a href="#">Close</a></div><!--buttons--->
   <div class="map-fullscreen" style="display: none;"><a href="#">Fullscreen</a></div>
   <div style='width:100%;  height:100%'><object type="text/html" name ="mapPage" style='width:100%;         
                           height:100%' data='mapPage.html'>

    </object></div>
  </div>


In the init JS, the basemap is added as a TiledMapServiceLayer.

..there's not a lot more code to it! as I said, all this works normally in FF and Chrome.....

I have tried every IE tag or conditional in the HTML that I have come across, but none have solved this issue...
I have
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
in the header and
  <script type="text/javascript" src="JavaScript/modernizr-2.5.3.js"></script>

is in there as well....

I hope I explained this well...I seem to have constant IE issues....
Thanks for help, Jason
(*ps I am using Jquery Mobile as well..)
0 Kudos
6 Replies
StephenLead
Honored Contributor
Can you post your code too, or (better) a link to your live site?
0 Kudos
deleted-user-ugCMpXci8bn5
Deactivated User
I posted a couple snippets above...the site is not public and uses non-public services...and is really long! are the code snippets above helpful?
0 Kudos
deleted-user-ugCMpXci8bn5
Deactivated User
There is some code above, here is the JS used to open the map window on a click: 
     mapTrigger.click(function(){

    $FirstConstrainerWidth = $('.firstConstrainer').outerWidth();

    console.log("locsizeConstWidth: " + $SizeConstrainerWidth + "  locfirstConstrainer: " + $FirstConstrainerWidth);

    if  ($SizeConstrainerWidth > $FirstConstrainerWidth)
    {
        $SizeConstrainerWidth=$FirstConstrainerWidth;
    }
    // scroll to top to make sure header is visible
    $('html, body').animate({scrollTop:0}, 'fast');
    //animate the containers height to the height of the slideshow

        mapContainer.animate({

            "height" : $('#sizeConstrainer').outerHeight() - $('#bg').outerHeight() - $('#footer').outerHeight(), // TODO:adjust the height of the map on window resize
            "width" : $SizeConstrainerWidth,
            "top" : $('#bg').outerHeight(),
            "left" : $SizeConstrainerLeft,
            "bottom" : $('#footer').outerHeight()
        }, 300, function() {
            // When the animation is complete
            // hide the loading indicator
            // Fade in the controls

            $(".map-close, .map-fullscreen").fadeIn("slow");

        });


});
0 Kudos
BrendanDwyer
Frequent Contributor
Do you add any other layers along with the basemap?  If you add another layer and it is not in the same projection as the basemap, the jsapi freaks out.  The order you add them to the map object makes a difference.
0 Kudos
deleted-user-ugCMpXci8bn5
Deactivated User
At the stage I am discussing, no there are no other layers.  On the initial load, I can add other layers without any problem.  It is when I close the map div and open it again that the basemap shows for a second then flashes off (with the zoom button and background color still visible).  I have no problems adding in other layers in Chrome or Firefox.
0 Kudos
deleted-user-ugCMpXci8bn5
Deactivated User
tumbleweeds  here....anyone? I haven't had any luck with this....
0 Kudos