VDS Technologies

 

Set Map 100% Width/Height

8/9/2012 1:26:40 PM
Total Posts 50

Set Map 100% Width

Hello,

I am sure this topic already discuss in forum.  But I need more help about this.

Is there any plan to set enable map in 100% width?

 

For now, How to set dynamic width become maximize (ex:100%). Becaus I want to create compatible with Phone browser or android web browser.

 

 

8/29/2012 3:21:51 AM
MVP
Total Posts 323

Re: Set Map 100% Width/Height

1. Add the following styles to the head tag of the page:

<style>
html, body {margin: 0px;     padding: 0px; height: 100%;     overflow:hidden; }    
#UpdatePanel1 {position:absolute; min-height: 100%; width: 100%; height: 100%;    }
 </style>

2. Set the Width/Height properties of the Map control to 100%:

<aspmap:map id="map1" runat="server" Width="100%"  Height="100%">

The following is the updated version of the standard SimpleMap.aspx sample:

<%@ Register TagPrefix="aspmap" Namespace="AspMap.Web" Assembly="AspMapNET" %>
<%@ Page language="c#" AutoEventWireup="true" Inherits="_Default" CodeFile="SimpleMap.aspx.cs" %>
<!DOCTYPE HTML>
<html>
<head>
<style>
    html, body {margin: 0px;     padding: 0px; height: 100%;     overflow:hidden;}    
    #UpdatePanel1 {position:absolute; min-height: 100%; width: 100%; height: 100%;}
 </style>
</head>
<body>
<form id="Form1" method="post" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"/>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<aspmap:map id="map" Width="100%" Height="100%" runat="server" MapTool="Pan">
</aspmap:map>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>

1/30/2014 10:20:49 PM
Total Posts 4

Re: Set Map 100% Width

Thank you for Reply

Page is not getting compiled because of below error

Type 'System.Web.UI.UpdatePanel' does not have a public property named 'class'.

 

 

1/31/2014 3:37:58 AM
MVP
Total Posts 323

Re: Set Map 100% Width/Height

This may happen if you are using VS 2012+, it does not allow to add arbitrary properties anymore.
See the second post in this topic, it has been updated and should work in any version of VS (AspMap 4.8+ is required).