Hello,
I have set the "Visible=false" property on map since i want to show the map only when user press the "Show Map" button.
Now the problem is both Map and button is inside UpdatePanel. Show whn user click on the button then map is showing as blank.
here if i put "display:none" property then map is working but i dont want to load map on the page initially. i want to load the map only when user request it.
I have attached sample code of "DisplayASimpleMap" from your sample set with my modified code.
I have also use the google overlay and same issue is happening there also in sample "UseGoogleMap"
Do you have any workaround for this situation?
the sample code is
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DisplayASimpleMap.aspx.cs"
Inherits="CSSamples.Samples.DisplayASimpleMap" %>
<%@ Register Assembly="WebEdition" Namespace="ThinkGeo.MapSuite.WebEdition" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="w3.org/1999/xhtml">
<head runat="server">
<link href="~/theme/default/samplepic/style.css" rel="stylesheet" type="text/css" />
<title>Display a Simple Map</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID=upd runat=server>
<ContentTemplate>
<asp:Button ID="btnShowMap" runat="server" Text="Show Map" OnClick="btnShowMap_Click" />
<cc1:Map ID="Map1" runat="server" Width="100%" Height="100%" Visible="false">
</cc1:Map>
</asp:UpdatePanel>
<Description:DescriptionPanel ID="DescPanel" runat="server">
This sample simply uses ThinkGeo default world map kit service overlay.
</Description:DescriptionPanel>
</form>
</body>
</html>
using System;
using ThinkGeo.MapSuite.Core;
using ThinkGeo.MapSuite.WebEdition;
namespace CSSamples.Samples
{
public partial class DisplayASimpleMap : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"));
Map1.CurrentExtent = new RectangleShape(-125, 72, 50, -46);
Map1.MapUnit = GeographyUnit.DecimalDegree;
WorldMapKitWmsWebOverlay worldMapKitOverlay = new WorldMapKitWmsWebOverlay();
Map1.CustomOverlays.Add(worldMapKitOverlay);
}
}
protected void btnShowMap_Click(object sender, EventArgs e)
{
Map1.Visible = true;
}
}
}