How to: Show Additional Information Over the Map

  • 2 minutes to read

To show additional information over the map, do the following.

NOTE

To learn more about overlays and overlay items, refer to the Map Overlay and Map Overlay Items topics.

private void Form1_Load(object sender, EventArgs e) {
    MapOverlay overlayWithText = new MapOverlay {
        Alignment = ContentAlignment.BottomRight,
        JoiningOrientation = Orientation.Vertical,
        Margin = new Padding(0, 4, 8, 8),
        Padding = new Padding(7)
    };
    overlayWithText.Items.Add(new MapOverlayTextItem {
        Text = "Copyright © 2015. Microsoft and its suppliers. All rights reserved."
    });
    map.Overlays.Add(overlayWithText);

    Uri baseUri = new Uri(System.Reflection.Assembly.GetEntryAssembly().Location);
    MapOverlay overlayWithImage = new MapOverlay {
        Alignment = ContentAlignment.BottomRight,
        JoiningOrientation = Orientation.Vertical,
        Margin = new Padding(0, 0, 8, 4),
        Padding = new Padding(0),
    };
    overlayWithImage.Items.Add(new MapOverlayImageItem { ImageUri = new Uri(baseUri, "..\\..\\Images\\BingLogo.png") });
    map.Overlays.Add(overlayWithImage);
}