Problems DemoWebSite

Topics: Algorithms, Español, General Topics, Italiano, SharpMap Project, SharpMap v0.9 / v1.x, Web Controls
Apr 7, 2011 at 9:12 AM

Hi everybody,

I am trying to run the DemoWebSite. I use Apache 2.2 with a module "aspdotnet" to run ASP.NET. Also I have configured PostGis and Gdal correctly.

There are several examples in the Demo, but when I tried to run them, only works the gradient example. If I run the Simple example, the map does not shown. The only difference between gradient and simple example that I have appreciated is the way to generate a map in the function GenerateMap():

// SIMPLE
private void GenerateMap()
    {
        //Save the current mapcenter and zoom in the viewstate
        ViewState.Add("mapCenter", myMap.Center);
        ViewState.Add("mapZoom", myMap.Zoom);
        
        //Render map
        Image img = myMap.GetMap();
        string imgID = Caching.InsertIntoCache(1, img);
        imgMap.ImageUrl = "getmap.aspx?ID=" +  HttpUtility.UrlEncode(imgID);
    }
     
//GRADIENT
private void GenerateMap()
    {
        //Save the current mapcenter and zoom in the viewstate
        ViewState.Add("mapCenter", Center);
        ViewState.Add("mapZoom", Zoom);

        string ResponseFormat = "maphandler.ashx?MAP=Gradient&Width=[WIDTH]&Height=[HEIGHT]&Zoom=[ZOOM]&X=[X]&Y=[Y]";
        NumberFormatInfo numberFormat_EnUS = new CultureInfo("en-US", false).NumberFormat;
        imgMap.ImageUrl = ResponseFormat.Replace("[WIDTH]", imgMap.Width.Value.ToString()).
            Replace("[HEIGHT]", imgMap.Height.Value.ToString()).
            Replace("[ZOOM]", Zoom.ToString(numberFormat_EnUS)).
            Replace("[X]", Center.X.ToString(numberFormat_EnUS)).
            Replace("[Y]", Center.Y.ToString(numberFormat_EnUS));
    }

I think if nobody has problems with this example, maybe the problem is with the Apache 2.2 and module for ASP.NET, it is possible? I would appreciate your help!

Thanks for advance.

Apr 7, 2011 at 9:53 AM

Sorry friends,

The problem come from my Apache server. If I use ISS this problem is solved. It is all.

Thanks.