Please login to access all of the features of the Community Site.

MapAddress

M v3.0

This command tries to open a location, either an address or coordinates, directly in the device’s default maps app, like Google Maps or Apple Maps. It skips the step of launching a browser, making the experience quicker and more seamless for an individual.

Properties

PropertyTypeDescription
NamestringThe name of the location as you want it to appear on the user's map application.
AddressstringThe address to which you want the app to locate.
Latitudedouble?The latitude of a place to locate. Useless without also providing "Longitude".
Longitudedouble?The longitude of a place to locate. Useless without also providing "Latitude".

Note

This command will not work when defining properties inline: {Rock:MapAddressParameters Name='', Address=''}

Using an address (recommended):

<Button Text="Get Directions"
    StyleClass="btn, btn-primary-strong"
    Command="{Binding MapAddress}">
    <Button.CommandParameter>
        <Rock:MapAddressParameters Name="Phoenix Convention Center"
            Address="100 N 3rd St, Phoenix, AZ 85004" />
    </Button.CommandParameter>
</Button>

Using latitude/longitude:

<Button Text="Get Directions"
    StyleClass="btn, btn-primary-strong"
    Command="{Binding MapAddress}">
    <Button.CommandParameter>
        <Rock:MapAddressParameters Name="Phoenix Convention Center"
            Latitude="33.4498969"
            Longitude="-112.0705366" />
    </Button.CommandParameter>
</Button>