In the Actions tab you choose what happens when the map loads and when the user clicks, touches, or hovers a Region, Marker, or Directory item.
Open Map Editor › Actions. Options are grouped by event. Several actions can be enabled at once (for example zoom + show popover).
When to use
| Goal | Typical actions |
|---|
| Deep-link to a region or marker | Add ID to URL + On map load: trigger click |
| Store locator | Directory item click: zoom / show details or popover |
| Open an external page | Go to link (pick a URL field) |
| Drill down into another map | Show another map |
| Hover hints | Region / Marker mouseover: Show tooltip |
Customize HTML in Templates. Style popovers and details in CSS. Related tutorial: Regions and Markers as links.
On map load
Runs after the map has loaded.
| Option | Description |
|---|
| Load location only for post matching current page URL | Shown when the map uses WordPress posts. Loads the location for the post whose permalink slug is the last URL segment. Turn off Database › Settings › Load on start to avoid a double backend request on map load. |
| Trigger Region.click event (if URL contains Region ID) | If the URL includes a Region ID (see Add Region ID to the URL), runs the Region click actions for that region. |
| Trigger Marker.click event (if URL contains DB Object ID) | If the URL includes a Database Object ID, runs the Marker click actions for that object. |
Region click
| Option | Description |
|---|
| Add Region ID to the URL | Updates the hash, e.g. example.com/my-map/#/m/r/USA. Opening that link can trigger Region click on load (enable On map load › Trigger Region.click). |
| Filter directory by Region | Filters the Directory to items related to the clicked Region. |
| Zoom to Region | Zooms the map to the clicked Region. Zoom level: Auto or a fixed level. |
| Show details view | Opens the Details view. The Region is passed to the Region details view template. |
| Show popover | Opens a popover using the Region popover template. Prefer Settings › Popovers › Center map on popover and Settings › Scroll so the popover stays in view. |
| Go to link | Navigates to a URL from a Region field. Choose Field with URL and optionally Open link in a new tab. |
| Show another map | Loads another map using a Region field that stores the target map ID. Container ID: by default the new map replaces the current one; set a custom container ID to keep both maps. |
If Show another map fails with a missing container error, see the Error Dictionary.
Region mouseover
| Option | Description |
|---|
| Show tooltip | Shows a tooltip on hover (desktop). Content comes from the Region tooltip template. |
Marker mouseover
| Option | Description |
|---|
| Show tooltip | Shows a tooltip on hover. Content comes from the Database Object tooltip template. |
Region touch
Touch devices often have no hover. Use this instead of (or in addition to) mouseover.
| Option | Description |
|---|
| Show tooltip | On touch, shows content via the Region popover template (UI label in admin: "Show tooltip"). |
Marker click
| Option | Description |
|---|
| Add DB Object ID to the URL | Updates the hash, e.g. example.com/my-map/#/m/db/124. Opening that link can trigger Marker click on load. If the object was not loaded because of pagination, MapSVG fetches it from the database. |
| Show details view | Opens Details. The parent Database Object is passed to the DB Object details view template. |
| Show popover | Opens a popover using the DB Object popover template. |
| Zoom to Marker | Zooms to the marker. Zoom level: Auto or a fixed level. |
| Go to link | Navigates to a URL from a Database Object field. Optionally open in a new tab. |
Marker touch
| Option | Description |
|---|
| Show popover | On touch, shows the DB Object popover template. |
Directory item click
Behavior depends on Directory › Data source (Regions or Database).
| Option | Description |
|---|
| Add Object or Region ID to the URL | Adds the Region or Database Object ID to the URL, depending on the Directory source. |
| Show details view | Opens Details for the clicked directory item (template matches the Directory source). |
| Select associated Region(s) | Highlights Region(s) linked to the clicked item. |
| Trigger click event for associated Region(s) | Runs Region click actions for linked Region(s). |
| Trigger click event for associated Marker | Runs Marker click actions for the linked Marker. |
| Trigger show popover for associated Region | Shows the Region popover. If several Regions are attached, only the first gets a popover. |
| Trigger show popover for associated Marker | Shows the Marker popover. |
| Zoom to associated Region(s) | Zooms to linked Region(s). Optional zoom level. |
| Zoom to associated Marker | Zooms to the linked Marker. Optional zoom level. |
| Go to link | Navigates using a URL field from Region or Database Object fields. Optionally open in a new tab. |
| Show another map | Same as Region click: field with map ID + optional Container ID. |
Directory item hover
| Option | Description |
|---|
| Center on Marker | While hovering a directory item, centers the map on the associated Marker. |