Hello,
I am evaluating RadMap (silverlight). In my application I would like to add a lot of custom shapes to some map layers. To test this I have added a VisualizationLayer and proceeded to add about 1000 rectangle object. Very good. Now I notice that I can apply a MapShapeFill object directly on the layer and if none of the rectangles have the shape fill specified, it uses the layer default. Since I think all my shapes in a layer will have the same style this is useful. Now I wanted to test out the dash stroke styles as this is quite important to me and I notice that if I added a MapShapeFill to my rectangle with a StrokeDashArray all is well and my rectangles draw correctly, but if I add a StrokeDashArray to the MapShapeFill attached to the layer I get an exception (the famous "The value does not fall within the expected range" exception).
I must add all my layers and geographic elements in code and as there may be a lot of them, I would prefer to do this in the most efficient way. Are there any ways around the error (or is it even important to use a layer level FillShape rather than an element level FillShape). Here is the test code I am using (working version commented out).
var v2 = map.Items [1] as VisualizationLayer;
v2.Name = Guid.NewGuid ( ).ToString ( );
v2.ShapeFill = new MapShapeFill ( ) {
Fill = new SolidColorBrush (Color.FromArgb (32, 0, 240, 255)),
Stroke = new SolidColorBrush (Colors.Red),
StrokeThickness = 2,
StrokeDashArray = new DoubleCollection ( ) { 4, 2, 2, 2 }
};
double start = -0.000025 * 33.0;
for (int i = 0; i < 33; i++) {
for (int j = 0; j < 33; j++) {
double x = start + 0.000075 * (double) i;
double y = start + 0.000075 * (double) j;
var rect = new RectangleData ( ) {
Location = new Location (this.DefaultLatitude + y, this.DefaultLongitude + x),
Height = 0.00005,
Width = 0.00005,
//ShapeFill = new MapShapeFill ( ) {
// Fill = new SolidColorBrush (Color.FromArgb (32, 0, 240, 255)),
// Stroke = new SolidColorBrush (Colors.Red),
// StrokeThickness = 2,
// StrokeDashArray = new DoubleCollection ( ) { 4, 2, 2, 2 }
//}
};
v2.Items.Add (rect);
}
}
I am evaluating RadMap (silverlight). In my application I would like to add a lot of custom shapes to some map layers. To test this I have added a VisualizationLayer and proceeded to add about 1000 rectangle object. Very good. Now I notice that I can apply a MapShapeFill object directly on the layer and if none of the rectangles have the shape fill specified, it uses the layer default. Since I think all my shapes in a layer will have the same style this is useful. Now I wanted to test out the dash stroke styles as this is quite important to me and I notice that if I added a MapShapeFill to my rectangle with a StrokeDashArray all is well and my rectangles draw correctly, but if I add a StrokeDashArray to the MapShapeFill attached to the layer I get an exception (the famous "The value does not fall within the expected range" exception).
I must add all my layers and geographic elements in code and as there may be a lot of them, I would prefer to do this in the most efficient way. Are there any ways around the error (or is it even important to use a layer level FillShape rather than an element level FillShape). Here is the test code I am using (working version commented out).
var v2 = map.Items [1] as VisualizationLayer;
v2.Name = Guid.NewGuid ( ).ToString ( );
v2.ShapeFill = new MapShapeFill ( ) {
Fill = new SolidColorBrush (Color.FromArgb (32, 0, 240, 255)),
Stroke = new SolidColorBrush (Colors.Red),
StrokeThickness = 2,
StrokeDashArray = new DoubleCollection ( ) { 4, 2, 2, 2 }
};
double start = -0.000025 * 33.0;
for (int i = 0; i < 33; i++) {
for (int j = 0; j < 33; j++) {
double x = start + 0.000075 * (double) i;
double y = start + 0.000075 * (double) j;
var rect = new RectangleData ( ) {
Location = new Location (this.DefaultLatitude + y, this.DefaultLongitude + x),
Height = 0.00005,
Width = 0.00005,
//ShapeFill = new MapShapeFill ( ) {
// Fill = new SolidColorBrush (Color.FromArgb (32, 0, 240, 255)),
// Stroke = new SolidColorBrush (Colors.Red),
// StrokeThickness = 2,
// StrokeDashArray = new DoubleCollection ( ) { 4, 2, 2, 2 }
//}
};
v2.Items.Add (rect);
}
}