Index: Core/Plugins/src/Core.Plugins.Map/Properties/Resources.Designer.cs
===================================================================
diff -u -reb86c18d67960b58fb41105bd161b743134aeb87 -rd1b19bb139550ae19f474c28f94ff3329cae0236
--- Core/Plugins/src/Core.Plugins.Map/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision eb86c18d67960b58fb41105bd161b743134aeb87)
+++ Core/Plugins/src/Core.Plugins.Map/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision d1b19bb139550ae19f474c28f94ff3329cae0236)
@@ -175,6 +175,24 @@
}
///
+ /// Looks up a localized string similar to Toont de eigenschap op basis waarvan de kaartlaag is gecategoriseerd..
+ ///
+ public static string FeatureBasedMapdata_MapThemeAttributeName_Description {
+ get {
+ return ResourceManager.GetString("FeatureBasedMapdata_MapThemeAttributeName_Description", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Op basis van.
+ ///
+ public static string FeatureBasedMapdata_MapThemeAttributeName_DisplayName {
+ get {
+ return ResourceManager.GetString("FeatureBasedMapdata_MapThemeAttributeName_DisplayName", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Toont de eigenschap op basis waarvan labels worden weergegeven op deze kaartlaag..
///
public static string FeatureBasedMapdata_SelectedMetaDataAttribute_Description {
@@ -211,6 +229,42 @@
}
///
+ /// Looks up a localized string similar to Categorie.
+ ///
+ public static string FeatureBasedMapData_StyleType_Categories {
+ get {
+ return ResourceManager.GetString("FeatureBasedMapData_StyleType_Categories", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Het type van de stijl die is wordt toegepast voor het weergeven van deze kaartlaag..
+ ///
+ public static string FeatureBasedMapdata_StyleType_Description {
+ get {
+ return ResourceManager.GetString("FeatureBasedMapdata_StyleType_Description", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Type.
+ ///
+ public static string FeatureBasedMapdata_StyleType_DisplayName {
+ get {
+ return ResourceManager.GetString("FeatureBasedMapdata_StyleType_DisplayName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Enkel symbool.
+ ///
+ public static string FeatureBasedMapData_StyleType_Single_symbol {
+ get {
+ return ResourceManager.GetString("FeatureBasedMapData_StyleType_Single_symbol", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Het type van de data die wordt weergegeven op deze kaartlaag..
///
public static string FeatureBasedMapData_Type_Description {
Index: Core/Plugins/src/Core.Plugins.Map/Properties/Resources.resx
===================================================================
diff -u -reb86c18d67960b58fb41105bd161b743134aeb87 -rd1b19bb139550ae19f474c28f94ff3329cae0236
--- Core/Plugins/src/Core.Plugins.Map/Properties/Resources.resx (.../Resources.resx) (revision eb86c18d67960b58fb41105bd161b743134aeb87)
+++ Core/Plugins/src/Core.Plugins.Map/Properties/Resources.resx (.../Resources.resx) (revision d1b19bb139550ae19f474c28f94ff3329cae0236)
@@ -340,4 +340,22 @@
{0} ≠ {1}
+
+ Toont de eigenschap op basis waarvan de kaartlaag is gecategoriseerd.
+
+
+ Op basis van
+
+
+ Het type van de stijl die is wordt toegepast voor het weergeven van deze kaartlaag.
+
+
+ Type
+
+
+ Categorie
+
+
+ Enkel symbool
+
\ No newline at end of file
Index: Core/Plugins/src/Core.Plugins.Map/PropertyClasses/FeatureBasedMapDataProperties.cs
===================================================================
diff -u -r83ac738ad69ef53eba6ca4f647657e5b7f024b96 -rd1b19bb139550ae19f474c28f94ff3329cae0236
--- Core/Plugins/src/Core.Plugins.Map/PropertyClasses/FeatureBasedMapDataProperties.cs (.../FeatureBasedMapDataProperties.cs) (revision 83ac738ad69ef53eba6ca4f647657e5b7f024b96)
+++ Core/Plugins/src/Core.Plugins.Map/PropertyClasses/FeatureBasedMapDataProperties.cs (.../FeatureBasedMapDataProperties.cs) (revision d1b19bb139550ae19f474c28f94ff3329cae0236)
@@ -42,6 +42,8 @@
private const int isVisiblePropertyIndex = 2;
private const int showLabelsPropertyIndex = 3;
private const int selectedMetaDataAttributePropertyIndex = 4;
+ private const int styleTypePropertyIndex = 5;
+ private const int mapThemeAttributeNamePropertyIndex = 6;
[PropertyOrder(namePropertyIndex)]
[ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Layer))]
@@ -96,6 +98,38 @@
}
}
+ [PropertyOrder(styleTypePropertyIndex)]
+ [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Styling))]
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.FeatureBasedMapdata_StyleType_DisplayName))]
+ [ResourcesDescription(typeof(Resources), nameof(Resources.FeatureBasedMapdata_StyleType_Description))]
+ public string StyleType
+ {
+ get
+ {
+ if (data.MapTheme != null)
+ {
+ return Resources.FeatureBasedMapData_StyleType_Categories;
+ }
+
+ return Resources.FeatureBasedMapData_StyleType_Single_symbol;
+ }
+ }
+
+ [PropertyOrder(mapThemeAttributeNamePropertyIndex)]
+ [DynamicVisible]
+ [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Styling))]
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.FeatureBasedMapdata_MapThemeAttributeName_DisplayName))]
+ [ResourcesDescription(typeof(Resources), nameof(Resources.FeatureBasedMapdata_MapThemeAttributeName_Description))]
+ public string MapThemeAttributeName
+ {
+ get
+ {
+ return data.MapTheme != null
+ ? data.MapTheme.AttributeName
+ : string.Empty;
+ }
+ }
+
[PropertyOrder(selectedMetaDataAttributePropertyIndex)]
[DynamicVisible]
[DynamicReadOnly]
@@ -119,13 +153,29 @@
[DynamicReadOnlyValidationMethod]
public bool DynamicReadonlyValidator(string propertyName)
{
- return !data.MetaData.Any();
+ if (propertyName == nameof(ShowLabels)
+ || propertyName == nameof(SelectedMetaDataAttribute))
+ {
+ return !data.MetaData.Any();
+ }
+
+ return false;
}
[DynamicVisibleValidationMethod]
public bool DynamicVisibleValidationMethod(string propertyName)
{
- return data.ShowLabels;
+ if (propertyName == nameof(SelectedMetaDataAttribute))
+ {
+ return data.ShowLabels;
+ }
+
+ if (propertyName == nameof(MapThemeAttributeName))
+ {
+ return data.MapTheme != null;
+ }
+
+ return false;
}
public IEnumerable GetAvailableMetaDataAttributes()
Index: Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/FeatureBasedMapDataPropertiesTest.cs
===================================================================
diff -u -r3178e116f5e59e03078d465efeb303c5e232c7bf -rd1b19bb139550ae19f474c28f94ff3329cae0236
--- Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/FeatureBasedMapDataPropertiesTest.cs (.../FeatureBasedMapDataPropertiesTest.cs) (revision 3178e116f5e59e03078d465efeb303c5e232c7bf)
+++ Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/FeatureBasedMapDataPropertiesTest.cs (.../FeatureBasedMapDataPropertiesTest.cs) (revision d1b19bb139550ae19f474c28f94ff3329cae0236)
@@ -27,6 +27,8 @@
using Core.Components.Gis.Data;
using Core.Components.Gis.Features;
using Core.Components.Gis.Geometries;
+using Core.Components.Gis.TestUtil;
+using Core.Components.Gis.Theme;
using Core.Plugins.Map.PropertyClasses;
using Core.Plugins.Map.UITypeEditors;
using NUnit.Framework;
@@ -42,6 +44,8 @@
private const int isVisiblePropertyIndex = 2;
private const int showLabelsPropertyIndex = 3;
private const int selectedMetaDataAttributePropertyIndex = 4;
+ private const int stylePropertyIndex = 5;
+ private const int mapThemeAttributeNamePropertyIndex = 5;
[Test]
public void Constructor_ExpectedValues()
@@ -56,10 +60,20 @@
}
[Test]
- public void Data_SetNewMapPointDataInstance_ReturnCorrectPropertyValues()
+ [TestCase(true)]
+ [TestCase(false)]
+ public void Data_SetNewMapPointDataInstance_ReturnCorrectPropertyValues(bool hasMapTheme)
{
// Setup
- var mapPointData = new MapPointData("Test");
+ var mapPointData = new MapPointData("Test")
+ {
+ MapTheme = hasMapTheme
+ ? new MapTheme("Attribute", new[]
+ {
+ CategoryThemeTestFactory.CreateCategoryTheme()
+ })
+ : null
+ };
var properties = new TestFeatureBasedMapDataProperties();
// Call
@@ -72,6 +86,16 @@
Assert.AreEqual(mapPointData.ShowLabels, properties.ShowLabels);
Assert.IsEmpty(properties.SelectedMetaDataAttribute.MetaDataAttribute);
Assert.AreEqual(mapPointData.MetaData, properties.GetAvailableMetaDataAttributes());
+
+ string expectedStyleTypeValue = hasMapTheme
+ ? "Categorie"
+ : "Enkel symbool";
+ Assert.AreEqual(expectedStyleTypeValue, properties.StyleType);
+
+ string expectedAttributeName = hasMapTheme
+ ? mapPointData.MapTheme.AttributeName
+ : string.Empty;
+ Assert.AreEqual(expectedAttributeName, properties.MapThemeAttributeName);
}
[Test]
@@ -98,10 +122,11 @@
// Assert
PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties);
- Assert.AreEqual(5, dynamicProperties.Count);
+ Assert.AreEqual(6, dynamicProperties.Count);
const string layerCategory = "Kaartlaag";
const string labelCategory = "Labels";
+ const string styleCategory = "Stijl";
PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex];
PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty,
@@ -134,6 +159,13 @@
labelCategory,
"Op basis van",
"Toont de eigenschap op basis waarvan labels worden weergegeven op deze kaartlaag.");
+
+ PropertyDescriptor styleTypeProperty = dynamicProperties[stylePropertyIndex];
+ PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(styleTypeProperty,
+ styleCategory,
+ "Type",
+ "Het type van de stijl die is wordt toegepast voor het weergeven van deze kaartlaag.",
+ true);
}
[Test]
@@ -241,7 +273,7 @@
// Assert
PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties);
- Assert.AreEqual(showLabels ? 5 : 4, dynamicProperties.Count);
+ Assert.AreEqual(showLabels ? 6 : 5, dynamicProperties.Count);
if (showLabels)
{
@@ -253,6 +285,44 @@
}
}
+ [Test]
+ [TestCase(true)]
+ [TestCase(false)]
+ public void MapThemeRelatedProperties_MapDataWithMapThemeConfiguration_PropertiesShouldBeVisible(bool hasMapTheme)
+ {
+ // Setup
+ var mapPointData = new MapPointData("Test")
+ {
+ MapTheme = hasMapTheme
+ ? new MapTheme("Attribute", new[]
+ {
+ CategoryThemeTestFactory.CreateCategoryTheme()
+ })
+ : null
+ };
+
+ // Call
+ var properties = new TestFeatureBasedMapDataProperties
+ {
+ Data = mapPointData
+ };
+
+ // Assert
+ // Assert
+ PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties);
+ Assert.AreEqual(hasMapTheme ? 6 : 5, dynamicProperties.Count);
+
+ if (hasMapTheme)
+ {
+ PropertyDescriptor mapThemeAttributeNameProperty = dynamicProperties[mapThemeAttributeNamePropertyIndex];
+ PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(mapThemeAttributeNameProperty,
+ "Stijl",
+ "Op basis van",
+ "Toont de eigenschap op basis waarvan de kaartlaag is gecategoriseerd.",
+ true);
+ }
+ }
+
private class TestFeatureBasedMapDataProperties : FeatureBasedMapDataProperties
{
public override string Type
Index: Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapLineDataPropertiesTest.cs
===================================================================
diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -rd1b19bb139550ae19f474c28f94ff3329cae0236
--- Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapLineDataPropertiesTest.cs (.../MapLineDataPropertiesTest.cs) (revision ac96d7c315129af851634ed5a4a6800b59ede718)
+++ Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapLineDataPropertiesTest.cs (.../MapLineDataPropertiesTest.cs) (revision d1b19bb139550ae19f474c28f94ff3329cae0236)
@@ -39,9 +39,9 @@
[TestFixture]
public class MapLineDataPropertiesTest
{
- private const int colorPropertyIndex = 5;
- private const int widthPropertyIndex = 6;
- private const int stylePropertyIndex = 7;
+ private const int colorPropertyIndex = 6;
+ private const int widthPropertyIndex = 7;
+ private const int stylePropertyIndex = 8;
[Test]
public void Constructor_ExpectedValues()
@@ -76,7 +76,7 @@
// Assert
PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties);
- Assert.AreEqual(8, dynamicProperties.Count);
+ Assert.AreEqual(9, dynamicProperties.Count);
const string styleCategory = "Stijl";
PropertyDescriptor colorProperty = dynamicProperties[colorPropertyIndex];
Index: Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapPointDataPropertiesTest.cs
===================================================================
diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -rd1b19bb139550ae19f474c28f94ff3329cae0236
--- Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapPointDataPropertiesTest.cs (.../MapPointDataPropertiesTest.cs) (revision ac96d7c315129af851634ed5a4a6800b59ede718)
+++ Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapPointDataPropertiesTest.cs (.../MapPointDataPropertiesTest.cs) (revision d1b19bb139550ae19f474c28f94ff3329cae0236)
@@ -39,11 +39,11 @@
[TestFixture]
public class MapPointDataPropertiesTest
{
- private const int colorPropertyIndex = 5;
- private const int strokeColorPropertyIndex = 6;
- private const int strokeThicknessPropertyIndex = 7;
- private const int sizePropertyIndex = 8;
- private const int symbolPropertyIndex = 9;
+ private const int colorPropertyIndex = 6;
+ private const int strokeColorPropertyIndex = 7;
+ private const int strokeThicknessPropertyIndex = 8;
+ private const int sizePropertyIndex = 9;
+ private const int symbolPropertyIndex = 10;
[Test]
public void Constructor_ExpectedValues()
@@ -78,7 +78,7 @@
// Assert
PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties);
- Assert.AreEqual(10, dynamicProperties.Count);
+ Assert.AreEqual(11, dynamicProperties.Count);
const string styleCategory = "Stijl";
PropertyDescriptor colorProperty = dynamicProperties[colorPropertyIndex];
Index: Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapPolygonDataPropertiesTest.cs
===================================================================
diff -u -r3178e116f5e59e03078d465efeb303c5e232c7bf -rd1b19bb139550ae19f474c28f94ff3329cae0236
--- Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapPolygonDataPropertiesTest.cs (.../MapPolygonDataPropertiesTest.cs) (revision 3178e116f5e59e03078d465efeb303c5e232c7bf)
+++ Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/MapPolygonDataPropertiesTest.cs (.../MapPolygonDataPropertiesTest.cs) (revision d1b19bb139550ae19f474c28f94ff3329cae0236)
@@ -38,9 +38,9 @@
[TestFixture]
public class MapPolygonDataPropertiesTest
{
- private const int fillColorPropertyIndex = 5;
- private const int strokeColorPropertyIndex = 6;
- private const int strokeThicknessPropertyIndex = 7;
+ private const int fillColorPropertyIndex = 6;
+ private const int strokeColorPropertyIndex = 7;
+ private const int strokeThicknessPropertyIndex = 8;
[Test]
public void Constructor_ExpectedValues()
@@ -75,7 +75,7 @@
// Assert
PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties);
- Assert.AreEqual(8, dynamicProperties.Count);
+ Assert.AreEqual(9, dynamicProperties.Count);
const string styleCategory = "Stijl";
PropertyDescriptor colorProperty = dynamicProperties[fillColorPropertyIndex];