MindFusion.Mapping Programmer's Guide


Decorations can be displayed by adding a DecorationLayer to the MapView. At this time there are two kinds of built-in decorations supported, DecorationImage and DecorationBubble.

DecorationImage can display a bitmap image at the specified latitude and longitude. This is useful if you need to show an icon (e.g denoting a landmark or a kind of business object) located there. The image is set via the Image property. You can specify an additional image through the HighlightImage property, which is drawn over the main image when the decoration is highlighted or selected. The PivotX and PivotY properties lets you specify the exact pixel within the image that should be placed at the decoration's map location. Decoration images can also have an associated Label drawn below them.

DecorationBubble is used to drawn a circle at the specified latitude and longitude. The circle radius length can be set proportionally to some statistical value associated with the location, for example population or income. The circle can be customized by setting its Label, FontName, FontSize, FillColor and BorderColor properties.

The following excerpt from the Markers sample project shows how to add a decoration layer and decoration images to the map view:

C#  Copy Code

// add a second layer to display decoration objects
var decorationLayer = new DecorationLayer(mapView.BaseMap.BoundingBox);

// create decoration images
foreach (var landmark in landmarks)
    var img = new DecorationImage(
        Image.FromFile(@"Images\" + landmark.Image),
        landmark.ImageX, landmark.ImageY,
        landmark.Latitude, landmark.Longitude);
    img.Label = landmark.Label;

Visual Basic  Copy Code

' add a second layer to display decoration objects
Dim decorationLayer = New DecorationLayer(mapView.BaseMap.BoundingBox)

' create decoration images
For Each landmark As var In landmarks
    Dim img = New DecorationImage(Image.FromFile("Images\" & Convert.ToString(landmark.Image)), landmark.ImageX, landmark.ImageY, landmark.Latitude, landmark.Longitude)
    img.Label = landmark.Label