label layer with shapefile and dbf file?

Dec 1, 2010 at 4:37 AM

I'm working with a shapefile with an associated dbf. The dbf contains column of names that I need render on the polygons in the shape file.

The shapefile renders fine but when I try and add a label layer, things get weird. Errors out saying ZoomtoExtents() not implemented.

Any suggestions?

Thanks...

 private SharpMap.Map InitializeMap(System.Drawing.Size outputsize)
 {
  //Initialize a new map of size 'imagesize'
  SharpMap.Map map = new SharpMap.Map(outputsize);

        string mypath = Server.MapPath(@"~\App_data\tx255ltr.shp");
    
  //Set up the OwnerBoundaries layer
  SharpMap.Layers.VectorLayer layOwnerBoundaries = new SharpMap.Layers.VectorLayer("OwnerBoundaries");
  //Set the datasource to a shapefile in the App_data folder
  layOwnerBoundaries.DataSource = new SharpMap.Providers.ShapeFile(mypath);
  //Set fill-style to green
  layOwnerBoundaries.Style.Fill = new SolidBrush(Color.Green);
  //Set the polygons to have a black outline
  layOwnerBoundaries.Style.Outline = System.Drawing.Pens.Black;
  layOwnerBoundaries.Style.EnableOutline = true;

        //Set up a OwnerNames layer
        SharpMap.Layers.LabelLayer layOwnerNames = new SharpMap.Layers.LabelLayer();
        //Set the datasource to a shapefile in the App_data folder
        layOwnerNames.DataSource = layOwnerBoundaries.DataSource;
        layOwnerNames.LabelColumn = "GRANTOR"; //column from tx255ltr.dbf
       
        layOwnerNames.Style = new SharpMap.Styles.LabelStyle();
        layOwnerNames.Style.ForeColor = Color.Black;
        layOwnerNames.Style.Font = new Font(FontFamily.GenericSerif, 8);
        layOwnerNames.Enabled = true;
     
  //Add the layers to the map object.
  //The order we add them in are the order they are drawn, so we add the OwnerNamess last to put them on top
  map.Layers.Add(layOwnerBoundaries);
  map.Layers.Add(layOwnerNames);
     
 
  return map;
 }


Coordinator
Dec 1, 2010 at 7:20 AM

Could you post a full stack trace please

Cheers FObermaier

Dec 1, 2010 at 1:55 PM

Thanks! Here it is...



The method or operation is not implemented. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Exception: The method or operation is not implemented.

Source Error: 


Line 28: 		{
Line 29: 			//This is the initial view of the map. Zoom to the extents of the map:
Line 30: 			myMap.ZoomToExtents();
Line 31:            
Line 32: 			//Save the current mapcenter and zoom in the viewstate
 

Source File: c:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx.cs    Line: 30 

Stack Trace: 


[Exception: The method or operation is not implemented.]
   SharpMap.Layers.LabelLayer.get_Envelope() +68
   SharpMap.Map.GetExtents() +204
   SharpMap.Map.ZoomToExtents() +37
   Default.Page_Load(Object sender, EventArgs e) in c:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx.cs:30
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +91
   System.Web.UI.Control.LoadRecursive() +74
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 
Coordinator
Dec 1, 2010 at 2:14 PM

strange....

A couple of questions:

  • Did you compile it yourself, if not please do so
  • If you did, is it the trunk version.
  • If not, which one is it.

Cheers FObermaier

 

Dec 1, 2010 at 2:53 PM

I downloaded Application SharpMap-0.9-Trunk-2010.10.21

I copied SharpMap.dll and SharpMap.xml into the Bin directory and updated the web.config file of my existing project.

I didn't compile anything. I'm not exactly sure how to...

What stumped me is that it works fine with the vector layer but chokes on the label layer.

Coordinator
Dec 1, 2010 at 3:19 PM

I'm puzzled, the Envelope_get method has been implemented at that time.

Do yourself a favor and get the source from the Sources tab (http://sharpmap.codeplex.com/SourceControl/list/changesets#) or get yourself a copy of TortoiseSVN and keep your source up to date.

Read this for further instructions.

Hth FObermaier

 

Dec 1, 2010 at 6:53 PM

Ok. Downloaded and compiled.

At least now its throwing a new error. Says it needs a reference to the namespace 'Providers'?

Thanks!

 

Compilation Error 
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS0234: The type or namespace name 'Providers' does not exist in the namespace 'SharpMap' (are you missing an assembly reference?)

Source Error:

 

Line 69: 		SharpMap.Layers.VectorLayer layOwnerBoundaries = new SharpMap.Layers.VectorLayer("OwnerBoundaries");
Line 70: 		//Set the datasource to a shapefile in the App_data folder
Line 71: 		layOwnerBoundaries.DataSource = new SharpMap.Providers.ShapeFile(mypath);
Line 72: 		//Set fill-style to green
Line 73: 		layOwnerBoundaries.Style.Fill = new SolidBrush(Color.Green);
 

Source File: c:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx.cs    Line: 71 



Show Detailed Compiler Output:


C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0> "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" /t:library /utf8output /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\assembly\dl3\35deee75\87530183_9091cb01\SharpMap.Extensions.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\assembly\dl3\6746d441\14b81ace_8e91cb01\NetTopologySuite.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\assembly\dl3\839ac731\487cf5cd_8e91cb01\GeoAPI.DLL" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\assembly\dl3\946d116b\88c91bce_8e91cb01\ProjNET.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\assembly\dl3\e7ae3fcb\aaabf1cd_8e91cb01\gdal_csharp.DLL" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Entity\v4.0_4.0.0.0__b77a5c561934e089\System.Web.Entity.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\assembly\dl3\b317912d\d8e0fdcd_8e91cb01\Oracle.DataAccess.DLL" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\assembly\dl3\488f23d2\74f6fccd_8e91cb01\ogr_csharp.DLL" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\assembly\dl3\39ee5713\e74cf9cd_8e91cb01\Npgsql.DLL" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\assembly\dl3\d80f5caf\8b18f6cd_8e91cb01\Mono.Security.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\assembly\dl3\70484a79\81dd08ce_8e91cb01\BruTile.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\assembly\dl3\edbf811d\f2f7ad0e_8f91cb01\SharpMap.DLL" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\assembly\dl3\f098d246\6d40ffcd_8e91cb01\osr_csharp.DLL" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\assembly\dl3\ec12817f\e15100ce_8e91cb01\PostgreSql.Data.PostgreSqlClient.DLL" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\assembly\dl3\98ee4ae6\23ee00ce_8e91cb01\System.Data.SQLite.DLL" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll" /out:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\App_Web_mjjie2xt.dll" /D:DEBUG /debug+ /optimize- /w:4 /nowarn:1659;1699;1701 /warnaserror-  "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\App_Web_mjjie2xt.0.cs" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\App_Web_mjjie2xt.1.cs" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ccr\6039668b\43e40420\App_Web_mjjie2xt.2.cs"


Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1
Copyright (C) Microsoft Corporation. All rights reserved.

c:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx.cs(71,48): error CS0234: The type or namespace name 'Providers' does not exist in the namespace 'SharpMap' (are you missing an assembly reference?)

 



Show Complete Compilation Source:


Line 1:    #pragma checksum "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "B9C59731013F2E3D5178E916CFFCF697"
Line 2:    //------------------------------------------------------------------------------
Line 3:    // 
Line 4:    //     This code was generated by a tool.
Line 5:    //     Runtime Version:4.0.30319.1
Line 6:    //
Line 7:    //     Changes to this file may cause incorrect behavior and will be lost if
Line 8:    //     the code is regenerated.
Line 9:    // 
Line 10:   //------------------------------------------------------------------------------
Line 11:   
Line 12:   
Line 13:   
Line 14:   public partial class Default : System.Web.SessionState.IRequiresSessionState {
Line 15:       
Line 16:       
Line 17:       #line 10 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 18:       protected global::System.Web.UI.WebControls.RadioButtonList rblMapTools;
Line 19:       
Line 20:       #line default
Line 21:       #line hidden
Line 22:       
Line 23:       
Line 24:       #line 15 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 25:       protected global::System.Web.UI.WebControls.ImageButton imgMap;
Line 26:       
Line 27:       #line default
Line 28:       #line hidden
Line 29:       
Line 30:       protected System.Web.Profile.DefaultProfile Profile {
Line 31:           get {
Line 32:               return ((System.Web.Profile.DefaultProfile)(this.Context.Profile));
Line 33:           }
Line 34:       }
Line 35:       
Line 36:       protected System.Web.HttpApplication ApplicationInstance {
Line 37:           get {
Line 38:               return ((System.Web.HttpApplication)(this.Context.ApplicationInstance));
Line 39:           }
Line 40:       }
Line 41:   }
Line 42:   namespace ASP {
Line 43:       
Line 44:       #line 389 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 45:       using System.Linq;
Line 46:       
Line 47:       #line default
Line 48:       #line hidden
Line 49:       
Line 50:       #line 385 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 51:       using System.Collections.Generic;
Line 52:       
Line 53:       #line default
Line 54:       #line hidden
Line 55:       
Line 56:       #line 402 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 57:       using System.Xml.Linq;
Line 58:       
Line 59:       #line default
Line 60:       #line hidden
Line 61:       
Line 62:       #line 10 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 63:       using System.Web.UI.WebControls;
Line 64:       
Line 65:       #line default
Line 66:       #line hidden
Line 67:       
Line 68:       #line 392 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 69:       using System.Web;
Line 70:       
Line 71:       #line default
Line 72:       #line hidden
Line 73:       
Line 74:       #line 383 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 75:       using System;
Line 76:       
Line 77:       #line default
Line 78:       #line hidden
Line 79:       
Line 80:       #line 10 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 81:       using System.Web.UI;
Line 82:       
Line 83:       #line default
Line 84:       #line hidden
Line 85:       
Line 86:       #line 401 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 87:       using System.Web.UI.HtmlControls;
Line 88:       
Line 89:       #line default
Line 90:       #line hidden
Line 91:       
Line 92:       #line 396 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 93:       using System.Web.Security;
Line 94:       
Line 95:       #line default
Line 96:       #line hidden
Line 97:       
Line 98:       #line 391 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 99:       using System.Text.RegularExpressions;
Line 100:      
Line 101:      #line default
Line 102:      #line hidden
Line 103:      
Line 104:      #line 388 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 105:      using System.Configuration;
Line 106:      
Line 107:      #line default
Line 108:      #line hidden
Line 109:      
Line 110:      #line 387 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 111:      using System.ComponentModel.DataAnnotations;
Line 112:      
Line 113:      #line default
Line 114:      #line hidden
Line 115:      
Line 116:      #line 390 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 117:      using System.Text;
Line 118:      
Line 119:      #line default
Line 120:      #line hidden
Line 121:      
Line 122:      #line 397 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 123:      using System.Web.Profile;
Line 124:      
Line 125:      #line default
Line 126:      #line hidden
Line 127:      
Line 128:      #line 393 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 129:      using System.Web.Caching;
Line 130:      
Line 131:      #line default
Line 132:      #line hidden
Line 133:      
Line 134:      #line 384 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 135:      using System.Collections;
Line 136:      
Line 137:      #line default
Line 138:      #line hidden
Line 139:      
Line 140:      #line 10 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 141:      using System.Web.UI.WebControls.WebParts;
Line 142:      
Line 143:      #line default
Line 144:      #line hidden
Line 145:      
Line 146:      #line 10 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 147:      using System.Web.UI.WebControls.Expressions;
Line 148:      
Line 149:      #line default
Line 150:      #line hidden
Line 151:      
Line 152:      #line 386 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 153:      using System.Collections.Specialized;
Line 154:      
Line 155:      #line default
Line 156:      #line hidden
Line 157:      
Line 158:      #line 395 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 159:      using System.Web.SessionState;
Line 160:      
Line 161:      #line default
Line 162:      #line hidden
Line 163:      
Line 164:      #line 10 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 165:      using System.Web.DynamicData;
Line 166:      
Line 167:      #line default
Line 168:      #line hidden
Line 169:      
Line 170:      
Line 171:      [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
Line 172:      public class sharpmap_aspx : global::Default, System.Web.IHttpHandler {
Line 173:          
Line 174:          private static bool @__initialized;
Line 175:          
Line 176:          private static object @__fileDependencies;
Line 177:          
Line 178:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 179:          public sharpmap_aspx() {
Line 180:              string[] dependencies;
Line 181:              
Line 182:              #line 912304 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx.cs"
Line 183:              ((global::System.Web.UI.Page)(this)).AppRelativeVirtualPath = "~/sharpmap.aspx";
Line 184:              
Line 185:              #line default
Line 186:              #line hidden
Line 187:              if ((global::ASP.sharpmap_aspx.@__initialized == false)) {
Line 188:                  dependencies = new string[2];
Line 189:                  dependencies[0] = "~/sharpmap.aspx";
Line 190:                  dependencies[1] = "~/sharpmap.aspx.cs";
Line 191:                  global::ASP.sharpmap_aspx.@__fileDependencies = this.GetWrappedFileDependencies(dependencies);
Line 192:                  global::ASP.sharpmap_aspx.@__initialized = true;
Line 193:              }
Line 194:              this.Server.ScriptTimeout = 30000000;
Line 195:          }
Line 196:          
Line 197:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 198:          private global::System.Web.UI.HtmlControls.HtmlTitle @__BuildControl__control3() {
Line 199:              global::System.Web.UI.HtmlControls.HtmlTitle @__ctrl;
Line 200:              
Line 201:              #line 5 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 202:              @__ctrl = new global::System.Web.UI.HtmlControls.HtmlTitle();
Line 203:              
Line 204:              #line default
Line 205:              #line hidden
Line 206:              System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
Line 207:              
Line 208:              #line 5 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 209:              @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("Creating an interactive map in ASP.NET 2.0 using SharpMap"));
Line 210:              
Line 211:              #line default
Line 212:              #line hidden
Line 213:              return @__ctrl;
Line 214:          }
Line 215:          
Line 216:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 217:          private global::System.Web.UI.HtmlControls.HtmlHead @__BuildControl__control2() {
Line 218:              global::System.Web.UI.HtmlControls.HtmlHead @__ctrl;
Line 219:              
Line 220:              #line 4 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 221:              @__ctrl = new global::System.Web.UI.HtmlControls.HtmlHead("head");
Line 222:              
Line 223:              #line default
Line 224:              #line hidden
Line 225:              global::System.Web.UI.HtmlControls.HtmlTitle @__ctrl1;
Line 226:              
Line 227:              #line 4 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 228:              @__ctrl1 = this.@__BuildControl__control3();
Line 229:              
Line 230:              #line default
Line 231:              #line hidden
Line 232:              System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
Line 233:              
Line 234:              #line 4 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 235:              @__parser.AddParsedSubObject(@__ctrl1);
Line 236:              
Line 237:              #line default
Line 238:              #line hidden
Line 239:              return @__ctrl;
Line 240:          }
Line 241:          
Line 242:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 243:          private global::System.Web.UI.WebControls.ListItem @__BuildControl__control6() {
Line 244:              global::System.Web.UI.WebControls.ListItem @__ctrl;
Line 245:              
Line 246:              #line 11 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 247:              @__ctrl = new global::System.Web.UI.WebControls.ListItem();
Line 248:              
Line 249:              #line default
Line 250:              #line hidden
Line 251:              
Line 252:              #line 11 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 253:              @__ctrl.Value = "0";
Line 254:              
Line 255:              #line default
Line 256:              #line hidden
Line 257:              
Line 258:              #line 11 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 259:              @__ctrl.Text = "Zoom in";
Line 260:              
Line 261:              #line default
Line 262:              #line hidden
Line 263:              return @__ctrl;
Line 264:          }
Line 265:          
Line 266:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 267:          private global::System.Web.UI.WebControls.ListItem @__BuildControl__control7() {
Line 268:              global::System.Web.UI.WebControls.ListItem @__ctrl;
Line 269:              
Line 270:              #line 12 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 271:              @__ctrl = new global::System.Web.UI.WebControls.ListItem();
Line 272:              
Line 273:              #line default
Line 274:              #line hidden
Line 275:              
Line 276:              #line 12 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 277:              @__ctrl.Value = "1";
Line 278:              
Line 279:              #line default
Line 280:              #line hidden
Line 281:              
Line 282:              #line 12 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 283:              @__ctrl.Text = "Zoom out";
Line 284:              
Line 285:              #line default
Line 286:              #line hidden
Line 287:              return @__ctrl;
Line 288:          }
Line 289:          
Line 290:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 291:          private global::System.Web.UI.WebControls.ListItem @__BuildControl__control8() {
Line 292:              global::System.Web.UI.WebControls.ListItem @__ctrl;
Line 293:              
Line 294:              #line 13 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 295:              @__ctrl = new global::System.Web.UI.WebControls.ListItem();
Line 296:              
Line 297:              #line default
Line 298:              #line hidden
Line 299:              
Line 300:              #line 13 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 301:              @__ctrl.Value = "2";
Line 302:              
Line 303:              #line default
Line 304:              #line hidden
Line 305:              
Line 306:              #line 13 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 307:              @__ctrl.Selected = true;
Line 308:              
Line 309:              #line default
Line 310:              #line hidden
Line 311:              
Line 312:              #line 13 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 313:              @__ctrl.Text = "Pan";
Line 314:              
Line 315:              #line default
Line 316:              #line hidden
Line 317:              return @__ctrl;
Line 318:          }
Line 319:          
Line 320:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 321:          private void @__BuildControl__control5(System.Web.UI.WebControls.ListItemCollection @__ctrl) {
Line 322:              global::System.Web.UI.WebControls.ListItem @__ctrl1;
Line 323:              
Line 324:              #line 10 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 325:              @__ctrl1 = this.@__BuildControl__control6();
Line 326:              
Line 327:              #line default
Line 328:              #line hidden
Line 329:              
Line 330:              #line 10 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 331:              @__ctrl.Add(@__ctrl1);
Line 332:              
Line 333:              #line default
Line 334:              #line hidden
Line 335:              global::System.Web.UI.WebControls.ListItem @__ctrl2;
Line 336:              
Line 337:              #line 10 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 338:              @__ctrl2 = this.@__BuildControl__control7();
Line 339:              
Line 340:              #line default
Line 341:              #line hidden
Line 342:              
Line 343:              #line 10 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 344:              @__ctrl.Add(@__ctrl2);
Line 345:              
Line 346:              #line default
Line 347:              #line hidden
Line 348:              global::System.Web.UI.WebControls.ListItem @__ctrl3;
Line 349:              
Line 350:              #line 10 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 351:              @__ctrl3 = this.@__BuildControl__control8();
Line 352:              
Line 353:              #line default
Line 354:              #line hidden
Line 355:              
Line 356:              #line 10 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 357:              @__ctrl.Add(@__ctrl3);
Line 358:              
Line 359:              #line default
Line 360:              #line hidden
Line 361:          }
Line 362:          
Line 363:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 364:          private global::System.Web.UI.WebControls.RadioButtonList @__BuildControlrblMapTools() {
Line 365:              global::System.Web.UI.WebControls.RadioButtonList @__ctrl;
Line 366:              
Line 367:              #line 10 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 368:              @__ctrl = new global::System.Web.UI.WebControls.RadioButtonList();
Line 369:              
Line 370:              #line default
Line 371:              #line hidden
Line 372:              this.rblMapTools = @__ctrl;
Line 373:              @__ctrl.ApplyStyleSheetSkin(this);
Line 374:              
Line 375:              #line 10 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 376:              @__ctrl.ID = "rblMapTools";
Line 377:              
Line 378:              #line default
Line 379:              #line hidden
Line 380:              
Line 381:              #line 10 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 382:              @__ctrl.RepeatDirection = global::System.Web.UI.WebControls.RepeatDirection.Horizontal;
Line 383:              
Line 384:              #line default
Line 385:              #line hidden
Line 386:              
Line 387:              #line 10 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 388:              this.@__BuildControl__control5(@__ctrl.Items);
Line 389:              
Line 390:              #line default
Line 391:              #line hidden
Line 392:              return @__ctrl;
Line 393:          }
Line 394:          
Line 395:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 396:          private global::System.Web.UI.WebControls.ImageButton @__BuildControlimgMap() {
Line 397:              global::System.Web.UI.WebControls.ImageButton @__ctrl;
Line 398:              
Line 399:              #line 15 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 400:              @__ctrl = new global::System.Web.UI.WebControls.ImageButton();
Line 401:              
Line 402:              #line default
Line 403:              #line hidden
Line 404:              this.imgMap = @__ctrl;
Line 405:              @__ctrl.ApplyStyleSheetSkin(this);
Line 406:              
Line 407:              #line 15 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 408:              @__ctrl.Width = new System.Web.UI.WebControls.Unit(687D, global::System.Web.UI.WebControls.UnitType.Pixel);
Line 409:              
Line 410:              #line default
Line 411:              #line hidden
Line 412:              
Line 413:              #line 15 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 414:              @__ctrl.Height = new System.Web.UI.WebControls.Unit(473D, global::System.Web.UI.WebControls.UnitType.Pixel);
Line 415:              
Line 416:              #line default
Line 417:              #line hidden
Line 418:              
Line 419:              #line 15 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 420:              @__ctrl.ID = "imgMap";
Line 421:              
Line 422:              #line default
Line 423:              #line hidden
Line 424:              
Line 425:              #line 15 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 426:              ((System.Web.UI.IAttributeAccessor)(@__ctrl)).SetAttribute("style", "border: 1px solid #000;");
Line 427:              
Line 428:              #line default
Line 429:              #line hidden
Line 430:              
Line 431:              #line 15 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 432:              @__ctrl.BackColor = ((System.Drawing.Color)(global::System.Drawing.Color.FromArgb(153, 153, 153)));
Line 433:              
Line 434:              #line default
Line 435:              #line hidden
Line 436:              
Line 437:              #line 15 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 438:              @__ctrl.Click += new System.Web.UI.ImageClickEventHandler(this.imgMap_Click);
Line 439:              
Line 440:              #line default
Line 441:              #line hidden
Line 442:              return @__ctrl;
Line 443:          }
Line 444:          
Line 445:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 446:          private global::System.Web.UI.HtmlControls.HtmlForm @__BuildControl__control4() {
Line 447:              global::System.Web.UI.HtmlControls.HtmlForm @__ctrl;
Line 448:              
Line 449:              #line 8 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 450:              @__ctrl = new global::System.Web.UI.HtmlControls.HtmlForm();
Line 451:              
Line 452:              #line default
Line 453:              #line hidden
Line 454:              System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
Line 455:              
Line 456:              #line 8 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx"
Line 457:              @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n    
\r\n \t")); Line 458: Line 459: #line default Line 460: #line hidden Line 461: global::System.Web.UI.WebControls.RadioButtonList @__ctrl1; Line 462: Line 463: #line 8 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx" Line 464: @__ctrl1 = this.@__BuildControlrblMapTools(); Line 465: Line 466: #line default Line 467: #line hidden Line 468: Line 469: #line 8 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx" Line 470: @__parser.AddParsedSubObject(@__ctrl1); Line 471: Line 472: #line default Line 473: #line hidden Line 474: Line 475: #line 8 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx" Line 476: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n ")); Line 477: Line 478: #line default Line 479: #line hidden Line 480: global::System.Web.UI.WebControls.ImageButton @__ctrl2; Line 481: Line 482: #line 8 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx" Line 483: @__ctrl2 = this.@__BuildControlimgMap(); Line 484: Line 485: #line default Line 486: #line hidden Line 487: Line 488: #line 8 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx" Line 489: @__parser.AddParsedSubObject(@__ctrl2); Line 490: Line 491: #line default Line 492: #line hidden Line 493: Line 494: #line 8 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx" Line 495: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n
\r\n")); Line 496: Line 497: #line default Line 498: #line hidden Line 499: return @__ctrl; Line 500: } Line 501: Line 502: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 503: private void @__BuildControlTree(sharpmap_aspx @__ctrl) { Line 504: Line 505: #line 1 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx" Line 506: this.InitializeCulture(); Line 507: Line 508: #line default Line 509: #line hidden Line 510: System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl)); Line 511: Line 512: #line 1 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx" Line 513: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n<!--CTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11" + Line 514: "/DTD/xhtml11.dtd-->\r\n\r\n")); Line 515: Line 516: #line default Line 517: #line hidden Line 518: global::System.Web.UI.HtmlControls.HtmlHead @__ctrl1; Line 519: Line 520: #line 1 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx" Line 521: @__ctrl1 = this.@__BuildControl__control2(); Line 522: Line 523: #line default Line 524: #line hidden Line 525: Line 526: #line 1 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx" Line 527: @__parser.AddParsedSubObject(@__ctrl1); Line 528: Line 529: #line default Line 530: #line hidden Line 531: Line 532: #line 1 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx" Line 533: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n\r\n")); Line 534: Line 535: #line default Line 536: #line hidden Line 537: global::System.Web.UI.HtmlControls.HtmlForm @__ctrl2; Line 538: Line 539: #line 1 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx" Line 540: @__ctrl2 = this.@__BuildControl__control4(); Line 541: Line 542: #line default Line 543: #line hidden Line 544: Line 545: #line 1 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx" Line 546: @__parser.AddParsedSubObject(@__ctrl2); Line 547: Line 548: #line default Line 549: #line hidden Line 550: Line 551: #line 1 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx" Line 552: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n\r\n\r\n\r\n")); Line 553: Line 554: #line default Line 555: #line hidden Line 556: } Line 557: Line 558: Line 559: #line 912304 "C:\ltg\My Web Sites\stratfordpl350g3\ad\ccr\sharpmap.aspx.cs" Line 560: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 561: protected override void FrameworkInitialize() { Line 562: base.FrameworkInitialize(); Line 563: this.@__BuildControlTree(this); Line 564: this.AddWrappedFileDependencies(global::ASP.sharpmap_aspx.@__fileDependencies); Line 565: this.Request.ValidateInput(); Line 566: } Line 567: Line 568: #line default Line 569: #line hidden Line 570: Line 571: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 572: public override int GetTypeHashCode() { Line 573: return 1672699935; Line 574: } Line 575: Line 576: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 577: public override void ProcessRequest(System.Web.HttpContext context) { Line 578: base.ProcessRequest(context); Line 579: } Line 580: } Line 581: } Line 582: -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
Coordinator
Dec 2, 2010 at 8:03 AM

Did you add your WebApplication to the sharpmap solution or did you copy the dll's?

For debugging purposes I'd suggest you do the first.

Hth FObermaier

Dec 2, 2010 at 7:32 PM

Got it!

After using a newer version SharpMap.dll I had to change:

= new SharpMap.Providers.ShapeFile(mypath);

to

= new SharpMap.Data.Providers.ShapeFile(mypath);

Thanks for the help.

Is there any sample code that shows out to search for a row in the dbf file and zoom to its corresponding polygon in the shp file?