Class

# MapLocation

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Represents a location anywhere on Earth.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                               | Type                               | Read-Only | Shared |
|------------------------------------|------------------------------------|-----------|--------|
| `Address<maplocation.address>`     | `String</api/data_types/string>`   | ✓         |        |
| `Animated<maplocation.animated>`   | `Boolean</api/data_types/boolean>` |           |        |
| `Icon<maplocation.icon>`           | `Picture</api/graphics/picture>`   |           |        |
| `Latitude<maplocation.latitude>`   | `Double</api/data_types/double>`   | ✓         |        |
| `Longitude<maplocation.longitude>` | `Double</api/data_types/double>`   | ✓         |        |
| `Tag<maplocation.tag>`             | `Variant</api/data_types/variant>` |           |        |
| `Title<maplocation.title>`         | `String</api/data_types/string>`   |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                             | Parameters                                                                                                                                                        | Returns                                      | Shared |
|--------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|--------|
| `Constructor<maplocation.constructor0>`          | address As `String</api/data_types/string>`, tag As `Variant</api/data_types/variant>` = `Nil</api/language/nil>`                                                 |                                              |        |
| `Constructor<maplocation.constructor1>`          | latitude As `Double</api/data_types/double>`, longitude As `Double</api/data_types/double>`, tag As `Variant</api/data_types/variant>` = `Nil</api/language/nil>` |                                              |        |
| `DistanceTo<maplocation.distanceto>`             | location As <span class="title-ref">MapLocation</span>                                                                                                            | `Double</api/data_types/double>`             |        |
| `LookupAddress<maplocation.lookupaddress>`       | address As `String</api/data_types/string>`                                                                                                                       | <span class="title-ref">MapLocation()</span> | ✓      |
| `MoveTo<maplocation.moveto>`                     | latitude As `Double</api/data_types/double>`, longitude As `Double</api/data_types/double>`                                                                       |                                              |        |
|                                                  | location As `String</api/data_types/string>`                                                                                                                      |                                              |        |
| `PointsOfInterest<maplocation.pointsofinterest>` |                                                                                                                                                                   | `String()</api/data_types/string>`           |        |

## Property descriptions

<div id="maplocation.address">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MapLocation.Address

**Address** As `String</api/data_types/string>`

> The physical address (if there is one) of the location.
>
> This property is read-only.

<div id="maplocation.animated">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MapLocation.Animated

**Animated** As `Boolean</api/data_types/boolean>`

> If `True</api/language/true>`, moving the map to a new location or displaying an added location will be animated.

<div id="maplocation.icon">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MapLocation.Icon

**Icon** As `Picture</api/graphics/picture>`

> The picture that appears at the location when added to the map. The default is a pin.

<div id="maplocation.latitude">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MapLocation.Latitude

**Latitude** As `Double</api/data_types/double>`

> The angular distance of the center of the map north or south of the equator.
>
> This property is read-only.

<div id="maplocation.longitude">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MapLocation.Longitude

**Longitude** As `Double</api/data_types/double>`

> The angular distance of the center of the map east or west of the meridian at Greenwich, England.
>
> This property is read-only.

<div id="maplocation.tag">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MapLocation.Tag

**Tag** As `Variant</api/data_types/variant>`

> An related value associated with the location.

<div id="maplocation.title">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MapLocation.Title

**Title** As `String</api/data_types/string>`

> A name associated with the location. The name that appears when the location is added to a map.

## Method descriptions

<div id="maplocation.constructor0">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MapLocation.Constructor

**Constructor**(address As `String</api/data_types/string>`, tag As `Variant</api/data_types/variant>` = `Nil</api/language/nil>`)

> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> `Constructors</api/language/constructor>` are special methods called when you create an object with the `New</api/language/new>` keyword and pass in the parameters above.
>
> </div>
>
> Creates a <span class="title-ref">MapLocation</span> at the *address* and with the *tag* passed.
>
> To create a geo-fence, pass a `MobileCircularRegion</api/mobile/mobilecircularregion>` as the `Tag<maplocation.tag>` property.

<div id="maplocation.constructor1">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MapLocation.Constructor

**Constructor**(latitude As `Double</api/data_types/double>`, longitude As `Double</api/data_types/double>`, tag As `Variant</api/data_types/variant>` = `Nil</api/language/nil>`)

> Creates a <span class="title-ref">MapLocation</span> at the *latitude* and *longitude* with the *tag* passed.
>
> If *latitude* or *longitude* passed is not valid, an `InvalidArgumentException</api/exceptions/invalidargumentexception>` will occur.
>
> To create a geo-fence, pass a `MobileCircularRegion</api/mobile/mobilecircularregion>` as the `Tag<maplocation.tag>` property.
>
> Create a location for the White House:
>
> ``` xojo
> Var theWhiteHouse As New MapLocation(38.897957, -77.036560)
> ```

<div id="maplocation.distanceto">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MapLocation.DistanceTo

**DistanceTo**(location As <span class="title-ref">MapLocation</span>) As `Double</api/data_types/double>`

> The distance in kilometers between the current location and the *location* passed.

<div id="maplocation.lookupaddress">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MapLocation.LookupAddress

**LookupAddress**(address As `String</api/data_types/string>`) As <span class="title-ref">MapLocation()</span>

> Returns an array of <span class="title-ref">MapLocations</span> for the *address* passed.
>
> This method is `shared</api/language/shared>`.

<div id="maplocation.moveto">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MapLocation.MoveTo

**MoveTo**(latitude As `Double</api/data_types/double>`, longitude As `Double</api/data_types/double>`)

> Moves the current <span class="title-ref">MapLocation</span> to the *latitude* and *longitude* passed.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="rst-class">

forsearch

</div>

MapLocation.MoveTo

**MoveTo**(location As `String</api/data_types/string>`)

> Moves the current <span class="title-ref">MapLocation</span> to the *location* passed.

<div id="maplocation.pointsofinterest">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MapLocation.PointsOfInterest

**PointsOfInterest** As `String()</api/data_types/string>`

> Returns names of any points of interest at the current <span class="title-ref">MapLocation</span>. Points of interest are things such as parks, museums, etc. and not commercial locations such as retail stores.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is not currently supported for Android. Calling it will raise an `PlatformNotSupportedException</api/exceptions/platformnotsupportedexception>`.
>
> </div>

## Notes

If you provide invalid coordinates or an invalid address when creating a <span class="title-ref">MapLocation</span>, an `InvalidArgumentException</api/exceptions/invalidargumentexception>` will occur.

## Compatibility

|                       |        |
|-----------------------|--------|
| **Project Types**     | Mobile |
| **Operating Systems** | All    |

<div class="seealso">

`Object</api/data_types/additional_types/object>` parent class; `MobileMapViewer</api/user_interface/mobile/mobilemapviewer>` class.

</div>
