Skip to main content

MapImage Class

Stores the map image options.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.1.dll

NuGet Package: DevExpress.Win.Map

Declaration

public class MapImage :
    ILockableObject

The following members return MapImage objects:

Remarks

Use MapImage to specify the MapPolygon.Image property.

Example

The example below assigns a raster image to a map polygon.

image

VectorItemsLayer VectorLayer { get { return mapControl.Layers[1] as VectorItemsLayer; } }
MapItemStorage ItemStorage { get { return VectorItemsLayer.Data as MapItemStorage; } }
//...
private void OnFormLoad(object sender, EventArgs e) {
    MapPolygon centralPark = new MapPolygon();

    centralPark.Points.Add(new GeoPoint(40.767809, -73.981249));
    centralPark.Points.Add(new GeoPoint(40.768458, -73.981477));
    centralPark.Points.Add(new GeoPoint(40.800273, -73.958291));
    centralPark.Points.Add(new GeoPoint(40.800396, -73.957846));
    centralPark.Points.Add(new GeoPoint(40.797011, -73.949683));
    centralPark.Points.Add(new GeoPoint(40.796626, -73.949541));
    centralPark.Points.Add(new GeoPoint(40.764918, -73.972547));
    centralPark.Points.Add(new GeoPoint(40.76523,  -73.973245));
    centralPark.Points.Add(new GeoPoint(40.764704, -73.973741));

    centralPark.Image.MappingPoints.Add(new MapPoint(0.056376, 0.998469));
    centralPark.Image.MappingPoints.Add(new MapPoint(0, 0.987196));
    centralPark.Image.MappingPoints.Add(new MapPoint(0, 0.007516));
    centralPark.Image.MappingPoints.Add(new MapPoint(0.033557, 0));
    centralPark.Image.MappingPoints.Add(new MapPoint(0.940268, 0));
    centralPark.Image.MappingPoints.Add(new MapPoint(0.991275, 0.0090466));
    centralPark.Image.MappingPoints.Add(new MapPoint(1, 0.981489));
    centralPark.Image.MappingPoints.Add(new MapPoint(0.910738, 0.981489));
    centralPark.Image.MappingPoints.Add(new MapPoint(0.908054, 1));

    centralPark.Image.Source = new Bitmap("..\\..\\Data\\CentralPark1.png");
    ItemStorage.Items.Add(centralPark);
}

The above code uses the following API members:

Member Description
MapPolygon The class used to draw a polygon on a map.
MapPolygon.Points Gets or sets a collection of points defining the map polygon.
MapPolygon.Image Returns options of the image that specifies the map polygon background.
MapImage.Source Gets or sets a collection of image points whose coordinates are in the [0.0,1.0] range.
MapImage.MappingPoints Gets or sets a collection of image points whose coordinates are in the [0.0,1.0] range.

Inheritance

Object
MapImage
See Also