This project has moved. For the latest updates, please go here.

SharpMap - Ajax Map Control not loaded with map image

Topics: SharpMap v0.9 / v1.x, Web Controls
Jul 8, 2011 at 11:01 PM


Below is my code. I am using SharpMap for my brother's college project. I had already used imagebutton control and its worked fine but each and every time page re-loads while clicking the map even though the page is ajax enabled. So we have decided to use SharpMap AjaxMap control, now the page loads but without the map image (only no image symbol is displayed).

Can you please guide us to how to use Ajax map control to show the map loaded from the database. Also small request to sharpmap team i think when compare imagebutton control with ajax image button control has very less code samples, so can anyone please upload extensive code samples using ajax control. Samples for mouseover tooltip or google like balloon tip is highly appreciated from database.

Note: Using sharpmap-85925 build


private SharpMap.Map myMap;
    private string mylayer = string.Empty;   
    SharpMap.Layers.VectorLayer layer = new SharpMap.Layers.VectorLayer("LayerName");

protected void Page_Load(object sender, EventArgs e)
        layer.DataSource = new SharpMap.Data.Providers.SqlServer2008(ConfigurationManager.ConnectionStrings["GeoDatabase"].ConnectionString,
            "dbo.NewBookFairShops", "geom","");

        imgMap.Map  = InitializeMapSQLKatmai(new System.Drawing.Size((int)imgMap.Width.Value, (int)imgMap.Height.Value));

        if (!Page.IsPostBack && !Page.IsCallback )
            imgMap.Map.Center = new SharpMap.Geometries.Point(0, 20);             
            imgMap.Map.Zoom  = 360;
            imgMap.FadeSpeed = 10;
            imgMap.ZoomSpeed = 10;   

        imgMap.ResponseFormat = "maphandler.ashx?MAP=WorldMap&Width=[WIDTH]&Height=[HEIGHT]&Zoom=[ZOOM]&X=[X]&Y=[Y]";