Share via


PlaceInfo Class

Definition

Displays a map location and information that describes that location in a light-dismissible window which closes automatically when the user clicks outside of the window.

public ref class PlaceInfo sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 327680)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class PlaceInfo final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 327680)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class PlaceInfo
Public NotInheritable Class PlaceInfo
Inheritance
Object Platform::Object IInspectable PlaceInfo
Attributes

Windows requirements

Device family
Windows 10 Fall Creators Update (introduced in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v5.0)

Examples

This example shows the location of the Seattle Space Needle below the button that the user clicks to see that location.

private void SpaceNeedle_Click(object sender, RoutedEventArgs e)
{
    Geopoint spaceNeedlePoint = new Geopoint
        (new BasicGeoposition { Latitude = 47.6205, Longitude = -122.3493 });

    PlaceInfoCreateOptions options = new PlaceInfoCreateOptions();

    options.DisplayAddress = "400 Broad St, Seattle, WA 98109";
    options.DisplayName = "Seattle Space Needle";

    PlaceInfo spaceNeedlePlace =  PlaceInfo.Create(spaceNeedlePoint, options);

    FrameworkElement targetElement = (FrameworkElement)sender;

    GeneralTransform generalTransform =
        targetElement.TransformToVisual((FrameworkElement)targetElement.Parent);

    Rect rectangle = generalTransform.TransformBounds(new Rect(new Point
        (targetElement.Margin.Left, targetElement.Margin.Top), targetElement.RenderSize));

    spaceNeedlePlace.Show(rectangle, Windows.UI.Popups.Placement.Below);
}

Remarks

Version history

Windows version SDK version Value added
1803 17134 CreateFromAddress(String)
1803 17134 CreateFromAddress(String,String)

Properties

DisplayAddress

Gets the address associated with the PlaceInfo.

DisplayName

Gets the display name associated with the PlaceInfo.

Geoshape

Gets the geographical shape associated with the PlaceInfo.

Identifier

Gets the identifier associated with the PlaceInfo.

IsShowSupported

Gets a value that indicates whether your app can show a light-dismissible window that contains a map location and related information given the current context.

Methods

Create(Geopoint, PlaceInfoCreateOptions)

Creates a PlaceInfo instance.

Create(Geopoint)

Creates a PlaceInfo instance.

CreateFromAddress(String, String)

Creates a PlaceInfo instance by using an address and a display name.

CreateFromAddress(String)

Creates a PlaceInfo instance by using an address.

CreateFromIdentifier(String, Geopoint, PlaceInfoCreateOptions)

Creates a PlaceInfo instance.

CreateFromIdentifier(String)

Creates a PlaceInfo instance.

CreateFromMapLocation(MapLocation)

Creates a PlaceInfo instance.

Show(Rect, Placement)

Shows in a light-dismissible window, the map location and related information that is described in the PlaceInfo.

Show(Rect)

Shows in a pop-up window, the map location and related information that is described in the PlaceInfo.

Applies to