Class

# MobileMapViewer

<div class="rst-class">

forsearch

</div>

Maps

<div class="rst-class">

forsearch

</div>

Map

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

## Description

A control for viewing maps loaded via a map provider like Google.

<div class="warning">

<div class="title">

Warning

</div>

On Android, this control cannot be accessed until its `Opening<mobilemapviewer.opening>` event executes. Accessing it before that will result in an `UnsupportedOperationException</api/exceptions/unsupportedoperationexception>`.

</div>

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                     | Type                                                          | Read-Only | Shared |
|----------------------------------------------------------|---------------------------------------------------------------|-----------|--------|
| `AccessibilityHint<mobilemapviewer.accessibilityhint>`   | `String</api/data_types/string>`                              |           |        |
| `AccessibilityLabel<mobilemapviewer.accessibilitylabel>` | `String</api/data_types/string>`                              |           |        |
| `ControlCount<mobilemapviewer.controlcount>`             | `Integer</api/data_types/integer>`                            | ✓         |        |
| `Enabled<mobilemapviewer.enabled>`                       | `Boolean</api/data_types/boolean>`                            |           |        |
| `HasScaleIndicator<mobilemapviewer.hasscaleindicator>`   | `Boolean</api/data_types/boolean>`                            |           |        |
| `Height<mobilemapviewer.height>`                         | `Integer</api/data_types/integer>`                            | ✓         |        |
| `Latitude<mobilemapviewer.latitude>`                     | `Double</api/data_types/double>`                              | ✓         |        |
| `Left<mobilemapviewer.left>`                             | `Integer</api/data_types/integer>`                            | ✓         |        |
| `LockBottom<mobilemapviewer.lockbottom>`                 | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockLeft<mobilemapviewer.lockleft>`                     | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockRight<mobilemapviewer.lockright>`                   | `Boolean</api/data_types/boolean>`                            |           |        |
| `LockTop<mobilemapviewer.locktop>`                       | `Boolean</api/data_types/boolean>`                            |           |        |
| `Longitude<mobilemapviewer.longitude>`                   | `Double</api/data_types/double>`                              | ✓         |        |
| `MapType<mobilemapviewer.maptype>`                       | `MapTypes<mobilemapviewer.maptypes>`                          |           |        |
| `Name<mobilemapviewer.name>`                             | `String</api/data_types/string>`                              | ✓         |        |
| `Parent<mobilemapviewer.parent>`                         | `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` | ✓         |        |
| `TintColor<mobilemapviewer.tintcolor>`                   | `ColorGroup</api/graphics/colorgroup>`                        |           |        |
| `Top<mobilemapviewer.top>`                               | `Integer</api/data_types/integer>`                            | ✓         |        |
| `TrackMode<mobilemapviewer.trackmode>`                   | `TrackModes<mobilemapviewer.trackmodes>`                      |           |        |
| `Visible<mobilemapviewer.visible>`                       | `Boolean</api/data_types/boolean>`                            |           |        |
| `Width<mobilemapviewer.width>`                           | `Integer</api/data_types/integer>`                            | ✓         |        |
| `ZoomRadius<mobilemapviewer.zoomradius>`                 | `Double</api/data_types/double>`                              |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                     | Parameters                                                                                                                                                | Returns                                                       | Shared |
|----------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------|--------|
| `AddConstraint<mobilemapviewer.addconstraint>`           | constraint As `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`, name As `String</api/data_types/string>` = ""                                          |                                                               |        |
| `AddControl<mobilemapviewer.addcontrol>`                 | child As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>`, isBeingAdded As `Boolean</api/data_types/boolean>` = `False</api/language/false>` |                                                               |        |
| `AddLocation<mobilemapviewer.addlocation>`               | locations() As `MapLocation</api/mobile/maplocation>`                                                                                                     |                                                               |        |
|                                                          | `ParamArray</api/language/paramarray>` locations() As `MapLocation</api/mobile/maplocation>`                                                              |                                                               |        |
| `ClearFocus<mobilemapviewer.clearfocus>`                 |                                                                                                                                                           |                                                               |        |
| `Constraint<mobilemapviewer.constraint>`                 | name As `String</api/data_types/string>`                                                                                                                  | `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`           |        |
| `ControlAt<mobilemapviewer.controlat>`                   | index As `Integer</api/data_types/integer>`                                                                                                               | `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` |        |
| `Controls<mobilemapviewer.controls>`                     |                                                                                                                                                           | `Iterable</api/language/iterable>`                            |        |
| `GoToLocation<mobilemapviewer.gotolocation>`             | latitude As `Double</api/data_types/double>`, longitude As `Double</api/data_types/double>`                                                               |                                                               |        |
| `GoToLocation<mobilemapviewer.gotolocation2>`            | location As `MapLocation</api/mobile/maplocation>`                                                                                                        |                                                               |        |
| `Handle<mobilemapviewer.handle>`                         |                                                                                                                                                           | `Ptr</api/data_types/additional_types/ptr>`                   |        |
|                                                          | type As `HandlesTypes<mobilemapviewer.handletypes>`                                                                                                       | `Ptr</api/data_types/additional_types/ptr>`                   |        |
| `LocationsFromQuery<mobilemapviewer.locationsfromquery>` | query As `String</api/data_types/string>`                                                                                                                 | `MapLocation()</api/mobile/maplocation>`                      |        |
| `Refresh<mobilemapviewer.refresh>`                       |                                                                                                                                                           |                                                               |        |
| `RemoveConstraint<mobilemapviewer.removeconstraint>`     | constraint As `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`                                                                                         |                                                               |        |
|                                                          | name As `String</api/data_types/string>`                                                                                                                  |                                                               |        |
| `RemoveControl<mobilemapviewer.removecontrol>`           | child As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>`                                                                                    |                                                               |        |
| `RemoveLocation<mobilemapviewer.removelocation>`         | locations() As `MapLocation</api/mobile/maplocation>`                                                                                                     |                                                               |        |
|                                                          | `ParamArray</api/language/paramarray>` locations() As `MapLocation</api/mobile/maplocation>`                                                              |                                                               |        |
| `SetFocus<mobilemapviewer.setfocus>`                     |                                                                                                                                                           |                                                               |        |
| `ToPicture<mobilemapviewer.topicture>`                   |                                                                                                                                                           |                                                               |        |
|                                                          |                                                                                                                                                           | `Picture</api/graphics/picture>`                              |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                       | Parameters                                                                                  | Returns |
|------------------------------------------------------------|---------------------------------------------------------------------------------------------|---------|
| `Closing<mobilemapviewer.closing>`                         |                                                                                             |         |
| `LocationSelected<mobilemapviewer.locationselected>`       | location As `MapLocation</api/mobile/maplocation>`                                          |         |
| `Opening<mobilemapviewer.opening>`                         |                                                                                             |         |
| `Pressed<mobilemapviewer.pressed>`                         | latitude As `Double</api/data_types/double>`, longitude As `Double</api/data_types/double>` |         |
| `RequestedPicture<mobilemapviewer.requestedpicture>`       | map As `Picture</api/graphics/picture>`                                                     |         |
| `UserLocationChanged<mobilemapviewer.userlocationchanged>` | latitude As `Double</api/data_types/double>`, longitude As `Double</api/data_types/double>` |         |

## Enumerations

<div id="mobilemapviewer.handletypes">

<div class="rst-class">

forsearch

</div>

</div>

MobileMapViewer.HandleTypes

### HandleTypes

> Specifies the type of OS handle you wish to receive for use with the Handle property.
>
> | Enum      | Description                                   |
> |-----------|-----------------------------------------------|
> | MapView   | Provides access to the underlying Map View    |
> | GoogleMap | Provides access to the underlying Google Map. |

<div id="mobilemapviewer.maptypes">

<div class="rst-class">

forsearch

</div>

</div>

MobileMapViewer.MapTypes

### MapTypes

> The various ways in which the map to be displayed.
>
> | Enum      | Description                                |
> |-----------|--------------------------------------------|
> | RoadMap   | A graphical version emphasizing roads.     |
> | Satellite | Photographic images taken from satellites. |
> | Hybrid    | The RoadMap and Satellite types combined.  |

<div id="mobilemapviewer.trackmodes">

<div class="rst-class">

forsearch

</div>

</div>

MobileMapViewer.TrackModes

### TrackModes

> The ways in which the map can track devices.
>
> | Enum | Description                                |
> |------|--------------------------------------------|
> | None | The map does no tracking.                  |
> | User | The map shows the user's current location. |

## Property descriptions

<div id="mobilemapviewer.accessibilityhint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.AccessibilityHint

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

> The accessibility hint is a longer description that is read aloud when VoiceOver is enabled.
>
> ``` xojo
> Me.AccessibilityHint = "Click to calculate the value and display the next screen."
> ```
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is not currently supported for Android.
>
> </div>

<div id="mobilemapviewer.accessibilitylabel">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.AccessibilityLabel

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

> The accessibility label of of a control is a short name that is read aloud when VoiceOver is enabled.
>
> ``` xojo
> Me.AccessibilityLabel = "Calculate the value."
> ```

<div id="mobilemapviewer.controlcount">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.ControlCount

**ControlCount** As `Integer</api/data_types/integer>`

> The number of child controls in the control.
>
> This property is read-only.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for iOS only.
>
> </div>

<div id="mobilemapviewer.enabled">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.Enabled

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

> Indicates whether the control is enabled or disabled.
>
> Disable the button:
>
> ``` xojo
> Button1.Enabled = False
> ```

<div id="mobilemapviewer.hasscaleindicator">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.HasScaleIndicator

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

> Allows to show or hide a visual element with the scale representation.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

<div id="mobilemapviewer.height">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.Height

**Height** As `Integer</api/data_types/integer>`

> The height of the control.
>
> This property is read-only on iOS.

<div id="mobilemapviewer.latitude">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.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="mobilemapviewer.left">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.Left

**Left** As `Integer</api/data_types/integer>`

> The left position of the control.
>
> This property is read-only on iOS.

<div id="mobilemapviewer.lockbottom">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.LockBottom

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

> Determines whether the bottom edge of the control should stay at a set distance from the bottom edge of the parent control, if there is one, or the owning screen.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is not currently supported for iOS. Use constraints instead.
>
> </div>
>
> This property can be set in the control's Inspector. The following example sets it in code.
>
> ``` xojo
> Me.LockBottom = True
> ```

<div id="mobilemapviewer.lockleft">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.LockLeft

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

> Determines whether the left edge of the control should stay at a set distance from the left edge of the parent control, if there is one, or the owning screen.
>
> LockLeft and Locktop default to `True</api/language/true>` when you add a new control to a screen. Existing controls will be altered only if LockRight and/or LockBottom are not set. *LockLeft* has no effect unless *LockRight* is `True</api/language/true>`.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is not currently supported for iOS. Use constraints instead.
>
> </div>
>
> This property can be set in the control's Inspector. The following example sets it in code.
>
> ``` xojo
> Me.LockLeft = True
> ```

<div id="mobilemapviewer.lockright">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.LockRight

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

> Determines whether the right edge of the control should stay at a set distance from the right edge of the parent control, if there is one, or the owning screen.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is not currently supported for iOS. Use constraints instead.
>
> </div>
>
> This property can be set in the control's Inspector. The following example sets it in code.
>
> ``` xojo
> Me.LockRight = True
> ```

<div id="mobilemapviewer.locktop">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.LockTop

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

> Determines whether the top edge of the control should stay at a set distance from the top edge of the parent control, if there is one, or the owning screen.
>
> LockTop and LockLeft default to `True</api/language/true>` when you add a control to a screen. Existing controls will be altered only if LockRight and/or LockBottom are not set. *LockTop* has no effect unless *LockBottom* is `True</api/language/true>`.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is not currently supported for iOS. Use constraints instead.
>
> </div>
>
> This property can be set in the control's Inspector. The following example sets it in code.
>
> ``` xojo
> Me.LockTop = True
> ```

<div id="mobilemapviewer.longitude">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.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="mobilemapviewer.maptype">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.MapType

**MapType** As `MapTypes<mobilemapviewer.maptypes>`

> The type of map being displayed.
>
> The map can be displayed as a Road, Satellite or Hybrid type.
>
> Set MapViewer1 to Hybrid:
>
> ``` xojo
> MapViewer1.MapType = MobileMapViewer.MapTypes.Hybrid
> ```

<div id="mobilemapviewer.name">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.Name

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

> The name of the control.
>
> This property is read-only.

<div id="mobilemapviewer.parent">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.Parent

**Parent** As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>`

> The parent (sometimes called a "Super") class of the control.
>
> This property is read-only.

<div id="mobilemapviewer.tintcolor">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.TintColor

**TintColor** As `ColorGroup</api/graphics/colorgroup>`

> Changes a control's tint color.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>
>
> On iOS, the following controls support TintColor:
>
> | Enum        | Description                                                                  |
> |-------------|------------------------------------------------------------------------------|
> | PopupMenu   | The background color will be drawn in the TintColor.                         |
> | ProgressBar | The area indicating the value of the control will be drawn in the TintColor. |
> | Slider      | The area indicating the value of the control will be drawn in the TintColor. |
> | TextArea    | The cursor and text highlight color will be drawn in the TintColor.          |
> | TextField   | The cursor and text highlight color will be drawn in the TintColor.          |

<div id="mobilemapviewer.top">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.Top

**Top** As `Integer</api/data_types/integer>`

> The top position of the control.
>
> This property is read-only on iOS.

<div id="mobilemapviewer.trackmode">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.TrackMode

**TrackMode** As `TrackModes<mobilemapviewer.trackmodes>`

> Determines if the user's location is tracked on the map.
>
> Set MapViewer1 to track the user on the map:
>
> ``` xojo
> MapViewer1.TrackMode = MobileMapViewer.TrackModes.User
> ```

<div id="mobilemapviewer.visible">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.Visible

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

> Indicates whether the control is visible.
>
> Make a button invisible:
>
> ``` xojo
> Button1.Visible = False
> ```

<div id="mobilemapviewer.width">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.Width

**Width** As `Integer</api/data_types/integer>`

> The width of the control.
>
> This property is read-only on iOS.

<div id="mobilemapviewer.zoomradius">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.ZoomRadius

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

> The radius (in kilometers) displayed on the map.
>
> Set the zoom radius on MapViewer1 to 100 kilometers:
>
> ``` xojo
> MapViewer1.ZoomRadius = 100
> ```

## Method descriptions

<div id="mobilemapviewer.addconstraint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.AddConstraint

**AddConstraint**(constraint As `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`, name As `String</api/data_types/string>` = "")

> Adds a *constraint* to the control. The optional *name* parameter can be used to `remove a constraint<mobileuicontrol.removeconstraint>` that was added via code.
>
> This *constraint* is used by child controls that have been added to this control.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

<div id="mobilemapviewer.addcontrol">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.AddControl

**AddControl**(child As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>`, isBeingAdded As `Boolean</api/data_types/boolean>` = `False</api/language/false>`)

> Adds a *child* control to the control. When the value of *isBeingAdded* is `True</api/language/true>`, the Opening event is triggered for the child control being added.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

<div id="mobilemapviewer.addlocation">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.AddLocation

**AddLocation**(locations() As `MapLocation</api/mobile/maplocation>`)

> Adds the array of `location</api/mobile/maplocation>` objects to the map, indicated by pins.
>
> Add a location to the map:
>
> ``` xojo
> Var location As New MapLocation("Fenway Park, Boston, MA")
> MapViewer1.AddLocation(location)
> ```

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

**AddLocation**(`ParamArray</api/language/paramarray>` locations() As `MapLocation</api/mobile/maplocation>`)

> Adds the `location</api/mobile/maplocation>` objects to the map, indicated by pins.
>
> The map will automatically set the `ZoomRadius<mobilemapviewer.zoomradius>` to fit all add *locations*.
>
> If you set the `MapLocation.Icon<maplocation.icon>` of the MapLocation before adding it, the `Picture</api/graphics/picture>` you set as as icon will be drawn at the location rather than the default pin.
>
> Add the Grand Canyon and the White House locations to MapViewer1:
>
> ``` xojo
> Var grandCanyon As New MapLocation(36.056595, -112.125092)
> Var whiteHouse As New MapLocation(38.897957, -77.036560)
>
> MapViewer1.AddLocation(grandCanyon, whiteHouse)
> ```

<div id="mobilemapviewer.clearfocus">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.ClearFocus

**ClearFocus**

> Removes the focus from the control.
>
> ``` xojo
> TextField1.ClearFocus
> ```

<div id="mobilemapviewer.constraint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.Constraint

**Constraint**(name As `String</api/data_types/string>`) As `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`

> Gets a reference to a named constraint so that you can modify its settings in code.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>
>
> Change an existing (and named) constraint of a control on the Screen:
>
> ``` xojo
> ' "TAWidth" is a width constraint for a TextField that has been given
> ' a name in the auto-layout Inspector properties.
> Var c As iOSLayoutConstraint = Self.Constraint("TAWidth")
> c.Offset = 200
> ```

<div id="mobilemapviewer.controlat">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.ControlAt

**ControlAt**(index As `Integer</api/data_types/integer>`) As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>`

> Gets the child control at the specified *index*.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

<div id="mobilemapviewer.controls">

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

</div>

<div class="rst-class">

forsearch

</div>

mobilemapviewer.Controls

**Controls** As `Iterable</api/language/iterable>`

> Allows you to iterate through all the controls that have been added to this control.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

<div id="mobilemapviewer.gotolocation">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.GoToLocation

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

> Centers the map on the provided position (*longitude* & *latitude*).
>
> If either the latitude or longitude are invalid, an `InvalidArgumentException</api/exceptions/invalidargumentexception>` will occur.
>
> Show Hobbiton on MapViewer1:
>
> ``` xojo
> MapViewer1.GoToLocation(-37.871826, 175.681283)
> ```

<div id="mobilemapviewer.gotolocation2">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.GoToLocation

**GoToLocation**(location As `MapLocation</api/mobile/maplocation>`)

> Centers the map on the provided *location*.
>
> Show Hobbiton on MapViewer1:
>
> ``` xojo
> Var location As New MapLocation(-37.871826, 175.681283)
> MapViewer1.GotToLocation(location)
> ```

<div id="mobilemapviewer.handle">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.Handle

**Handle** As `Ptr</api/data_types/additional_types/ptr>`

> The handle to the underlying native OS control.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

**Handle**(type As `HandlesTypes<mobilemapviewer.handletypes>`) As `Ptr</api/data_types/additional_types/ptr>`

> The handle to the underlying native OS control.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for Android only.
>
> </div>

<div id="mobilemapviewer.locationsfromquery">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.LocationsFromQuery

**LocationsFromQuery**(query As `String</api/data_types/string>`) As `MapLocation()</api/mobile/maplocation>`

> Returns an array of MapLocations based upon the *query* passed.
>
> Find all the McDonalds locations near the center of the map currently being displayed and add them to it:
>
> ``` xojo
> Var locationsFound() As MapLocation
> locationsFound = MapViewer1.LocationsFromQuery("McDonalds")
> MapViewer1.AddLocation(locationsFound)
> ```

<div id="mobilemapviewer.refresh">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.Refresh

**Refresh**

> Marks the control so that it will be redrawn during the next event loop.
>
> Call Refresh to force a Canvas to redraw itself:
>
> ``` xojo
> Canvas1.Refresh
> ```

<div id="mobilemapviewer.removeconstraint">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.RemoveConstraint

**RemoveConstraint**(constraint As `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`)

> Removes a *constraint* from the control.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

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

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

> Removes the constraint with the *name* passed from the `Screen</api/user_interface/mobile/mobilescreen>`.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

<div id="mobilemapviewer.removecontrol">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.RemoveControl

**RemoveControl**(child As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>`)

> Removes the control from the control.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

<div id="mobilemapviewer.removelocation">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.RemoveLocation

**RemoveLocation**(locations() As `MapLocation</api/mobile/maplocation>`)

**RemoveLocation**(`ParamArray</api/language/paramarray>` locations() As `MapLocation</api/mobile/maplocation>`)

> Removes from the map the MapLocations passed.
>
> Specifically, the pins that represent the *locations* are removed.
>
> Remove the location stored in MyHouse from MapViewer1:
>
> ``` xojo
> MapViewer1.RemoveLocation(MyHouse)
> ```

<div id="mobilemapviewer.setfocus">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.SetFocus

**SetFocus**

> Sets the focus to the control.
>
> ``` xojo
> TextField1.SetFocus
> ```

<div id="mobilemapviewer.topicture">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.ToPicture

**ToPicture**

> Creates a `Picture</api/graphics/picture>` from the map. The `Picture</api/graphics/picture>` is returned via the `RequestedPicture<mobilemapviewer.requestedpicture>` event.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is supported for Android only.
>
> </div>

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

> Creates a `Picture</api/graphics/picture>` from the map.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is supported for iOS only.
>
> </div>

## Event descriptions

<div id="mobilemapviewer.closing">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.Closing

**Closing**

> Called when the control's layout is closing.

<div id="mobilemapviewer.locationselected">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.LocationSelected

**LocationSelected**(location As `MapLocation</api/mobile/maplocation>`)

> The user has tapped on a *location* (displayed as a pin) that was added with the `AddLocation<mobilemapviewer.addlocation>` method.

<div id="mobilemapviewer.opening">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.Opening

**Opening**

> Called when the control's layout is opening.
>
> This is where you typically put initialization code.
>
> This example in the Opening event of a label sets its text to "Hello":
>
> ``` xojo
> Me.Text = "Hello"
> ```

<div id="mobilemapviewer.pressed">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.Pressed

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

> The user has long pressed/tapped on the map at the location specified by the *latitude* and *longitude* passed.

<div id="mobilemapviewer.requestedpicture">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.RequestedPicture

**RequestedPicture**(map As `Picture</api/graphics/picture>`)

> This event is called when `ToPicture<mobilemapviewer.topicture>` method is called. The event will come with a `Picture</api/graphics/picture>` representing the map.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This event is supported for Android only.
>
> </div>

<div id="mobilemapviewer.userlocationchanged">

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

</div>

<div class="rst-class">

forsearch

</div>

MobileMapViewer.UserLocationChanged

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

> The location of the user has changed.
>
> The GPS in most smartphones is very sensitive and as a result, moving the device just very slightly will result in this event being called.

## Notes

With the <span class="title-ref">MobileMapViewer</span>, you can `go to a specific location<mobilemapviewer.gotolocation>`, `add pins<mobilemapviewer.addlocation>` that represent locations, `remove those locations<mobilemapviewer.removelocation>` and `LocationsFromQuery<mobilemapviewer.locationsfromquery>` for locations by name, address, type, etc.

To use <span class="title-ref">MobileMapViewer</span> in Android projects, you need a Google Maps API key from your Google Developer Account and it's required to display Google Maps in Android apps. This can be set in the App Inspector using `MobileApplication.GoogleMapsAPIKey<mobileapplication.googlemapsapikey>`. For testing purposes during development, the key `demo_map_id` can be used.

## Sample code

Show Hobbiton on MapViewer1:

``` xojo
MapViewer1.GoToLocation(-37.871826, 175.681283)
```

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

Add the Grand Canyon and the White House locations to MapViewer1:

``` xojo
Var locations() As MapLocation

locations.Add(New MapLocation(36.056595, -112.125092)) 'Grand Canyon
locations.Add(New MapLocation(38.897957, -77.036560)) 'White House

MapViewer1.AddLocation(locations)
```

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

Find all the McDonalds locations near the center of the map currently being displayed and add them to it:

``` xojo
Var locationsFound() As MapLocation

locationsFound = MapViewer1.LocationsFromQuery("McDonalds")
MapViewer1.AddLocation(locationsFound)
```

## Compatibility

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

<div class="seealso">

`MobileUIControl</api/user_interface/mobile/mobileuicontrol>` parent class; `MapLocation</api/mobile/maplocation>` and `MobileLocation</api/mobile/mobilelocation>` classes.

</div>
