# Map Events, Methods and Properties

> Source: https://manual.pvxplus.com/extended-nomads-objects/google-maps-interface/map-events-methods-properties

## Map Events

Below is a list of the events that are supported by the PxPlus Google Maps Extended Control.

| **Event** | **Description** |
| --- | --- |
| **click** | This event is fired when the user clicks on the map. The location of the last click can be found in the **[clickLatitude](https://manual.pvxplus.com/extended-nomads-objects/google-maps-interface/map-events-methods-properties#clicklat)** and **[clickLongitude](https://manual.pvxplus.com/extended-nomads-objects/google-maps-interface/map-events-methods-properties#clicklong)** properties. |
| **markerclick** | This event is fired when the user clicks on a marker. The marker identifier can be found in the **[clickMarker](https://manual.pvxplus.com/extended-nomads-objects/google-maps-interface/map-events-methods-properties#clickmarker)** property |
| **rightclick** | This event is fired when the user right clicks on the map. The location of the last right click can be found in the **[clickLatitude](https://manual.pvxplus.com/extended-nomads-objects/google-maps-interface/map-events-methods-properties#clicklat)** and **[clickLongitude](https://manual.pvxplus.com/extended-nomads-objects/google-maps-interface/map-events-methods-properties#clicklong)** properties. |

## Map Methods

Below is a list of the map-related methods supported by the PxPlus Google Maps Extended Control.

| **Method** | **Description** |
| --- | --- |
| fitBounds(*S,W,N,E*) | Sets the map to fit the given boundaries.<br>***Where:***  <br>  <br> **S** - Southernmost latitude in degrees  <br> **W** - Westernmost longitude in degrees  <br> **N** - Northernmost latitude in degrees  <br> **E** - Easternmost longitude in degrees |
| **getBounds$( )** | Returns a string containing the southernmost latitude, westernmost longitude, northernmost latitude and easternmost longitude in degrees, separated by commas. |
| **getCenter$( )** | Returns the latitude and longitude in degrees of the center point of the map. |
| **getLatitude( )** | Returns the latitude in degrees of the center point of the map. |
| **getLongitude( )** | Returns the longitude in degrees of the center point of the map. |
| **getMapTypeid$( )** | Returns the type of map. Types are *roadmap, satellite, hybrid* and *terrain*. |
| **getZoom( )** | Returns the current zoom setting. |
| initialize(*name$, properties$, methods$, events$, eventCount*) | Initializes properties, methods and events used by NOMADS and iNomads. |
| panBy(*cols, lines*) | Changes the center of the map by the given number of columns and rows. Use positive values to pan to the right or down, and negative values to pan left or up. |
| panTo(*latitude, longitude*) | Changes the center of the map to the given latitude and longitude. |
| setCenter(*latitude, longitude*) | Changes the center of the map to the given latitude and longitude. |
| setMapTypeid(*type$***)** | Sets the map type. Options are *roadmap, satellite, hybrid* and *terrain*. |
| setOptions(*options$***)** | Sets map attributes specified in *options$*, a list of SEP-separated values pairs, consisting of attribute names and values in the format *attribute=value*.  <br>  <br>Boolean values can be specified using **0** and **-1**, or **true** and **false**. Null string values can be specified by leaving the value blank.  <br>  <br>***Example:***  <br>  <br>"mapTypeID=terrain"+SEP+"draggable=false"+SEP+"zoom=4"+SEP+"backgroundColor="+SEP |
| setZoom(*n*) | Sets the zoom level of the map. |

## Map Properties

Below is a list of the map-related properties supported by the PxPlus Google Maps Extended Control. The properties are set when the map is created and are Read Only (except for the **[value$](https://manual.pvxplus.com/extended-nomads-objects/google-maps-interface/map-events-methods-properties#value)** property). Their values can be changed subsequently by using the corresponding **Set** method.

For a list of properties relating to Directions Services, see [Directions-Related Properties](https://manual.pvxplus.com/extended-nomads-objects/google-maps-interface/directions-related-properties-and-methods#properties).

| **Property** | **Description** |
| --- | --- |
| **APIkey** | ***(Required as of July 2018)***<br>API key to access Google map resources. Without an API key, a darkened map with the text "For development purposes only" will display.<br>For information on obtaining an API key, visit **[https://developers.google.com/maps/documentation/javascript/get-api-key](https://developers.google.com/maps/documentation/javascript/get-api-key)**.<br>The API key for each site will be different; therefore, an expression would most likely be used to supply the value for the **APIkey$** property.<br>However, you can leave the **APIkey$** property blank and simply load the **%GoogleAPIkey$** variable with the API key value prior to displaying any maps (such as in the START_UP program), and the PxPlus map object will retrieve the key value from there and set this property automatically without having to set it for each individual map.<br>Note:  <br>An API key is not required if a client ID is used. See [Client](https://manual.pvxplus.com/extended-nomads-objects/google-maps-interface/map-events-methods-properties#client) property.<br>*(API Key support was added in PxPlus 2018 Update 1.)* |
| **backgroundColor$** | Color used for the background of the map. This color is visible when tiles have not yet been loaded and the user pans.<br>Format is Hex #HHHHHH (e.g. #FF00FF) or a standard HTML color name (e.g. yellow). |
| **clickLatitude** | Latitude in degrees at the location where a Click or RightClick event occurs on a map. |
| **clickLongitude** | Longitude in degrees at the location where a Click or RightClick event occurs on a map. |
| **clickMarker** | Numeric identifier of the marker involved in a MarkerClick event. |
| **client** | Client ID for Google Maps API Premier customers. Visit the Google Web site for information about becoming a Premier customer. |
| **col** | Horizontal screen position of map in columns. |
| **cols** | Width of map in column units. |
| **containerObject** | ***(NOMADS Only)*** Object ID of browser object in which the map is displayed. |
| **ctlName$** | Control type. Value is *Extended*. |
| **disableDefaultUI** | Enables/disables all default user interface features, such as double click zoom, drag ability, scroll wheel, etc. UI features may be overridden individually. Boolean. (***Default:*** false or enabled) |
| **draggable** | Enables/disables the ability to drag the map. Boolean. (***Default:*** true or enabled) |
| **geocodeLatitude** | Longitude in degrees at the location of the last invoked. See **[Geocoder Method](https://manual.pvxplus.com/extended-nomads-objects/google-maps-interface/geocoder-method)**. |
| **geocodeLongitude** | Longitude in degrees at the location of the last invoked. See **[Geocoder Method](https://manual.pvxplus.com/extended-nomads-objects/google-maps-interface/geocoder-method)**. |
| **geocodeStatus$** | Status of the last invoked. See **[Geocoder Method](https://manual.pvxplus.com/extended-nomads-objects/google-maps-interface/geocoder-method)**. |
| **HTTPS** | Boolean flag indicating that a secure URL is to be used to access the Google Maps JavaScript API. This is only available to Google Maps API Premier customers whose client ID has been set in the **client** property and who have registered the HTTPS URL of their Web site with Google for use with their client ID. |
| **infoWindowCount** | Number of info windows currently displayed. |
| **keyboardShortcuts** | Enables/disables keyboard control of the map. Boolean. (***Default:*** true or enabled) |
| **latitude** | Latitude in degrees of the map center. Range is clamped between -90 degrees and 90 degrees. |
| **longitude** | Longitude in degrees of the map center. Longitude is wrapped between -180 degrees and 180 degrees. |
| **mapTypeControl** | Enabled/disabled state of the map type control. Boolean. (***Default:*** enabled) |
| **mapTypeControlStyle$** | Display option for the map type control. Options are *default, dropdown_menu* and *horizontal_bar*. |
| **mapTypeid$** | ***(Required)*** Map type. Options are *hybrid, roadmap, satellite* and *terrain*. |
| **markerCount** | Number of markers currently displayed. |
| **name$** | Control name. |
| **navigationControl** | Enabled/disabled state of the navigation control. Boolean. (***Default:*** enabled) |
| **navigationControlStyle$** | Display option for the navigation control. Options are *default, android, small* and *zoom_pan*. The default setting varies depending on map size and other factors. |
| **noClear** | If true, the contents of the map are not cleared. |
| **pvxError$** | Error value. |
| **pvxEvents$** | List of available events. |
| **region$** | ***(Optional)*** Unicode region sub-tag identifier. Can be used to override the standard location bias. |
| **scaleControl** | Enabled/disabled state of the scale control. |
| **scaleControlStyle$** | Display option for the scale control. Option is *default*. |
| **scrollWheel** | Enables/disables scroll wheel zooming on the map. Boolean. (***Default:*** true or enabled) |
| **sensor** | ***(Required)*** Indicates whether the application is using a sensor (such as a GPS locator) to determine the location. Boolean. (***Default:*** false) |
| **value$** | String of value pairs that contain all the data required to define the current map. Format is a list of assignment expressions separated by $00$.<br>The **value$** property is a Read/Write property. When set, the map is redisplayed using the new value settings.<br>***Examples:***<br>"sensor=0"+$00$+  <br> "region$="""""+$00$+  <br> "latitude=43.77"+$00$+  <br> "longitude=-79.4525"+$00$+  <br> "mapTypeID$=""hybrid""+$00$+  <br> "zoom=14"+$00$+<br>***Examples:*** *(not showing the $00$ separators)*<br>```<br>sensor=0<br>region$=""<br>latitude=43.77<br>longitude=-79.4525<br>mapTypeID$="hybrid"<br>zoom=14<br>backgroundColor$=""<br>disableDefaultUI=0<br>disableDoubleClickZoom=0<br>draggable=-1<br>keyboardShortcuts=-1<br>mapTypeControl=-1<br>mapTypeControlStyle$="DEFAULT"<br>navigationControl=-1<br>navigationControlStyle$="DEFAULT"<br>noClear=0<br>scaleControl=-1<br>scaleControlStyle$="DEFAULT"<br>scrollwheel=-1<br>marker1'latitude=43.77<br>marker1'longitude=-79.46<br>marker1'clickable=-1<br>marker1'draggable=0<br>marker1'flat=0<br>marker1'icon$=""<br>marker1'title$="title 1"<br>marker1'visible=-1<br>marker1'zIndex=1<br>``` |
| **zoom** | ***(Required)*** Initial zoom level for the map. |
