Internet Explorer 6 does not display Bing Ajax v7 map

Is it possible to make IE6 (or IE 8 installed in quirks mode through the IE Developer Tools window) load and show Bing Ajax version 7 map management?

For example, try running the "Hello World" example on this page in IE6 or IE8 in quirks mode. The page remains blank.

From this blog post I understand that the Bing Ajax v7 card does not officially support IE6. But you can visit maps.bing.com with IE6 and it displays a v7 map, so this should be possible.

I played in the IE8 developer toolbox, and if you suppress the position style element in a div with the MicrosoftMap class, which is dynamically added to MS JavaScript, it starts to look better. This makes me think that there is a magical combination of styles in the parent divs and other tags that will make it work.

+3
source share
1 answer

Make sure you set the width and height on the map (both in the div style and in Mapoptions passed to the map constructor). It is not possible to verify it yourself, but try the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <title></title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
  <script type="text/javascript">
    function GetMap() {
       var map = new Microsoft.Maps.Map(document.getElementById("mapDiv"),
              { credentials: "BingMapsKey",
                center: new Microsoft.Maps.Location(52.6, 1.26),
                mapTypeId: Microsoft.Maps.MapTypeId.road,
                zoom: 7,
                height: 480,
                width: 640
              });
    }
  </script>
</head>
<body onload="GetMap();">
  <div id="mapDiv" style="position:relative; width:640px; height:480px;"></div>    
</body>
</html>
+3
source

Source: https://habr.com/ru/post/1794621/


All Articles