Index: src/Deltares.DSoilModel.Forms/DSoilModelMapEditor.cs
===================================================================
diff -u -r683 -r777
--- src/Deltares.DSoilModel.Forms/DSoilModelMapEditor.cs (.../DSoilModelMapEditor.cs) (revision 683)
+++ src/Deltares.DSoilModel.Forms/DSoilModelMapEditor.cs (.../DSoilModelMapEditor.cs) (revision 777)
@@ -35,6 +35,7 @@
using Deltares.Standard.Forms.DExpress;
using Deltares.Standard.Forms.Maps;
using Deltares.Standard.Language;
+using Deltares.Standard.Logging;
using Deltares.Standard.Maps;
using Deltares.Standard.Reflection;
using DevExpress.XtraBars;
@@ -401,34 +402,42 @@
{
// Labels can only be defined once a layer was actually added to the map
var featureLayer = layerEventArgs.Layer as FeatureLayer;
- if (featureLayer != null)
+ if (featureLayer != null && mapEditor.WebLayerType != MapEditor.WebLayerTypes.NoWebLayer)
{
- if (featureLayer.LabelLayer == null)
+ try
{
- if (featureLayer.FeatureSet.TypeName == typeof(ConePenetrationTestData).FullName ||
- featureLayer.FeatureSet.TypeName == typeof(Boring).FullName)
+ if (featureLayer.LabelLayer == null)
{
- featureLayer.AddLabels("[Name]", new Font(FontFamily.GenericSansSerif, labelFontSize), Color.Black);
- featureLayer.LabelLayer.Symbolizer.Orientation = ContentAlignment.TopCenter;
- featureLayer.LabelLayer.Symbolizer.OffsetY = 10;
- featureLayer.LabelLayer.DynamicVisibilityMode = DynamicVisibilityMode.ZoomedIn;
- featureLayer.LabelLayer.DynamicVisibilityWidth = 50000;
- featureLayer.LabelLayer.UseDynamicVisibility = true;
- featureLayer.ShowLabels = true;
+ if (featureLayer.FeatureSet.TypeName == typeof(ConePenetrationTestData).FullName ||
+ featureLayer.FeatureSet.TypeName == typeof(Boring).FullName)
+ {
+ featureLayer.AddLabels("[Name]", new Font(FontFamily.GenericSansSerif, labelFontSize), Color.Black);
+ featureLayer.LabelLayer.Symbolizer.Orientation = ContentAlignment.TopCenter;
+ featureLayer.LabelLayer.Symbolizer.OffsetY = 10;
+ featureLayer.LabelLayer.DynamicVisibilityMode = DynamicVisibilityMode.ZoomedIn;
+ featureLayer.LabelLayer.DynamicVisibilityWidth = 50000;
+ featureLayer.LabelLayer.UseDynamicVisibility = true;
+ featureLayer.ShowLabels = true;
+ }
+ else if (featureLayer.FeatureSet.TypeName == typeof(SoilSegment).FullName)
+ {
+ featureLayer.AddLabels("[Name]", new Font(FontFamily.GenericSansSerif, labelFontSize), Color.Black);
+ featureLayer.LabelLayer.Symbolizer.Orientation = ContentAlignment.TopCenter;
+ featureLayer.LabelLayer.Symbolizer.UseLineOrientation = true;
+ featureLayer.LabelLayer.Symbolizer.LineOrientation = LineOrientation.Parallel;
+ featureLayer.LabelLayer.Symbolizer.LineLabelPlacementMethod = LineLabelPlacementMethod.MiddleSegment;
+ featureLayer.LabelLayer.DynamicVisibilityMode = DynamicVisibilityMode.ZoomedIn;
+ featureLayer.LabelLayer.DynamicVisibilityWidth = 100000;
+ featureLayer.LabelLayer.UseDynamicVisibility = true;
+ featureLayer.ShowLabels = true;
+ }
}
- else if (featureLayer.FeatureSet.TypeName == typeof(SoilSegment).FullName)
- {
- featureLayer.AddLabels("[Name]", new Font(FontFamily.GenericSansSerif, labelFontSize), Color.Black);
- featureLayer.LabelLayer.Symbolizer.Orientation = ContentAlignment.TopCenter;
- featureLayer.LabelLayer.Symbolizer.UseLineOrientation = true;
- featureLayer.LabelLayer.Symbolizer.LineOrientation = LineOrientation.Parallel;
- featureLayer.LabelLayer.Symbolizer.LineLabelPlacementMethod = LineLabelPlacementMethod.MiddleSegment;
- featureLayer.LabelLayer.DynamicVisibilityMode = DynamicVisibilityMode.ZoomedIn;
- featureLayer.LabelLayer.DynamicVisibilityWidth = 100000;
- featureLayer.LabelLayer.UseDynamicVisibility = true;
- featureLayer.ShowLabels = true;
- }
}
+ catch (Exception ex)
+ {
+ var msg = string.Format(LocalizationManager.GetTranslatedText(this, "MapLabelError"), ex.Message);
+ LogManager.Add(new LogMessage(LogMessageType.Warning, null, msg));
+ }
}
}
Index: src/Deltares.DSoilModel.Forms/Translations.xml
===================================================================
diff -u -r654 -r777
--- src/Deltares.DSoilModel.Forms/Translations.xml (.../Translations.xml) (revision 654)
+++ src/Deltares.DSoilModel.Forms/Translations.xml (.../Translations.xml) (revision 777)
@@ -116,6 +116,6 @@
-
+