I am trying to dynamically add the map to a web page, but I get a Javascript Error? Any Ideas?
JavaScript Error:
Expected ';' Line 67 Char 40
<html xmlns="<a href="w3.org/1999/xhtml">w3.org/1999/xhtml</a>">
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test2.aspx.cs" Inherits="Test2" %>
<%@ Register Assembly="WebEdition" Namespace="ThinkGeo.MapSuite.WebEdition" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<%--<cc1:Map ID="Map1" runat="server" Height="400px" Width="800px"></cc1:Map> --%>
<asp:PlaceHolder ID="phMap" runat="server"></asp:PlaceHolder>
</form>
</body>
</html>
public partial class Test2 : System.Web.UI.Page } protected void Page_Init(object sender, EventArgs e) // We create a new Layer and pass the path to a Shapefile into its constructor. // Set the worldLayer with a preset Style, as AreaStyles.Country1 has YellowGreen background and black border, our worldLayer will have the same render style. // This setting will apply from ZoonLevel01 to ZoomLevel20, that means we can see the world the same style with ZoomLevel01 all the time no matter how far we zoom out/in. // We need to add the world layer to map's Static Overlay. // Set a proper extent for the map, that's the place you want it to display. }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ThinkGeo.MapSuite.Core;
using ThinkGeo.MapSuite.WebEdition;
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
}
{
Map Map1 = new Map();
Map1.Width = Unit.Pixel(800);
Map1.Height = Unit.Pixel(400);
// Set the Map Unit. The reason for setting it to DecimalDegrees is that is what the shapefile's unit of measure is inherently in.
Map1.MapUnit = GeographyUnit.DecimalDegree;
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(Server.MapPath("~/maps/States.shp"));
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level11;
Map1.StaticOverlay.Layers.Add(worldLayer);
//Map1.CurrentExtent = new RectangleShape(5, 78, 30, 26);
phMap.Controls.Add(Map1);
}
map.html (7.22 KB)
error.html (7.95 KB)