Full Screen Map

Jan 21, 2008 at 1:13 AM
Hi Velio,

Can you guide us how to make full screen or (width=100% and height=100%) for your control.

The full screen is not working either of IE6+ and FF1.0+

Is there any way we can make it?

Thanks!

Regards,
Dev
Coordinator
Jan 22, 2008 at 3:58 PM
Edited Jan 22, 2008 at 4:01 PM
Hi,

Actually setting Width to 100% should work because control is rendered out as a div element.

Then setting a working Height to 100% is a tricky part as it like that for div elements.
However in shourt you have to set html and body height to 100% on the page where GoogleMap control
is going to be used and parrent elements, if any.
Here bellow I'm providing an example of working Width and Height set to 100%.
Please, note that height to the default form element on the page is set to 100%
<form id="form1" runat="server" style="width: 100%; height: 100%;">
That's very important.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Unit Test Page</title>
    <style type="text/css">
        html, body {
            margin: 0;
            padding: 0;
            height: 100%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server" style="width: 100%; height: 100%;">
    <artem:GoogleMap ID="GoogleMap2" runat="server" Zoom="15" Latitude="42.351505" Longitude="-71.094455"
        Key="ABQIAAAAyWjvj4t-s3JAHKCxqTvdRBRoUE3SabIoCOlXH37AOeIM5tsddhRFlUSAS7McYP97vBv9hxsuEq7lWw" 
        EnableGoogleBar="true" ZoomPanType="Large" ShowMapTypeControl="false" Width="100%"
        Height="100%">
        <Markers>
            <artem:GoogleMarker Address="500 Memorial Drive, Cambridge, MA" Text="Address" />
        </Markers>
    </artem:GoogleMap>
    </form>
</body>
</html>

That's it.
In short you have to probably play a while with CSS to make Height 100% working.

Hope this helps.

Regards,
Velio