Tuesday, September 07, 2010

VE - putting a map inside of divs

Posted by david on 16. November 2008 22:02

So – next step is to see if my earlier problems were due to the controls being buried inside of divs. 

I’m going to try & nest the map control, with no other changes, into a styled page:

front code:

   1: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="2008_11_16_addWorkingMapIntoDivs.aspx.cs" Inherits="Storage_2008_11_16_addWorkingMapIntoDivs" %>
   2: <%@ Register Assembly="Microsoft.Live.ServerControls.VE"
   3:     Namespace="Microsoft.Live.ServerControls.VE"
   4:     TagPrefix="ve" %>
   5:     
   6: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   7: <html xmlns="http://www.w3.org/1999/xhtml">
   8: <head runat="server">
   9:     <title>Untitled Page</title>
  10:         <link href="DiveStyle.css" rel="stylesheet" type="text/css" /> 
  11: </head>
  12: <body>
  13:     <form id="form1" runat="server">        
  14:         <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
  15:         </asp:ScriptManager>
  16:         
  17:         <%
   1: -- TopBar --
%>
  18:         <div id='TopBar'>        
  19:         </div>
  20:         <%
   1: -- End TopBar --
%>
  21:         
  22:         <%
   1: --3ColumnsWrap -----------------------------------------------------------------
%>
  23:         <div id='3ColumnsWrap'>
  24:     
  25:             <%
   1: -- contentHeader  ( for response display ) --
%>
  26:             <div id='contentHeader'>
  27:             </div>    
  28:             <%
   1: -- End contentHeader --
%>
  29:             
  30:             <%
   1: -- LeftBar--------------
%>
  31:             <div id='LeftBar'>   
  32:             </div>    
  33:             <%
   1: -- End LeftBar --------------
%>
  34:             <%
   1: -- CenterBar--------------
%>
  35:             <div id='CenterBar'>
  36:             
  37:                 <%
   1: -- mapContainer--------------
%>
  38:                 <div id='mapContainer'>
  39:         <ve:Map ID="ScubaMap" runat="server" Height="600px" Width="600px" 
  40:             ZoomLevel="4" />
  41:                 </div>                
  42:                 <%
   1: -- End mapContainer--
%>
  43:                         
  44:             </div>
  45:             <%
   1: -- End CenterBar--
%>
  46:             
  47:         </div>
  48:         <%
   1: -- End 3ColumnWrap--
%>
  49:                     
  50:     </form>
  51: </body>
  52: </html>

behind code:

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Microsoft.Live.ServerControls.VE;
using System.Collections.Generic;
 
public partial class Storage_2008_11_16_addWorkingMapIntoDivs : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        // Seattle
        AddShape(47.60384, -122.33002);
    }
 
    private void AddShape(double latitude, double longitude)
    {
        LatLongWithAltitude point = new LatLongWithAltitude(latitude, longitude);
        Shape shape = new Shape(ShapeType.Pushpin, point);
        ScubaMap.AddShape(shape);
    }
}

& guess what   - it works just fine …. so nesting the control inside divs did nothing …

Comments

Add comment


 

biuquote
Loading