PlaceInfo PlaceInfo PlaceInfo PlaceInfo PlaceInfo Class

Definition

Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Prerelease APIs are identified by a Prerelease label.

[Contains prerelease APIs.]
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
struct winrt::Windows::Services::Maps::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 DisplayAddress

Gets the address associated with the PlaceInfo.

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

The address associated with the PlaceInfo.

DisplayName DisplayName DisplayName DisplayName DisplayName

Gets the display name associated with the PlaceInfo.

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

The display name associated with the PlaceInfo.

Geoshape Geoshape Geoshape Geoshape Geoshape

Gets the geographical shape associated with the PlaceInfo.

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

The geographical shape associated with the PlaceInfo.

Identifier Identifier Identifier Identifier Identifier

Gets the identifier associated with the PlaceInfo.

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

Gets the identifier associated with the PlaceInfo.

IsShowSupported 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; }
static bool IsShowSupported();
public static bool IsShowSupported { get; }
Public Static ReadOnly Property IsShowSupported As bool
var bool = Windows.Services.Maps.PlaceInfo.isShowSupported;
Value
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) Create(Geopoint)

Creates a PlaceInfo instance.

public : static PlaceInfo Create(Geopoint referencePoint)
PlaceInfo Create(Geopoint referencePoint) const;
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

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) Create(Geopoint, PlaceInfoCreateOptions)

Creates a PlaceInfo instance.

public : static PlaceInfo Create(Geopoint referencePoint, PlaceInfoCreateOptions options)
PlaceInfo Create(Geopoint referencePoint, PlaceInfoCreateOptions options) const;
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

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

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

CreateFromAddress(String) CreateFromAddress(String) CreateFromAddress(String) CreateFromAddress(String) CreateFromAddress(String)

Prerelease. Creates a PlaceInfo instance by using an address.

public : static PlaceInfo CreateFromAddress(Platform::String displayAddress)
PlaceInfo CreateFromAddress(winrt::hstring displayAddress) const;
public static PlaceInfo CreateFromAddress(String displayAddress)
Public Static Function CreateFromAddress(displayAddress As String) As PlaceInfo
var placeInfo = Windows.Services.Maps.PlaceInfo.createFromAddress(displayAddress);
Parameters
displayAddress
String String String

The address of the location that you want to appear in the placecard.

Returns
Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.17095.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v6)

CreateFromAddress(String, String) CreateFromAddress(String, String) CreateFromAddress(String, String) CreateFromAddress(String, String) CreateFromAddress(String, String)

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

public : static PlaceInfo CreateFromAddress(Platform::String displayAddress, Platform::String displayName)
PlaceInfo CreateFromAddress(winrt::hstring displayAddress, winrt::hstring displayName) const;
public static PlaceInfo CreateFromAddress(String displayAddress, String displayName)
Public Static Function CreateFromAddress(displayAddress As String, displayName As String) As PlaceInfo
var placeInfo = Windows.Services.Maps.PlaceInfo.createFromAddress(displayAddress, displayName);
Parameters
displayAddress
String String String

The address of the location that you want to appear in the placecard.

displayName
String String String

The name that you want to appear as a label in the placecard.

Returns
Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.17095.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v6)

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

Creates a PlaceInfo instance.

public : static PlaceInfo CreateFromIdentifier(Platform::String identifier)
PlaceInfo CreateFromIdentifier(winrt::hstring identifier) const;
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
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) CreateFromIdentifier(String, Geopoint, PlaceInfoCreateOptions)

Creates a PlaceInfo instance.

public : static PlaceInfo CreateFromIdentifier(Platform::String identifier, Geopoint defaultPoint, PlaceInfoCreateOptions options)
PlaceInfo CreateFromIdentifier(winrt::hstring identifier, Geopoint defaultPoint, PlaceInfoCreateOptions options) const;
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
String String String

The identifier of the location.

defaultPoint
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

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) CreateFromMapLocation(MapLocation)

Creates a PlaceInfo instance.

public : static PlaceInfo CreateFromMapLocation(MapLocation location)
PlaceInfo CreateFromMapLocation(MapLocation location) const;
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

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) 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)
void Show(Rect selection) const;
public void Show(Rect selection)
Public Function Show(selection As Rect) As void
placeInfo.show(selection);
Parameters
selection
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) 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)
void Show(Rect selection, Placement preferredPlacement) const;
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

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

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

Remarks

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