Chris Crowe


I have a major problem with the map.ReSize method.

When I call map.resize IE 7 just sits and consumes mega amounts of ram (100's of megabytes + counting) and becomes unresponsive.

The code below shows this problem, just enter a new size and click resize button

Can anyone else replicate this

chris


<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://dev.virtualearth.net/mapcontrol/v4/mapcontrol.js"></script>
<script>
var map = null;

function GetMap()
{
var DefaultZoom = 5;
var DefaultLat = "-33";
var DefaultLng = "140";

map = new VEMap('MapContainer');
map.LoadMap(new VELatLong(DefaultLat, DefaultLng), DefaultZoom,'a' ,false);
map.HideDashboard();
map.AttachEvent('onclick', onClick); //change to your event
}

function ResizeMap()
{
 var Width = document.getElementById("mapWidth").value;
 var Height = document.getElementById("mapHeight").value;

 map.Resize(Width, Height);
 

}
</script>
</head>
<body onload="GetMap();">
<form id="form1" runat="server">
<span id="mapsize" style="position: position:relative; ">Map Width:
<input id="mapWidth" value="450" style="width: 50px;" />, Height :
<input id="mapHeight" value="480" style="width: 50px;" />
<input id="btnUpdateMap" type="button" value="Resize Map" onclick="ResizeMap()" />
</span>
<div id="MapContainer" style="position: relative; width: 450px; height: 480px;">
</div>
</body>
</html>





Re: major problem with the map.ReSize method - huge amounts of ram are consumed - hundreds of megabytes.

SoulSolutions


Thanks for that.

Yes it crashed my browser also!

No idea why.

John.







Re: major problem with the map.ReSize method - huge amounts of ram are consumed - hundreds of megabytes.

Derek Chan

I've duplicated it on my machine as well, ram is being increasingly consumed as well.  Thanks for the report this definately looks like a bug.





Re: major problem with the map.ReSize method - huge amounts of ram are consumed - hundreds of megabytes.

Patrick Baudisch

you need to add parseInt
var Width = parseInt(document.getElementById("mapWidth").value);
var Height = parseInt(document.getElementById("mapHeight").value);
otherwise Width and Height contain strings and Resize won't like that..
Pat