-
Notifications
You must be signed in to change notification settings - Fork 2
Description
This is extracted from SharpMap/SharpMap#58:
@ekoswr wrote:
Dear Felix and Sharpmap Gurus
Thank you so much for the great code you made and maintain so far.
I have the same problem with aviabunin, when i try to load arond 10,000 points or more on the map. we have feature on our map applications to show the vehicle's GPS coordinate history along the road and when we reach to around 10,000 points, the map form is become very slow and sometime not responding when we do the zoom or pan. Other than the point we also have polygon, circle and line layer but not as much as the GPS points layer. we taken the data from MSSQL.
the code listing to load the GPS layer is below.
public static void AddGPSHistoryLayerFromFeature(SharpMap.Map aMapParent, SharpMap.Data.FeatureDataTable aFeature, bool aVisible)
{
MineDispatch.Helper.MapControls.RemoveLayer(aMapParent, "GPSHistory");
if (aFeature != null)
{
try
{
SharpMap.Layers.VectorLayer vlHistory = new SharpMap.Layers.VectorLayer("GPSHistory");
vlHistory.DataSource = new SharpMap.Data.Providers.DataTableFeatureProvider(aFeature);
vlHistory.Visible = aVisible;
vlHistory.SRID = mapSrid;
vlHistory.Theme = new SharpMap.Rendering.Thematics.CustomTheme(
new SharpMap.Rendering.Thematics.CustomTheme.GetStyleMethod(GetGPSPointCustomStyle));
vlHistory.ShowInLegend = false;
aMapParent.Layers.Add(vlHistory);
}
catch (Exception ex)
{
string exMsg = ex.Message;
if (ex.InnerException != null)
{
exMsg += "\r\nInner Exception:\r\n" +
ex.InnerException
+ "\r\n"
+ ex.InnerException.StackTrace;
}
MineDispatch.Helper.ErrorLog.WriteToLog("AppException", "[MapControls.AddGPSHistoryLayerFromFeature] " + exMsg);
}
}
}
I desperately need this problem to be solve, please let me know what i need to provide in order for you and Sharpmap gurus to help me.
Many Thanks!