MapPolygon Class
Represents a polygon on the map.
Namespace: Microsoft.Maps.MapControl.WPF
Assembly: Microsoft.Maps.MapControl.WPF (in Microsoft.Maps.MapControl.WPF.dll)
Inheritance Hierarchy
System.Object
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Media.Visual
System.Windows.UIElement
System.Windows.FrameworkElement
System.Windows.Controls.Panel
Microsoft.Maps.MapControl.WPF.MapShapeBase
Microsoft.Maps.MapControl.WPF.MapPolygon
Syntax
public class MapPolygon : MapShapeBase
public ref class MapPolygon : MapShapeBase
type MapPolygon =
class
inherit MapShapeBase
end
Public Class MapPolygon
Inherits MapShapeBase
Constructors
Name | Description | |
---|---|---|
![]() |
MapPolygon() | Initializes a new instance of the MapPolygon class. |
Properties
Name | Description | |
---|---|---|
![]() |
ActualHeight | (Inherited from FrameworkElement.) |
![]() |
ActualWidth | (Inherited from FrameworkElement.) |
![]() |
AllowDrop | (Inherited from UIElement.) |
![]() |
AreAnyTouchesCaptured | (Inherited from UIElement.) |
![]() |
AreAnyTouchesCapturedWithin | (Inherited from UIElement.) |
![]() |
AreAnyTouchesDirectlyOver | (Inherited from UIElement.) |
![]() |
AreAnyTouchesOver | (Inherited from UIElement.) |
![]() |
Background | (Inherited from Panel.) |
![]() |
BindingGroup | (Inherited from FrameworkElement.) |
![]() |
BitmapEffect | (Inherited from UIElement.) |
![]() |
BitmapEffectInput | (Inherited from UIElement.) |
![]() |
CacheMode | (Inherited from UIElement.) |
![]() |
Children | (Inherited from Panel.) |
![]() |
Clip | (Inherited from UIElement.) |
![]() |
ClipToBounds | (Inherited from UIElement.) |
![]() |
CommandBindings | (Inherited from UIElement.) |
![]() |
ContextMenu | (Inherited from FrameworkElement.) |
![]() |
Cursor | (Inherited from FrameworkElement.) |
![]() |
DataContext | (Inherited from FrameworkElement.) |
![]() |
DefaultStyleKey | (Inherited from FrameworkElement.) |
![]() |
DependencyObjectType | (Inherited from DependencyObject.) |
![]() |
DesiredSize | (Inherited from UIElement.) |
![]() |
Dispatcher | (Inherited from DispatcherObject.) |
![]() |
Effect | (Inherited from UIElement.) |
![]() |
EncapsulatedShape | Gets the shape.(Inherited from MapShapeBase.) |
![]() |
Fill | Gets or sets the fill of the shape.(Inherited from MapShapeBase.) |
![]() |
FillRule | Gets or sets the fill rule for the polygon. |
![]() |
FlowDirection | (Inherited from FrameworkElement.) |
![]() |
Focusable | (Inherited from UIElement.) |
![]() |
FocusVisualStyle | (Inherited from FrameworkElement.) |
![]() |
ForceCursor | (Inherited from FrameworkElement.) |
![]() |
HasAnimatedProperties | (Inherited from UIElement.) |
![]() |
HasLogicalOrientation | (Inherited from Panel.) |
![]() |
Height | (Inherited from FrameworkElement.) |
![]() |
HorizontalAlignment | (Inherited from FrameworkElement.) |
![]() |
InheritanceBehavior | (Inherited from FrameworkElement.) |
![]() |
InputBindings | (Inherited from UIElement.) |
![]() |
InputScope | (Inherited from FrameworkElement.) |
![]() |
InternalChildren | (Inherited from Panel.) |
![]() |
IsArrangeValid | (Inherited from UIElement.) |
![]() |
IsEnabled | (Inherited from UIElement.) |
![]() |
IsEnabledCore | (Inherited from UIElement.) |
![]() |
IsFocused | (Inherited from UIElement.) |
![]() |
IsHitTestVisible | (Inherited from UIElement.) |
![]() |
IsInitialized | (Inherited from FrameworkElement.) |
![]() |
IsInputMethodEnabled | (Inherited from UIElement.) |
![]() |
IsItemsHost | (Inherited from Panel.) |
![]() |
IsKeyboardFocused | (Inherited from UIElement.) |
![]() |
IsKeyboardFocusWithin | (Inherited from UIElement.) |
![]() |
IsLoaded | (Inherited from FrameworkElement.) |
![]() |
IsManipulationEnabled | (Inherited from UIElement.) |
![]() |
IsMeasureValid | (Inherited from UIElement.) |
![]() |
IsMouseCaptured | (Inherited from UIElement.) |
![]() |
IsMouseCaptureWithin | (Inherited from UIElement.) |
![]() |
IsMouseDirectlyOver | (Inherited from UIElement.) |
![]() |
IsMouseOver | (Inherited from UIElement.) |
![]() |
IsSealed | (Inherited from DependencyObject.) |
![]() |
IsStylusCaptured | (Inherited from UIElement.) |
![]() |
IsStylusCaptureWithin | (Inherited from UIElement.) |
![]() |
IsStylusDirectlyOver | (Inherited from UIElement.) |
![]() |
IsStylusOver | (Inherited from UIElement.) |
![]() |
IsVisible | (Inherited from UIElement.) |
![]() |
Language | (Inherited from FrameworkElement.) |
![]() |
LayoutTransform | (Inherited from FrameworkElement.) |
![]() |
Locations | Gets or sets the locations that define the vertices of the shape.(Inherited from MapShapeBase.) |
![]() |
LogicalChildren | (Inherited from Panel.) |
![]() |
LogicalOrientation | (Inherited from Panel.) |
![]() |
Margin | (Inherited from FrameworkElement.) |
![]() |
MaxHeight | (Inherited from FrameworkElement.) |
![]() |
MaxWidth | (Inherited from FrameworkElement.) |
![]() |
MinHeight | (Inherited from FrameworkElement.) |
![]() |
MinWidth | (Inherited from FrameworkElement.) |
![]() |
Name | (Inherited from FrameworkElement.) |
![]() |
Opacity | Gets or sets the opacity of the shape.(Inherited from MapShapeBase.) |
![]() |
OpacityMask | Gets or sets the opacity mask for the shape.(Inherited from MapShapeBase.) |
![]() |
OverridesDefaultStyle | (Inherited from FrameworkElement.) |
![]() |
Parent | (Inherited from FrameworkElement.) |
![]() |
PersistId | (Inherited from UIElement.) |
![]() |
ProjectedPoints | Gets or sets the vertices of the polygon.(Overrides MapShapeBase.ProjectedPoints.) |
![]() |
RenderSize | (Inherited from UIElement.) |
![]() |
RenderTransform | (Inherited from UIElement.) |
![]() |
RenderTransformOrigin | (Inherited from UIElement.) |
![]() |
Resources | (Inherited from FrameworkElement.) |
![]() |
SnapsToDevicePixels | (Inherited from UIElement.) |
![]() |
Stroke | Gets or sets the stroke color of the shape.(Inherited from MapShapeBase.) |
![]() |
StrokeDashArray | Gets or sets the StrokeDashArray value of the shape.(Inherited from MapShapeBase.) |
![]() |
StrokeDashCap | Gets or sets the StrokeDashCap value for the shape.(Inherited from MapShapeBase.) |
![]() |
StrokeDashOffset | Gets or sets the StrokeDashOffset value for the shape.(Inherited from MapShapeBase.) |
![]() |
StrokeEndLineCap | Gets or sets the StrokeEndLineCap value for the shape.(Inherited from MapShapeBase.) |
![]() |
StrokeLineJoin | Gets or sets the StrokeLineJoin value for the shape.(Inherited from MapShapeBase.) |
![]() |
StrokeMiterLimit | Gets or sets the StrokeMiterLimit value for the shape.(Inherited from MapShapeBase.) |
![]() |
StrokeStartLineCap | Gets or sets the StrokeStartLineCap value for the shape.(Inherited from MapShapeBase.) |
![]() |
StrokeThickness | Gets or sets the StrokeThickness value for the shape.(Inherited from MapShapeBase.) |
![]() |
Style | (Inherited from FrameworkElement.) |
![]() |
StylusPlugIns | (Inherited from UIElement.) |
![]() |
Tag | (Inherited from FrameworkElement.) |
![]() |
TemplatedParent | (Inherited from FrameworkElement.) |
![]() |
ToolTip | (Inherited from FrameworkElement.) |
![]() |
TouchesCaptured | (Inherited from UIElement.) |
![]() |
TouchesCapturedWithin | (Inherited from UIElement.) |
![]() |
TouchesDirectlyOver | (Inherited from UIElement.) |
![]() |
TouchesOver | (Inherited from UIElement.) |
![]() |
Triggers | (Inherited from FrameworkElement.) |
![]() |
Uid | (Inherited from UIElement.) |
![]() |
UseLayoutRounding | (Inherited from FrameworkElement.) |
![]() |
VerticalAlignment | (Inherited from FrameworkElement.) |
![]() |
Visibility | (Inherited from UIElement.) |
![]() |
VisualBitmapEffect | (Inherited from Visual.) |
![]() |
VisualBitmapEffectInput | (Inherited from Visual.) |
![]() |
VisualBitmapScalingMode | (Inherited from Visual.) |
![]() |
VisualCacheMode | (Inherited from Visual.) |
![]() |
VisualChildrenCount | (Inherited from Panel.) |
![]() |
VisualClearTypeHint | (Inherited from Visual.) |
![]() |
VisualClip | (Inherited from Visual.) |
![]() |
VisualEdgeMode | (Inherited from Visual.) |
![]() |
VisualEffect | (Inherited from Visual.) |
![]() |
VisualOffset | (Inherited from Visual.) |
![]() |
VisualOpacity | (Inherited from Visual.) |
![]() |
VisualOpacityMask | (Inherited from Visual.) |
![]() |
VisualParent | (Inherited from Visual.) |
![]() |
VisualScrollableAreaClip | (Inherited from Visual.) |
![]() |
VisualTextHintingMode | (Inherited from Visual.) |
![]() |
VisualTextRenderingMode | (Inherited from Visual.) |
![]() |
VisualTransform | (Inherited from Visual.) |
![]() |
VisualXSnappingGuidelines | (Inherited from Visual.) |
![]() |
VisualYSnappingGuidelines | (Inherited from Visual.) |
![]() |
Width | (Inherited from FrameworkElement.) |
Methods
Events
Explicit Interface Implementations
Name | Description | |
---|---|---|
![]() ![]() |
IAddChild.AddChild(Object) | (Inherited from Panel.) |
![]() ![]() |
IAddChild.AddText(String) | (Inherited from Panel.) |
![]() ![]() |
IQueryAmbient.IsAmbientPropertyAvailable(String) | (Inherited from FrameworkElement.) |
Examples
The following example shows how to add a polygon to the map using XAML, C# and Visual Basic. For more information, see Adding Shapes to the Map.
<Window x:Class="WPFTestApplication.MainWindow"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
xmlns:m="clr-namespace:Microsoft.Maps.MapControl.WPF;assembly=Microsoft.Maps.MapControl.WPF"
Width="1024" Height="768">
<Grid x:Name="LayoutRoot" Background="White">
<m:Map CredentialsProvider="InsertYourBingMapsKey" Center="47.640,-122.125" ZoomLevel="11">
<m:MapPolygon Fill="Blue" Stroke="Green" StrokeThickness="5"
Locations="47.6424,-122.3219 47.8424,-122.1747 47.5814,-122.1747"
Opacity="0.7"/>
</m:Map>
</Grid>
</Window>
void addNewPolygon()
{
MapPolygon polygon = new MapPolygon();
polygon.Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Blue);
polygon.Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Green);
polygon.StrokeThickness = 5;
polygon.Opacity = 0.7;
polygon.Locations = new LocationCollection() {
new Location(47.6424,-122.3219),
new Location(47.8424,-122.1747),
new Location(47.5814,-122.1747};
myMap.Children.Add(polygon);
}
Private Sub addNewPolygon()
Dim polygon As New MapPolygon() With _
{ _
.Fill = New System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Blue), _
.Stroke = New System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Green), _
.StrokeThickness = 5, _
.Opacity = 0.7, _
.Locations = New LocationCollection() _
}
polygon.Locations.Add(New Location(47.6424,-122.3219))
polygon.Locations.Add(New Location(47.8424,-122.1747))
polygon.Locations.Add(New Location(47.5814,-122.1747))
myMap.Children.Add(polygon)
End Sub
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Microsoft.Maps.MapControl.WPF Namespace
Return to top