Class

# WebMapViewer

<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. It is initially centered at the position specified by *Latitude*, *Longitude*.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                | Type                                               | Read-Only | Shared |
|-----------------------------------------------------|----------------------------------------------------|-----------|--------|
| `AllowFullScreen<webmapviewer.allowfullscreen>`     | `Boolean</api/data_types/boolean>`                 |           |        |
| `APIKey<webmapviewer.apikey>`                       | `String</api/data_types/string>`                   |           |        |
| `ContextualMenu<webmapviewer.contextualmenu>`       | `WebMenuItem</api/user_interface/web/webmenuitem>` |           |        |
| `ControlID<webmapviewer.controlid>`                 | `String</api/data_types/string>`                   | ✓         |        |
| `Enabled<webmapviewer.enabled>`                     | `Boolean</api/data_types/boolean>`                 |           |        |
| `HasScaleIndicator<webmapviewer.hasscaleindicator>` | `Boolean</api/data_types/boolean>`                 |           |        |
| `Height<webmapviewer.height>`                       | `Integer</api/data_types/integer>`                 |           |        |
| `Indicator<webmapviewer.indicator>`                 | `Indicators<webuicontrol.indicators>`              |           |        |
| `Latitude<webmapviewer.latitude>`                   | `Double</api/data_types/double>`                   |           |        |
| `Left<webmapviewer.left>`                           | `Integer</api/data_types/integer>`                 |           |        |
| `LockBottom<webmapviewer.lockbottom>`               | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockHorizontal<webmapviewer.lockhorizontal>`       | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockLeft<webmapviewer.lockleft>`                   | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockRight<webmapviewer.lockright>`                 | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockTop<webmapviewer.locktop>`                     | `Boolean</api/data_types/boolean>`                 |           |        |
| `LockVertical<webmapviewer.lockvertical>`           | `Boolean</api/data_types/boolean>`                 |           |        |
| `Longitude<webmapviewer.longitude>`                 | `Double</api/data_types/double>`                   |           |        |
| `MapType<webmapviewer.maptype>`                     | `MapTypes<webmapviewer.maptypes>`                  |           |        |
| `Mode<webmapviewer.mode>`                           | `Modes<webmapviewer.modes>`                        |           |        |
| `ModeData<webmapviewer.modedata>`                   | `String</api/data_types/string>`                   |           |        |
| `Name<webmapviewer.name>`                           | `String</api/data_types/string>`                   | ✓         |        |
| `Page<webmapviewer.page>`                           | `WebPage</api/user_interface/web/webpage>`         | ✓         |        |
| `PanelIndex<webmapviewer.panelindex>`               | `Integer</api/data_types/integer>`                 |           |        |
| `Parent<webmapviewer.parent>`                       | `WebView</api/user_interface/web/webview>`         | ✓         |        |
| `Renderer<webmapviewer.renderer>`                   | `Renderers<webmapviewer.renderers>`                |           |        |
| `RouteDrawingColor<webmapviewer.routedrawingcolor>` | `ColorGroup</api/graphics/colorgroup>`             |           |        |
| `RoutePenSize<webmapviewer.routepensize>`           | `Integer</api/data_types/integer>`                 |           |        |
| `StyleURL<webmapviewer.styleurl>`                   | `String</api/data_types/string>`                   |           |        |
| `TabIndex<webmapviewer.tabindex>`                   | `Integer</api/data_types/integer>`                 |           |        |
| `Tooltip<webmapviewer.tooltip>`                     | `WebToolTip</api/user_interface/web/webtooltip>`   |           |        |
| `Top<webmapviewer.top>`                             | `Integer</api/data_types/integer>`                 |           |        |
| `Visible<webmapviewer.visible>`                     | `Boolean</api/data_types/boolean>`                 |           |        |
| `Width<webmapviewer.width>`                         | `Integer</api/data_types/integer>`                 |           |        |
| `Zoom<webmapviewer.zoom>`                           | `Integer</api/data_types/integer>`                 |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                  | Parameters                                                                                                                                    | Returns                                       | Shared |
|-------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|--------|
| `AcceptPictureDrop<webmapviewer.acceptpicturedrop>`   | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                               |        |
| `AcceptRawDataDrop<webmapviewer.acceptrawdatadrop>`   | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                               |        |
| `AcceptTextDrop<webmapviewer.accepttextdrop>`         | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                               |        |
| `AddLocation<webmapviewer.addlocation>`               | locations() As `WebMapLocation</api/web/webmaplocation>`                                                                                      |                                               |        |
|                                                       | `ParamArray</api/language/paramarray>` locations() As `WebMapLocation</api/web/webmaplocation>`                                               |                                               |        |
| `AllowPictureDrag<webmapviewer.allowpicturedrag>`     | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                               |        |
| `AllowRawDataDrag<webmapviewer.allowrawdatadrag>`     | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                               |        |
| `AllowTextDrag<webmapviewer.allowtextdrag>`           | dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>` |                                               |        |
| `Close<webmapviewer.close>`                           |                                                                                                                                               |                                               |        |
| `CSSClasses<webmapviewer.cssclasses>`                 |                                                                                                                                               | `WebCSSClasses</api/web/webcssclasses>`       |        |
| `DrawRoute<webmapviewer.drawroute>`                   | route As `MapRoute</api/user_interface/maps/maproute>`                                                                                        |                                               |        |
|                                                       | transportType As `MapRoute.TransportTypes<maproute.transporttypes>` = `MapRoute.TransportTypes.Car<maproute.transporttypes>`                  |                                               |        |
| `ExecuteJavaScript<webmapviewer.executejavascript>`   | script As `String</api/data_types/string>`                                                                                                    |                                               |        |
| `GoToLocation<webmapviewer.gotolocation>`             | location As `WebMapLocation</api/web/webmaplocation>`, fly As `Boolean</api/data_types/boolean>` = `False</api/language/false>`               |                                               |        |
| `GotoURL<webmapviewer.gotourl>`                       | url As `String</api/data_types/string>`, inNewWindow As `Boolean</api/data_types/boolean>` = `False</api/language/false>`                     |                                               |        |
| `LastLocationIndex<webmapviewer.Lastlocationindex>`   |                                                                                                                                               | `Integer</api/data_types/integer>`            |        |
| `LocationAt<webmapviewer.locationat>`                 | index As `Integer</api/data_types/integer>`                                                                                                   | `WebMapLocation</api/web/webmaplocation>`     |        |
| `LocationCount<webmapviewer.locationcount>`           |                                                                                                                                               | `Integer</api/data_types/integer>`            |        |
| `RemoveAllLocations<webmapviewer.removealllocations>` |                                                                                                                                               |                                               |        |
| `RemoveLocation<webmapviewer.removelocation>`         | Location As `WebMapLocation</api/web/webmaplocation>`                                                                                         |                                               |        |
| `RemoveLocationAt<webmapviewer.removelocationat>`     | index As `Integer</api/data_types/integer>`                                                                                                   |                                               |        |
| `RemoveRoute<webmapviewer.removeroute>`               |                                                                                                                                               |                                               |        |
| `Route<webmapviewer.route>`                           | transportType As `MapRoute.TransportTypes<maproute.transporttypes>` = `MapRoute.TransportTypes.Car<maproute.transporttypes>`                  | `MapRoute</api/user_interface/maps/maproute>` |        |
| `Search<webmapviewer.search>`                         | Query As `String</api/data_types/string>`                                                                                                     |                                               |        |
| `SetFocus<webmapviewer.setfocus>`                     |                                                                                                                                               |                                               |        |
| `Style<webmapviewer.style>`                           |                                                                                                                                               | `WebStyle</api/user_interface/web/webstyle>`  |        |
|                                                       | `Assigns</api/language/assigns>` style As `WebStyle</api/user_interface/web/webstyle>`                                                        |                                               |        |
| `ToPicture<webmapviewer.topicture>`                   |                                                                                                                                               |                                               |        |
| `UpdateBrowser<webmapviewer.updatebrowser>`           |                                                                                                                                               |                                               |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                          | Parameters                                                                                                                                                                                                        | Returns |
|---------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| `CenterChanged<webmapviewer.centerchanged>`                   | latitude As `Double</api/data_types/double>`, longitude As `Double</api/data_types/double>`                                                                                                                       |         |
| `Closed<webmapviewer.closed>`                                 |                                                                                                                                                                                                                   |         |
| `ContextualMenuSelected<webmapviewer.contextualmenuselected>` | hitItem As `WebMenuItem</api/user_interface/web/webmenuitem>`                                                                                                                                                     |         |
| `DoublePressed<webmapviewer.doublepressed>`                   | latitude As `Double</api/data_types/double>`, longitude As `Double</api/data_types/double>`                                                                                                                       |         |
| `DropObject<webmapviewer.dropobject>`                         | obj As `WebDragItem</api/user_interface/web/webdragitem>`, action As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>`, x As `Integer</api/data_types/integer>`, y As `Integer</api/data_types/integer>` |         |
| `Hidden<webmapviewer.hidden>`                                 |                                                                                                                                                                                                                   |         |
| `LocationSelected<webmapviewer.locationselected>`             | location As `WebMapLocation</api/web/webmaplocation>`                                                                                                                                                             |         |
| `Opening<webmapviewer.opening>`                               |                                                                                                                                                                                                                   |         |
| `Pressed<webmapviewer.pressed>`                               | latitude As `Double</api/data_types/double>`, longitude as `Double</api/data_types/double>`                                                                                                                       |         |
| `RequestedPicture<webmapviewer.requestedpicture>`             | map As `Picture</api/graphics/picture>`                                                                                                                                                                           |         |
| `Shown<webmapviewer.shown>`                                   |                                                                                                                                                                                                                   |         |
| `ZoomChanged<webmapviewer.zoomchanged>`                       | zoomLevel As `Integer</api/data_types/integer>`                                                                                                                                                                   |         |

## Enumerations

<div id="webmapviewer.maptypes">

<div class="rst-class">

forsearch

</div>

</div>

WebMapViewer.MapTypes

### MapTypes

> Specifies the type of map to be displayed. For example, roadmap versus satellite.
>
> | Enum      | Description                                                                                 |
> |-----------|---------------------------------------------------------------------------------------------|
> | RoadMap   | Shows roads and points of interest. This type is good for showing locations and directions. |
> | Satellite | Shows satellite photos rather than roads and locations.                                     |

<div id="webmapviewer.modes">

<div class="rst-class">

forsearch

</div>

</div>

WebMapViewer.Modes

### Modes

> Specifies the mode in which the map will work. For example, showing a location versus showing directions.
>
> | Enum       | Description                                                                                                                                                                                                                                                            |
> |------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
> | Place      | Displays a map pin at a particular place or address, such as a landmark, business, geographic feature, or town.                                                                                                                                                        |
> | Directions | Displays the path between two or more specified points on the map, as well as the distance and travel time.                                                                                                                                                            |
> | Search     | Displays results for a search across the visible map region. It's recommended that a location for the search be defined, either by including a location in the search term (record+stores+in+Seattle) or by including a center and zoom parameter to bound the search. |
> | View       | Returns a map with no markers or directions.                                                                                                                                                                                                                           |
> | StreetView | Provides a viewer that renders the resulting panorama as a sphere with a camera at its center. You can manipulate the camera to control the zoom and the orientation of the camera.                                                                                    |

<div id="webmapviewer.renderers">

<div class="rst-class">

forsearch

</div>

</div>

WebMapViewer.Renderers

### Renderers

> Specifies the map rendering provider that will render the maps.
>
> | Enum            | Description                  |
> |-----------------|------------------------------|
> | GoogleMapsEmbed | Google's map renderer.       |
> | MapLibre        | An open-source map renderer. |

## Property descriptions

<div id="webmapviewer.allowfullscreen">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.AllowFullScreen

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

> When `True</api/language/true>` provides a widget that allows the user to toggle between the map view consuming the designated space on the page versus consuming the entire browser window.

<div id="webmapviewer.apikey">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.APIKey

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

> Specifies the APIKey to use with Google Maps.
>
> Google Maps requires an API Key. Visit the [Google Maps API Key page](https://developers.google.com/maps/documentation/javascript/get-api-key) to get your own API Key.
>
> Always set your API key, usually in the Opening event:
>
> ``` xojo
> Me.APIKey = "<YourGoogleMapsAPIKey>"
> ```

<div id="webmapviewer.contextualmenu">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.ContextualMenu

**ContextualMenu** As `WebMenuItem</api/user_interface/web/webmenuitem>`

> If you assign a `WebMenuItem</api/user_interface/web/webmenuitem>` to the control, it will be displayed when the user right-clicks the control.
>
> On a `WebPage</api/user_interface/web/webpage>`, you can disable/remove the default contextual menu by an empty `WebMenuItem</api/user_interface/web/webmenuitem>` class object to this property.
>
> This code populates a contextual menu in the Shown event of the control.
>
> ``` xojo
> Var menu As New WebMenuItem
>
> menu.AddMenuItem("One")
> menu.AddMenuItem("Two")
> menu.AddMenuItem("Three")
> Me.ContextualMenu = menu
> ```
>
> The menu selection is then handled by the ContextualMenuSelected event when the user right-clicks on the control. For example, it can be of the form:
>
> ``` xojo
> Select Case hitItem.Text
> Case "One"
> MessageBox("One")
> Case "Two"
> MessageBox("Two")
> Case "Three"
> MessageBox("Three")
> End Select
> ```

<div id="webmapviewer.controlid">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.ControlID

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

> Identifies the control on a per session basis.
>
> This property is read-only.

<div id="webmapviewer.enabled">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Enabled

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

> When `True</api/language/true>` the **WebControl** is drawn enabled and responds to user action. When `False</api/language/false>`, the control appears as disabled and does not respond to user actions.
>
> In the case of `WebTimer</api/web/webtimer>`, when set to `False</api/language/false>` this disables and stops the WebTimer. When set to `True</api/language/true>`, it starts the WebTimer.
>
> Disable a button when a check box value changes:
>
> ``` xojo
> If AllowSaveCheckBox.Value Then
>   SaveButton.Enabled = True
> Else
>   AllowSaveButton.Enabled = False
> End If
> ```

<div id="webmapviewer.hasscaleindicator">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.HasScaleIndicator

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

> Allows to show or hide a visual element with the scale representation.

<div id="webmapviewer.height">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Height

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

> The height (in pixels) of the control.

<div id="webmapviewer.indicator">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Indicator

**Indicator** As `Indicators<webuicontrol.indicators>`

> The color scheme for the control.

<div id="webmapviewer.latitude">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Latitude

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

> Sets or Gets the latitude of the center of the map being displayed. Because you would normally want to set both the latitude and longitude, you must also call the `UpdateBrowser<webmapviewer.updatebrowser>` method to send the changes to the browser.
>
> Set the map to a specific latitude and longitude:
>
> ``` xojo
> MapViewer1.Latitude = 38.8977
> MapViewer1.Longitude = -77.0366
> MapViewer1.Update
> ```

<div id="webmapviewer.left">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Left

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

> The position of the left side of the **WebUIControl** in pixels, relative to the web page.

<div id="webmapviewer.lockbottom">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.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 web page.

<div id="webmapviewer.lockhorizontal">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.LockHorizontal

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

> LockHorizontal overrides LockLeft and LockRight. It allows you to proportionally lock a control's position to the center of its parent control (or web page).
>
> For example, if you place a control in the center of the page and sets both LockHorizontal and LockVertical, the control will stay in the center of the page.

<div id="webmapviewer.lockleft">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.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 web page.

<div id="webmapviewer.lockright">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.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 web page.

<div id="webmapviewer.locktop">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.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 web page.

<div id="webmapviewer.lockvertical">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.LockVertical

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

> LockVertical overrides LockTop and LockBottom. It allows you to proportionally lock a control's position to keep it centered within the parent control or web page.
>
> For example, if you place a control in the center of the page, and sets both LockHorizontal and LockVertical, the control will stay in the center of the page.

<div id="webmapviewer.longitude">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Longitude

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

> Sets or Gets the longitude of the center of the map being displayed. Because you would normally want to set both the latitude and longitude, you must also call the `UpdateBrowser<webmapviewer.updatebrowser>` method to send the changes to the browser.
>
> Set the map to a specific latitude and longitude:
>
> ``` xojo
> MapViewer1.Latitude = 38.8977
> MapViewer1.Longitude = -77.0366
> MapViewer1.Update
> ```

<div id="webmapviewer.maptype">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.MapType

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

> Sets or gets the type of map being displayed.
>
> Change the map type to a road map:
>
> ``` xojo
> Me.MapType = WebMapViewer.MapTypes.RoadMap
> ```

<div id="webmapviewer.mode">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Mode

**Mode** As `Modes<webmapviewer.modes>`

> Sets or gets the mode of the map being displayed.
>
> Change the map type to street view:
>
> ``` xojo
> Me.Mode = WebMapViewer.Modes.StreetView
> ```

<div id="webmapviewer.modedata">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.ModeData

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

> The data required for the `Mode<webmapviewer.mode>` when it's set to Place or Search.

<div id="webmapviewer.name">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Name

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

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

<div id="webmapviewer.page">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Page

**Page** As `WebPage</api/user_interface/web/webpage>`

> Identifies the web page that contains the control.
>
> This property is read-only.

<div id="webmapviewer.panelindex">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.PanelIndex

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

> If the control has been placed on a <span class="title-ref">WebTabPanel</span> or `WebPagePanel</api/user_interface/web/webpagepanel>` control, this is the panel (page/tab) that the control is on. If the control is not on a panel, it returns -1.
>
> The first panel is numbered zero. If the control has been placed on a panel of a <span class="title-ref">WebTabPanel</span> or `WebPagePanel</api/user_interface/web/webpagepanel>` control, it returns the panel number. If the control is not on a `WebPagePanel</api/user_interface/web/webpagepanel>` or <span class="title-ref">WebTabPanel</span>, it returns -1. If you change the PanelIndex to a nonexistent panel, the control will disappear until you give it a PanelIndex value that corresponds to a panel that exists.
>
> If you are looking to change the currently selected panel (page/tab), use `SelectedPanelIndex<webpagecontrol.selectedpanelindex>`.
>
> This code displays the panel index of the control that is on the page.
>
> ``` xojo
> MessageBox(Me.SelectedPanelIndex.ToString)
> ```

<div id="webmapviewer.parent">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Parent

**Parent** As `WebView</api/user_interface/web/webview>`

> Used to get the control's parent control or page. If the parent control is a `WebContainer</api/user_interface/web/webcontainer>`, then it returns the `WebContainer</api/user_interface/web/webcontainer>`. If it is on a `WebPage</api/user_interface/web/webpage>`, it returns the `WebPage</api/user_interface/web/webpage>`.
>
> This property is read-only.

<div id="webmapviewer.renderer">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Renderer

**Renderer** As `Renderers<webmapviewer.renderers>`

> Indicates which map service provider will be used to render the map.

<div id="webmapviewer.routedrawingcolor">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.RouteDrawingColor

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

> The color of the route on the map.

<div id="webmapviewer.routepensize">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.RoutePenSize

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

> The thickness of the line that indicates the route on the map.

<div id="webmapviewer.styleurl">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.StyleURL

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

> Returns a URL from the map providing pointing to the location of a style file.
>
> Style files are <span class="title-ref">JSON</span> documents that follow the [MapLibre Style Spec](https://maplibre.org/maplibre-style-spec/).
>
> The easiest way to create a customized map is to register in one of the providers that supports this format. These providers will give you a style URL that you can use with your map:
>
> - <https://www.maptiler.com>
> - <https://www.mapbox.com>
> - <https://stadiamaps.com>
> - <https://www.arcgis.com>
>
> By default, Xojo uses [OpenStreetMap](https://www.openstreetmap.org/) raster tiles which should be OK for development or small web applications.
>
> You are not limited to using third party providers anymore. In projects where privacy is important or when you don not want to be worried about monthly limits or prices, you can use software installed on premises to serve your own map vector tiles.
>
> [Martin](https://github.com/maplibre/martin) is Open Source, but you can also use a commercial solution like [MapTiler Server](https://www.maptiler.com/server/).

<div id="webmapviewer.tabindex">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.TabIndex

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

> The **WebMapViewer's** control's position in the Tab Order. The control with a TabIndex of 0 is the first **WebUIControl** to get the focus when the page opens in the browser.
>
> This example sets the control's TabIndex.
>
> ``` xojo
> Me.TabIndex = 2
> ```

<div id="webmapviewer.tooltip">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Tooltip

**Tooltip** As `WebToolTip</api/user_interface/web/webtooltip>`

> Text of a message displayed as a tooltip.
>
> The tip is displayed when the user places the mouse on the control and leaves it there.
>
> This code in the Shown event of a Button sets the tooltip:
>
> ``` xojo
> Me.Tooltip = "Save changes"
> ```

<div id="webmapviewer.top">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Top

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

> The top of the control in local coordinates relative to the web page.

<div id="webmapviewer.visible">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Visible

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

> If `True</api/language/true>`, the control is drawn. If `False</api/language/false>`, it's not.
>
> Hide a control based on a checkbox setting:
>
> ``` xojo
> If ShowEmailCheckbox.Value Then
>   EmailField.Visible = True
> Else
>   EmailField.Visible = False
> End If
> ```

<div id="webmapviewer.width">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Width

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

> The width (in pixels) of the web control.
>
> This code in the Shown event handler increases the size of the control:
>
> ``` xojo
> Me.Width = Me.Width + 50
> ```

<div id="webmapviewer.zoom">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Zoom

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

> Sets or gets the zoom level of the map being displayed.
>
> Typically the Zoom is a value from 1 (minimum zoom) to 20 (maximum zoom).
>
> Zoom in the current map location to the maximum zoom, which is typically street-level:
>
> ``` xojo
> Me.Zoom = 20
> ```

## Method descriptions

<div id="webmapviewer.acceptpicturedrop">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.AcceptPictureDrop

**AcceptPictureDrop**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to accept a picture drop of a `WebDragItem</api/user_interface/web/webdragitem>`.

<div id="webmapviewer.acceptrawdatadrop">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.AcceptRawDataDrop

**AcceptRawDataDrop**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to accept a raw data drop of a `WebDragItem</api/user_interface/web/webdragitem>`.

<div id="webmapviewer.accepttextdrop">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.AcceptTextDrop

**AcceptTextDrop**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to accept a picture drop of a `WebDragItem</api/user_interface/web/webdragitem>`.

<div id="webmapviewer.addlocation">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.AddLocation

**AddLocation**(locations() As `WebMapLocation</api/web/webmaplocation>`)

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

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

**AddLocation**(`ParamArray</api/language/paramarray>` locations() As `WebMapLocation</api/web/webmaplocation>`)

> Adds the `location</api/web/webmaplocation>` objects to the map, indicated by pins.
>
> Add the Grand Canyon and the White House locations to MapViewer1:
>
> ``` xojo
> Var grandCanyon As New WebMapLocation(36.056595, -112.125092)
> Var whiteHouse As New WebMapLocation(38.897957, -77.036560)
>
> MapViewer1.AddLocation(grandCanyon, whiteHouse)
> ```

<div id="webmapviewer.allowpicturedrag">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.AllowPictureDrag

**AllowPictureDrag**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to be dragged as a picture.

<div id="webmapviewer.allowrawdatadrag">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.AllowRawDataDrag

**AllowRawDataDrag**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to be dragged as raw data.

<div id="webmapviewer.allowtextdrag">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.AllowTextDrag

**AllowTextDrag**(dragActionType As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>` = `WebDragItem.DragActionTypes.All<webdragitem.dragactiontypes>`)

> Allows the control to be dragged as text.

<div id="webmapviewer.close">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Close

**Close**

> Removes the control from the page.

<div id="webmapviewer.cssclasses">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.CSSClasses

**CSSClasses**

> Returns the instance of `WebCSSClasses</api/web/webcssclasses>` for this control allowing you to add CSS classes to and remove CSS classes from the control.

<div id="webmapviewer.drawroute">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.DrawRoute

**DrawRoute**(route As `MapRoute</api/user_interface/maps/maproute>`)

> Draws the route on the map.

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

**DrawRoute**(transportType As `MapRoute.TransportTypes<maproute.transporttypes>` = `MapRoute.TransportTypes.Car<maproute.transporttypes>`)

> Draws the route based upon locations that have been added with `AddLocation<webmapviewer.addlocation>`.

<div id="webmapviewer.executejavascript">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.ExecuteJavaScript

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

> Executes the JavaScript passed. The JavaScript passed can call a JavaScript function in a WebPageSource control.
>
> The Xojo web framework uses EcmaScript 6 which is more strict than previous versions of JavaScript. For more details, see the [EcmaScript 6 documentation](https://www.ecma-international.org/ecma-262/6.0/).
>
> This code in the Pressed event of a Button displays an alert using JavaScript:
>
> ``` xojo
> Me.ExecuteJavaScript("alert('Hello!');")
> ```
>
> This code will select the text in a WebTextField (or WebTextArea):
>
> ``` xojo
> WebTextField1.ExecuteJavascript("document.getElementById('" + _
> WebTextField1.ControlID + "_inner').select();")
> ```

<div id="webmapviewer.route">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Route

**Route**(transportType As `MapRoute.TransportTypes<maproute.transporttypes>` = `MapRoute.TransportTypes.Car<maproute.transporttypes>`)

> Returns a `route</api/user_interface/maps/maproute>` based upon the locations added with `AddLocation<webmapviewer.addlocation>`.

<div id="webmapviewer.gotolocation">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.GoToLocation

**GoToLocation**(location As `WebMapLocation</api/web/webmaplocation>`, fly As `Boolean</api/data_types/boolean>` = `False</api/language/false>`)

> Centers the map on the passed `WebMapLocation</api/web/webmaplocation>`.
>
> Centers the map on the specific location:
>
> ``` xojo
> Var location As New WebMapLocation("Fenway Park, Boston, MA")
> MapViewer1.GoToLocation(location)
> ```

<div id="webmapviewer.gotourl">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.GotoURL

**GotoURL**(url As `String</api/data_types/string>`, inNewWindow As `Boolean</api/data_types/boolean>` = `False</api/language/false>`)

> Opens the passed *url* in place of the current web page or downloads a file. If *inNewWindow* is `True</api/language/true>`, the browser is asked to open the *url* in a new window.
>
> If the browser has popup windows disabled and *inNewWindow* is `True</api/language/true>`, the method silently fails and the page is not shown.
>
> If *inNewWindow* is `False</api/language/false>`, the running web app is replaced with the specified *url*. If you want to display an external web site within your web app, use the `WebHTMLViewer</api/user_interface/web/webhtmlviewer>` control.
>
> Display a web site in a new popup window:
>
> ``` xojo
> Me.GotoURL("http://www.wikipedia.org", True)
> ```

<div id="webmapviewer.lastlocationindex">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.LastLocationIndex

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

> The index of the last location.

<div id="webmapviewer.locationat">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.LocationAt

**LocationAt**(index As `Integer</api/data_types/integer>`) As `WebMapLocation</api/web/webmaplocation>`

> The `map location</api/web/webmaplocation>` at the *index* passed.

<div id="webmapviewer.locationcount">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.LocationCount

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

> The number of locations on the map that were added with the `AddLocation<webmapviewer.addlocation>` method.

<div id="webmapviewer.removealllocations">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.RemoveAllLocations

**RemoveAllLocations**

> Removes all locations from the map that were added with the `AddLocation<webmapviewer.addlocation>` method.

<div id="webmapviewer.removelocation">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.RemoveLocation

**RemoveLocation**(Location As `WebMapLocation</api/web/webmaplocation>`)

> Removes a `WebMapLocation</api/web/webmaplocation>` object from the map. If the location is visible on the map, the icon is also removed.
>
> If Location is a property of the web page for a location that has been previously added, you can remove it:
>
> ``` xojo
> If Location Is Not Nil Then
>   MapViewer1.RemoveLocation(location)
> End If
> ```

<div id="webmapviewer.removelocationat">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.RemoveLocationAt

**RemoveLocationAt**(index As `Integer</api/data_types/integer>`)

> Removes the location (added with the `AddLocation<webmapviewer.addlocation>` method) at the *index* passed from the map.

<div id="webmapviewer.removeroute">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.RemoveRoute

**RemoveRoute**

> Removes the route from the map.

<div id="webmapviewer.search">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Search

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

> Performs a maps query based upon the query passed.

<div id="webmapviewer.setfocus">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.SetFocus

**SetFocus**

> Sets the focus to the `Control</api/user_interface/web/webuicontrol>`.
>
> This code checks for a required value when a button is pressed:
>
> ``` xojo
> If UserNameField.Text.IsEmpty Then
>   MessageBox("Please enter your UserName.")
>   UserNameField.SetFocus
>   Return
> End If
> ```

<div id="webmapviewer.style">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Style

**Style** As `WebStyle</api/user_interface/web/webstyle>`

> Returns the `WebStyle</api/user_interface/web/webstyle>` for the control.

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

**Style**(`Assigns</api/language/assigns>` style As `WebStyle</api/user_interface/web/webstyle>`)

> Assigns the *style* to the control.
>
> In this example, in any event of the control, set the text to bold:
>
> ``` xojo
> Var style As New WebStyle
> style.Bold = True
> Me.Style = style
> ```

<div id="webmapviewer.topicture">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.ToPicture

**ToPicture**

> Creates a `Picture</api/graphics/picture>` from the map. The `Picture</api/graphics/picture>` is returned via the `RequestedPicture<webmapviewer.requestedpicture>` event.

<div id="webmapviewer.updatebrowser">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.UpdateBrowser

**UpdateBrowser**

> Forces the current values of the control to be sent to the browser.
>
> This method is useful when you are computing values in a loop and wish to update the browser immediately rather than wait until the current method ends.
>
> This code iterates through a `RowSet</api/databases/rowset>` of `database rows</api/databases/databaserow>`, updates a `ProgressBar</api/user_interface/web/webprogressbar>` and then forces the updated `ProgressBar</api/user_interface/web/webprogressbar>` to be sent to the browser via UpdateBrowser.
>
> ``` xojo
> ProgressBar1.MaximumValue = SalesData.RowCount
>
> For Each row As DatabaseRow in SalesData
>   AnalyzeSales(row)
>   ProgressBar1.Value = ProgressBar1.Value + 1
>   ProgressBar1.UpdateBrowser
> Next
> ```

## Event descriptions

<div id="webmapviewer.centerchanged">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.CenterChanged

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

> The map has been recentered.

<div id="webmapviewer.closed">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Closed

**Closed**

> The control has been removed from the browser either because the page has closed or the control's Close method was called.

<div id="webmapviewer.contextualmenuselected">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.ContextualMenuSelected

**ContextualMenuSelected**(hitItem As `WebMenuItem</api/user_interface/web/webmenuitem>`)

> Called when a contextual menu item is selected. This selected item is contained in *hitItem*.
>
> This code populates a contextual menu in the Opening event of a `WebToolbar</api/user_interface/web/webtoolbar>`:
>
> ``` xojo
> Var menu As New WebMenuItem
>
> menu.AddMenuItem("One")
> menu.AddMenuItem("Two")
> menu.AddMenuItem("Three")
> Me.ContextualMenu = menu
> ```
>
> The menu selection is then handled by the ContextualMenuSelected event when the user right-clicks on the control. For example, it can be of the form:
>
> ``` xojo
> Select Case hitItem.Text
> Case "One"
>   MessageBox("One")
> Case "Two"
>   MessageBox("Two")
> Case "Three"
>   MessageBox("Three")
> End Select
> ```

<div id="webmapviewer.doublepressed">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.DoublePressed

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

> The user double-clicked or double-tapped a location on the map.

<div id="webmapviewer.dropobject">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.DropObject

**DropObject**(obj As `WebDragItem</api/user_interface/web/webdragitem>`, action As `WebDragItem.DragActionTypes<webdragitem.dragactiontypes>`, x As `Integer</api/data_types/integer>`, y As `Integer</api/data_types/integer>`)

> Called when a dragged item is over a control that can accept it. The dragged item is contained in *obj* and the type of drag is identified by *action*.

<div id="webmapviewer.hidden">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Hidden

**Hidden**

> The control is about to become no longer visible. This could be because the page is being closed, is being replaced as the foreground page by another page or because the control or a parent control's Visible property has been set to `False</api/language/false>`.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> This event is equivalent to the `DesktopWindow.Deactivated<desktopwindow.deactivated>` event in a desktop app.
>
> </div>

<div id="webmapviewer.locationselected">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.LocationSelected

**LocationSelected**(location As `WebMapLocation</api/web/webmaplocation>`)

> The *location* passed has been selected by the user.

<div id="webmapviewer.opening">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Opening

**Opening**

> The control has been created and the page is opening but has not been sent to the browser yet.
>
> The Opening event handler can be used to initialize non-visual properties and settings for controls.
>
> In most cases, you should use the `Shown<webuicontrol.shown>` event to initialize controls.

<div id="webmapviewer.pressed">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Pressed

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

> A location on the map at the *latitude* and *longitude* passed as been tapped or clicked.

<div id="webmapviewer.requestedpicture">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.RequestedPicture

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

> This event is called when `ToPicture<webmapviewer.topicture>` method is called. The event will come with a `Picture</api/graphics/picture>` representing the map.

<div id="webmapviewer.shown">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.Shown

**Shown**

> The control has appeared on the currently displayed page. This could be because its parent page just finished loading, its parent page has come to the foreground or the control is now visible having been previously invisible because it or its parent control's Visible property has been set to `True</api/language/true>`.
>
> Use the Shown event for initializing your controls or doing anything that would interact with other controls or user interface elements on the web page instead of the `Opening<webcontrol.opening>` event.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> This event is the web equivalent to the `DesktopWindow.Activated<desktopwindow.activated>` event.
>
> </div>
>
> This code in the Shown event of a `WebListBox</api/user_interface/web/weblistbox>` adds 2 rows with 3 columns:
>
> ``` xojo
> Me.RemoveAllRows
> Me.AddRow("Row 1", "Bob", "Roberts")
> Me.AddRow("Row 2", "Barb", "Reynolds")
> ```
>
> This example sets the text of a label:
>
> ``` xojo
> If Session.LoggedIn Then
>   Me.Text = "Welcome!"
> Else
>   Me.Text = "Welcome, " + Session.UserName
> End If
> ```

<div id="webmapviewer.zoomchanged">

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

</div>

<div class="rst-class">

forsearch

</div>

WebMapViewer.ZoomChanged

**ZoomChanged**(zoomLevel As `Integer</api/data_types/integer>`)

> The level of map magnification (zoom) has changed.

## Notes

<div class="warning">

<div class="title">

Warning

</div>

As of June 2018, Google Maps requires an API Key. You will need to set the `APIKey property<webmapviewer.apikey>` to your API Key in order for <span class="title-ref">WebMapViewer</span> to display any maps.

</div>

The <span class="title-ref">WebMapViewer</span> control is based on Google maps. As such, has the same strengths and limitations of Google Maps.

If errors occur during initialization of the <span class="title-ref">WebMapViewer</span> and you are running in debug mode, the error messages will appear in the IDE Messages pane.

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

### Google maps api key

As of June 2018, Google Maps requires an API Key. Visit the Google Maps docs for more information on usage:

[Google Maps Platform User Guide](https://cloud.google.com/maps-platform/user-guide/)

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

### The mapviewer user interface

When you add a <span class="title-ref">WebMapViewer</span> control to a `WebPage</api/user_interface/web/webpage>`, it comes with widgets to manipulate the zoom, the type, and the location. The zoom level is adjusted via the Slider control on the left and you can change the location by dragging with the hand (top-left). The type of map is changed by clicking the segmented control on the top-right corner. When you change the type (for example, from Map to Satellite), a check box appears below the Segmented Control to toggle that view type. If Map is selected, a Terrain checkbox appears to show or hide terrain features; if Satellite is selected, a checkbox appears to show or hide labels.

## Sample code

Create and display a location on the map:

``` xojo
Var location As New WebMapLocation("Fenway Park, Boston, MA")

MapViewer1.GoToLocation(location)
```

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

Display a location entered by the user (in the LocationField TextField) on the map:

``` xojo
MapViewer1.Search(LocationField.Text)
```

## Compatibility

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

<div class="seealso">

`WebUIControl</api/user_interface/web/webuicontrol>` parent class; `WebMapLocation</api/web/webmaplocation>` class.

</div>
