ajax sharpmap render problem

Topics: General Topics, SharpMap Project, Web Controls
Sep 24, 2010 at 5:56 AM

i made a website with ajax sharpmap component. it basically display a road map. but when i try to update the shapefiles in the APP folder, the roads appear as broken lines. whats seems to be the problem. the shapefiles is not corrupt or anything. please help.

Sep 24, 2010 at 1:18 PM

hello kyros,

when you say shapefile, you mean

  • <the shapefile>.shp (the shapefile),
  • <the shapefile>.dbf (attribute data) and
  • <the shapefile>.shx (spatial index)

as a whole? If not, you must copy the whole rack.

Hth FObermaier

Oct 6, 2010 at 2:17 AM

yes. actually its 5 files. thanks for the reply.

I've already resolved this issue by changing the last boolean parameter of ShapeFile() function into FALSE.

This also resolve the issue of some features in the map dissappears when you zoom in.

VectorLayer layRoads = new VectorLayer("Roads");

layRoads.DataSource =new ShapeFile(HttpContext.Current.Server.MapPath(@"~\App_Data\highway.shp"), false);


//<para>If FileBasedIndex is true, the spatial index will be read from a local copy. If it doesn't exist,
        /// it will be generated and saved to [filename] + '.sidx'.</para>
        /// <para>Using a file-based index is especially recommended for ASP.NET applications which will speed up
        /// start-up time when the cache has been emptied.

So after you have set the FilebaseIndex to false and the .sidx file is created, you can set it back to true again.