# Map

<div align="left"><img src="https://963067965-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MIJW5nbmYRaSNWePAac%2F-MIxu2KP4MClY9gv_q2W%2F-MIxukRm3cvYJKK-Kxuk%2FProperty-Map.png?alt=media&#x26;token=f22ee758-069c-4b68-bd55-1f588bd0751a" alt=""></div>

| Property         | Function                                                                                                                                                                                                | Type                                                                                                                                                        |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Url              | <p>Iframe code of embedded Bing, Google, etc., map<br><br><strong>Actions editor:</strong><br><code>Property > Map > Url</code><br><strong>Code:</strong><br><code>widget.content.mapUrl</code></p>     | `string`                                                                                                                                                    |
| Google api       | <p>Your google maps api key<br><br><strong>Actions editor:</strong><br><code>Property > Map > Google api</code><br><strong>Code:</strong><br><code>widget.content.googleApiKey</code></p>               | `string`                                                                                                                                                    |
| Use html         | <p>Enable custom html code<br><br><strong>Actions editor:</strong><br><code>Property > Map > Use html</code><br><strong>Code:</strong><br><code>widget.content.useUserHtml</code></p>                   | `bool`                                                                                                                                                      |
| Disable ui       | <p>Hide map controls<br><br><strong>Actions editor:</strong><br><code>Property > Map > Disable ui</code><br><strong>Code:</strong><br><code>widget.content.disableDefaultUi</code></p>                  | `bool`                                                                                                                                                      |
| Map type         | <p>Determines which map type to use<br><br><strong>Actions editor:</strong><br><code>Property > Map > Map type</code><br><strong>Code:</strong><br><code>widget.content.mapType</code></p>              | <p><code>string</code><br><br><strong>Values:</strong><br><code>roadmap</code><br><code>satellite</code><br><code>hybrid</code><br><code>terrain</code></p> |
| Html             | <p>Custom html code<br><br><strong>Actions editor:</strong><br><code>Property > Map > Html</code><br><strong>Code:</strong><br><code>widget.content.htmlCode</code></p>                                 | `string`                                                                                                                                                    |
| Smart scale      | <p>Update map size at end of widget resize<br><br><strong>Actions editor:</strong><br><code>Property > Map > Smart scale</code><br><strong>Code:</strong><br><code>widget.content.smartScale</code></p> | `bool`                                                                                                                                                      |
| Latitude         | <p>Sets latitude coordinates<br><br><strong>Actions editor:</strong><br><code>Property > Map > Latitude</code><br><strong>Code:</strong><br><code>widget.content.lat</code></p>                         | `double`                                                                                                                                                    |
| Longitude        | <p>Sets longitude coordinates<br><br><strong>Actions editor:</strong><br><code>Property > Map > Longitude</code><br><strong>Code:</strong><br><code>widget.content.lng</code></p>                       | `double`                                                                                                                                                    |
| Zoom             | <p>Sets map zoom level<br><br><strong>Actions editor:</strong><br><code>Property > Map > Zoom</code><br><strong>Code:</strong><br><code>widget.content.zoom</code></p>                                  | `int`                                                                                                                                                       |
| Current url      | <p>Gets current url<br><br><strong>Actions editor:</strong><br><code>Property > Map > Current url</code><br><strong>Code:</strong><br><code>widget.content.currentUrl</code></p>                        | `string`                                                                                                                                                    |
| Current url hash | <p>Gets current url<br><br><strong>Actions editor:</strong><br><code>Property > Map > Current url hash</code><br><strong>Code:</strong><br><code>widget.content.currentUrlHash</code></p>               | `string`                                                                                                                                                    |

## Actions

| Property                                     | Function                                                                                                                                                                                                                                                                                                      |
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Go to coordinates                            | <p>Change the center position of the map in geographical coordinates: latitude and longitude<br><br><strong>Actions editor:</strong><br><code>Actions > Common > Go to coordinates</code><br><strong>Code:</strong><br><code>widget.content.script.actionGotoCoordinates(QString lat, QString lng)</code></p> |
| Go to address                                | <p>Show address on map, i.e. 1600 Amphitheatre Pky, Mountain View, CA<br><br><strong>Actions editor:</strong><br><code>Actions > Common > Go to address</code><br><strong>Code:</strong><br><code>widget.content.script.actionGotoAddress(QString address)</code></p>                                         |
| Show user location if geolocation is enabled | <p><strong>Actions editor:</strong><br><code>Actions > Common > Show user location if geolocation is enabled</code><br><strong>Code:</strong><br><code>widget.content.script.actionGotoCurrentLocation()</code></p>                                                                                           |
| Set zoom                                     | <p>Set zoom level from 1 to 21<br><br><strong>Actions editor:</strong><br><code>Actions > Common > Set zoom</code><br><strong>Code:</strong><br><code>widget.content.script.actionSetZoom(int zoom)</code></p>                                                                                                |
| Run JavaScript                               | <p>Run custom javascript code<br><br><strong>Actions editor:</strong><br><code>Actions > Common > Run JavaScript</code><br><strong>Code:</strong><br><code>widget.content.script.actionRunJavaScript(QString script)</code></p>                                                                               |
| Add marker                                   | <p><strong>Actions editor:</strong><br><code>Actions > Common > Add marker</code><br><strong>Code:</strong><br><code>widget.content.script.actionAddMarker(QString lat, QString lng, QString label)</code></p>                                                                                                |
| Remove all markers                           | <p><strong>Actions editor:</strong><br><code>Actions > Common > Remove all markers</code><br><strong>Code:</strong><br><code>widget.content.script.actionRemoveMarkers()</code></p>                                                                                                                           |

## Events

| Property    | Function                                                                                                                                                                                       |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Url changed | <p>Event when url is changed<br><br><strong>Actions editor:</strong><br><code>Event > Url changed</code><br><strong>Code:</strong><br><code>widget.content.script.eventUrlChanged()</code></p> |
