PlaceInfo PlaceInfo PlaceInfo 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 : sealed class PlaceInfo : IPlaceInfo
public sealed class PlaceInfo : IPlaceInfo
Public NotInheritable Class PlaceInfo Implements IPlaceInfo
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

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);

}

Properties

DisplayAddress DisplayAddress DisplayAddress DisplayAddress

Gets the address associated with the PlaceInfo.

public : Platform::String DisplayAddress { get; }
public string DisplayAddress { get; }
Public ReadOnly Property DisplayAddress As string
var string = placeInfo.displayAddress;
Value
Platform::String string string string

The address associated with the PlaceInfo.

DisplayName DisplayName DisplayName DisplayName

Gets the display name associated with the PlaceInfo.

public : Platform::String DisplayName { get; }
public string DisplayName { get; }
Public ReadOnly Property DisplayName As string
var string = placeInfo.displayName;
Value
Platform::String string string string

The display name associated with the PlaceInfo.

Geoshape Geoshape Geoshape Geoshape

Gets the geographical shape associated with the PlaceInfo.

public : IGeoshape Geoshape { get; }
public IGeoshape Geoshape { get; }
Public ReadOnly Property Geoshape As IGeoshape
var iGeoshape = placeInfo.geoshape;
Value
IGeoshape IGeoshape IGeoshape IGeoshape

The geographical shape associated with the PlaceInfo.

Identifier Identifier Identifier Identifier

Gets the identifier associated with the PlaceInfo.

public : Platform::String Identifier { get; }
public string Identifier { get; }
Public ReadOnly Property Identifier As string
var string = placeInfo.identifier;
Value
Platform::String string string string

Gets the identifier associated with the PlaceInfo.

IsShowSupported IsShowSupported IsShowSupported 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.

public : static Platform::Boolean IsShowSupported { get; }
public static bool IsShowSupported { get; }
Public Static ReadOnly Property IsShowSupported As bool
var bool = Windows.Services.Maps.PlaceInfo.isShowSupported;
Value
Platform::Boolean bool bool bool

true if your app can show a light-dismissible window that contains a map location and related information given the current context; otherwise, false.

Methods

Create(Geopoint) Create(Geopoint) Create(Geopoint) Create(Geopoint)

Creates a PlaceInfo instance.

public : static PlaceInfo Create(Geopoint referencePoint)
public static PlaceInfo Create(Geopoint referencePoint)
Public Static Function Create(referencePoint As Geopoint) As PlaceInfo
var placeInfo = Windows.Services.Maps.PlaceInfo.create(referencePoint);
Parameters
referencePoint
Geopoint Geopoint Geopoint Geopoint

The geographic map location that you want to show in a light-dismissible window.

Returns

A PlaceInfo instance that describes the location.

Create(Geopoint, PlaceInfoCreateOptions) Create(Geopoint, PlaceInfoCreateOptions) Create(Geopoint, PlaceInfoCreateOptions) Create(Geopoint, PlaceInfoCreateOptions)

Creates a PlaceInfo instance.

public : static PlaceInfo Create(Geopoint referencePoint, PlaceInfoCreateOptions options)
public static PlaceInfo Create(Geopoint referencePoint, PlaceInfoCreateOptions options)
Public Static Function Create(referencePoint As Geopoint, options As PlaceInfoCreateOptions) As PlaceInfo
var placeInfo = Windows.Services.Maps.PlaceInfo.create(referencePoint, options);
Parameters
referencePoint
Geopoint Geopoint Geopoint Geopoint

The geographic map location that you want to show in a light-dismissible window.

options
PlaceInfoCreateOptions PlaceInfoCreateOptions PlaceInfoCreateOptions PlaceInfoCreateOptions

The optional information that describes this location. This information will appear in the light-dismissible window.

Returns

A PlaceInfo instance that describes the location.

CreateFromIdentifier(String) CreateFromIdentifier(String) CreateFromIdentifier(String) CreateFromIdentifier(String)

Creates a PlaceInfo instance.

public : static PlaceInfo CreateFromIdentifier(Platform::String identifier)
public static PlaceInfo CreateFromIdentifier(String identifier)
Public Static Function CreateFromIdentifier(identifier As String) As PlaceInfo
var placeInfo = Windows.Services.Maps.PlaceInfo.createFromIdentifier(identifier);
Parameters
identifier
Platform::String String String String

The identifier of the location.

Returns

A PlaceInfo instance that describes the location.

CreateFromIdentifier(String, Geopoint, PlaceInfoCreateOptions) CreateFromIdentifier(String, Geopoint, PlaceInfoCreateOptions) CreateFromIdentifier(String, Geopoint, PlaceInfoCreateOptions) CreateFromIdentifier(String, Geopoint, PlaceInfoCreateOptions)

Creates a PlaceInfo instance.

public : static PlaceInfo CreateFromIdentifier(Platform::String identifier, Geopoint defaultPoint, PlaceInfoCreateOptions options)
public static PlaceInfo CreateFromIdentifier(String identifier, Geopoint defaultPoint, PlaceInfoCreateOptions options)
Public Static Function CreateFromIdentifier(identifier As String, defaultPoint As Geopoint, options As PlaceInfoCreateOptions) As PlaceInfo
var placeInfo = Windows.Services.Maps.PlaceInfo.createFromIdentifier(identifier, defaultPoint, options);
Parameters
identifier
Platform::String String String String

The identifier of the location.

defaultPoint
Geopoint Geopoint Geopoint Geopoint

The geographic map location that you want to show in a light-dismissible window.

Note

This value is used only if the identifier is invalid, the device is offline, or the details of the place can't be obtained by using the identifier.

options
PlaceInfoCreateOptions PlaceInfoCreateOptions PlaceInfoCreateOptions PlaceInfoCreateOptions

The optional information that describes this location. This information will appear in the light-dismissible window.

Note

This value is used only if the identifier is invalid, the device is offline, or the details of the place can't be obtained by using the identifier.

Returns

A PlaceInfo instance that describes the location.

CreateFromMapLocation(MapLocation) CreateFromMapLocation(MapLocation) CreateFromMapLocation(MapLocation) CreateFromMapLocation(MapLocation)

Creates a PlaceInfo instance.

public : static PlaceInfo CreateFromMapLocation(MapLocation location)
public static PlaceInfo CreateFromMapLocation(MapLocation location)
Public Static Function CreateFromMapLocation(location As MapLocation) As PlaceInfo
var placeInfo = Windows.Services.Maps.PlaceInfo.createFromMapLocation(location);
Parameters
location
MapLocation MapLocation MapLocation MapLocation

The geographic map location that you want to show in a light-dismissible window.

Returns

A PlaceInfo instance that describes the location.

Remarks

You can get a MapLocation object by using any of the methods in the MapLocationFinder class.

Show(Rect) Show(Rect) Show(Rect) Show(Rect)

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

public : void Show(Rect selection)
public void Show(Rect selection)
Public Function Show(selection As Rect) As void
placeInfo.show(selection);
Parameters
selection
Rect Rect Rect Rect

The Rect is the rectangular area of user selection (for example, pressing a button), around which the operating system displays the light-dismissible window, not within that rectangular area. For example, if an app uses a button to show the place, pass the Rect of the button so the light-dismissible window displays around the button, not overlapping it.

Remarks

By default, this window appears below the selection rectangle. If you want to specify a different placement for this window, use the overloaded version of this method that accepts a Placement value as a parameter. This method closes any place card UIs that are already visible.

Show(Rect, Placement) Show(Rect, Placement) Show(Rect, Placement) Show(Rect, Placement)

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

public : void Show(Rect selection, Placement preferredPlacement)
public void Show(Rect selection, Placement preferredPlacement)
Public Function Show(selection As Rect, preferredPlacement As Placement) As void
placeInfo.show(selection, preferredPlacement);
Parameters
selection
Rect Rect Rect Rect

The Rect is the rectangular area of user selection (for example, pressing a button), around which the operating system displays the light-dismissible window, not within that rectangular area. For example, if an app uses a button to show the place, pass the Rect of the button so the light-dismissible window displays around the button, not overlapping it.

preferredPlacement
Placement Placement Placement Placement

The preferred placement of the light-dismissible window relative to the rectangle.

Remarks

This method closes any place card UIs that are already visible.