Back to Devexpress

MapPolygon Class

wpf-devexpress-dot-xpf-dot-map-afdf75d8.md

latest3.7 KB
Original Source

MapPolygon Class

The class used to draw a polygon on a map.

Namespace : DevExpress.Xpf.Map

Assembly : DevExpress.Xpf.Map.v25.2.dll

NuGet Package : DevExpress.Wpf.Map

Declaration

csharp
public class MapPolygon :
    MapShape,
    ISupportCoordPoints,
    IPolygonCore,
    IPointContainerCore,
    IEditableItem,
    ISimplifiableItem
vb
Public Class MapPolygon
    Inherits MapShape
    Implements ISupportCoordPoints,
               IPolygonCore,
               IPointContainerCore,
               IEditableItem,
               ISimplifiableItem

The following members return MapPolygon objects:

Remarks

The following image shows an example of a map polygon shape.

Note that, a map shape should fulfill the following condition to cross the 180th meridian: one or several points’ longitudes should exceed the 180 (-180) limit:

xml
<dxm:MapItemStorage>
    <dxm:MapItemStorage.Items>
        <dxm:MapPolygon>
            <dxm:MapPolygon.Points>
                <dxm:GeoPoint Latitude="-10" Longitude="-170"/>
                <dxm:GeoPoint Latitude="-10" Longitude="170"/>
                <dxm:GeoPoint Latitude="10" Longitude="170"/>
                <dxm:GeoPoint Latitude="10" Longitude="-170"/>
            </dxm:MapPolygon.Points>
        </dxm:MapPolygon>
        <dxm:MapPolygon Fill="Orange">
            <dxm:MapPolygon.Points>
                <dxm:GeoPoint Latitude="30" Longitude="170"/>
                <dxm:GeoPoint Latitude="30" Longitude="190"/>
                <dxm:GeoPoint Latitude="40" Longitude="190"/>
                <dxm:GeoPoint Latitude="40" Longitude="170"/>
            </dxm:MapPolygon.Points>
        </dxm:MapPolygon>
    </dxm:MapItemStorage.Items>
</dxm:MapItemStorage>

The code above produces the following image:

Example

View Example

xaml
<dxm:MapPolygon>
    <dxm:MapPolygon.Points>
        <dxm:GeoPoint>10, 10</dxm:GeoPoint>
        <dxm:GeoPoint>20, 10</dxm:GeoPoint>
        <dxm:GeoPoint>10, 20</dxm:GeoPoint>
    </dxm:MapPolygon.Points>
</dxm:MapPolygon>

Implements

IColorizerElement

IEditableItem

Inheritance

Object DispatcherObject DependencyObject Freezable MapDependencyObject MapItem MapShapeBase MapShape MapPolygon

See Also

MapPolygon Members

How to: Add a Georeferenced Image to a Map

DevExpress.Xpf.Map Namespace