Auto Resize Aspmap in mobile web

2/27/2013 9:09:41 AM
Total Posts 50

Auto Resize Aspmap in mobile web

Hello,

I use ASPMAP 4.7 and develop for mobile web using jquery mobile min.

I have problem on auto resize in mobile web when screen autorotate to landscape or vice versa.

I already try to use jscript Resize() . but still not work.

How to make autorisize when browser rotated?

 

2/28/2013 1:27:35 AM
MVP
Total Posts 323

Re: Auto Resize Aspmap in mobile web

Mobile browsers fire resize (and orientationchange) events.

If the resize is handled by your code, and there is no results, try to handle the orientationchange event.

2/28/2013 5:15:53 AM
Total Posts 50

Re: Auto Resize Aspmap in mobile web

Can you give me sample script?

2/28/2013 5:31:24 AM
MVP
Total Posts 323

Re: Auto Resize Aspmap in mobile web

<script>

function resize()
{
    var map = AspMap.find('<%=map.ClientID%>');    
    if (map) map.resize();
}

window.addEventListener("resize", resize, false);

// window.addEventListener("orientationchange", resize, false);

</script>

...

<div style="width:100%;height:100%">
<aspmap:Map id="map" runat="server" Width="700px" Height="500px"></aspmap:Map>
</div>

...


2/28/2013 10:23:08 AM
Total Posts 50

Re: Auto Resize Aspmap in mobile web

Thank you.