# About

Welcome to Mapster WP Maps!

**Mapster WP Maps** is a Wordpress mapmaking suite that makes things straightforward for you and can even turn your Wordpress installation into a full geographic backend. You can create geographies to use across multiple maps, style popups in totally customizable ways, create and use custom base maps, and set up category filters and more.

We provide a free, no-API-key-required mapping service ([MapLibre](https://maplibre.org/)) as well as giving you access to the powerful [Mapbox GL JS library](https://www.mapbox.com/mapbox-gljs) in its latest version. We also integrate the [Google Maps API](https://developers.google.com/maps).

If you need more features, take a look at the existing [Pro Features](https://wpmaps.mapster.me/pro) and don't hesitate to get in touch with us.

We also have a [site with lots of examples](https://wpmaps.mapster.me/examples/) you can poke through and see in action!


# Installation

Install like any other Wordpress plugin. [Download the zip](https://wordpress.org/plugins/mapster-wp-maps/) and upload to Plugins, or install using the Wordpress Directory in your Admin panel.

{% embed url="<https://youtu.be/O6c-0JOo6-0>" %}
Basic Installation Instructions
{% endembed %}


# Key Concepts

Learn about how to understand the Mapster plugin if you're having trouble getting started.

Because the Mapster WP Maps plugin is quite extensive, it can be a little overwhelming at first if you just want to create a really simple map. If you're struggling, understanding a few key concepts might help.

### Maps

[Maps](/maps/map-tiles) are like the canvas upon which you place your geographies. You don't *create* geographies in maps, though. This is so that the options don't get too overwhelming!

There are a ton of options for how to style, load, and add controls to your maps, which you can explore by just clicking around and trying things out, or using this documentation alongside the Map editor to learn about each individual option.

### Geographies

Geographies are the things that go onto the map. These come in a few forms:

* [**Locations**](/locations/markers) (AKA Points) - includes markers, circles, icons, and labels. A single coordinate pair of longitude and latitude.
* [**Lines**](/lines/lines) - An array of coordinates that make up a continual line
* [**Polygons**](/polygons/flat-polygons) - A set of coordinates that create an area

### Popups

Popups can be attached to any geography. They can be opened through clicking, hovering, or some other ways that you'll discover (such as opening on load or by clicking on a list).

Because the ability to style your popups is usually really important to your map and cohesive site design, we created a system that lets you completely customize popup structure and where certain information, like the title, link, or descriptive information, appears.

There are also options to display popup information in modals or sidebar displays.

* [**Popup Templates**](/popups/popup-templates): this is where you create "templates" for popups that you can then assign to specific geographies
* [**Popup Contents**](/popups/popup-content): on each individual geography, you can specify the content that should appear in the popup. This can also be done dynamically with custom fields.

### Importing

Mapster WP Maps incorporates a lot of different ways to [import data](/import), whether from GeoJSONs, shapefiles, KML files, GPX, CSV, and more. You need to use Web Mercator projection. You can also import CSVs that will refresh imports on a regular basis. There are very extensive importing options available that take some time to learn if you want to deal with a lot of points.


# Importing/Exporting

There are a ton of options for importing your data to Mapster.&#x20;

[Head to the Import page to see details on how to do so](/import)!


# Guides


# Your First Map

## Creating Geography Features

You can create a map without any geographies, but you probably want to at least show a point or an area on your map. To create a geography, select a Location (point), a Line, or a Polygon from the left hand side under "Maps" in your Wordpress menu.

![](/files/hoamrQk6JP3UmLdCt3o2)

For the sake of simplicity, let's create a single Location for this map. Locations come in a few flavors: circles, markers, and labels/icons. We'll just create a simple Marker. Click on Locations and you'll see the screen below.

![](/files/lasLp6Q3KqvdypbZLUvs)

Click to add the marker to the map, or just search an address anywhere on Earth in the search bar. Your marker will appear. Make sure you give a title to this post so you can find it later. You can adjust some settings below the map, such as color, opacity, etc, and then save the Location post.

{% hint style="info" %}
Learn more about [Creating Locations](https://wpmaps.mapster.me/documentation#0).
{% endhint %}

## Adding Locations to a Map

Now, you'll have to create a map to show this location on. Click on Maps on the left and add a new Map.

![](/files/EXM7k4ZDBNwEWAvBl2q6)

To keep it simple, let's just keep all the settings as default. Go to the "Features" tab under the map, and click on the Locations input. There, you'll see the title of your marker Location appear. Once you click it, it'll appear instantly on the map.

![](/files/BTwLCgsKulsSOtBo16ve)

Now you can try viewing this post directly to see the map with your Location on it. Or, go back to the main list of maps and get the shortcode for the map, and place it on any Page or Post in your site!

## Defining Access Tokens / API Keys

To use Mapbox GL JS instead of MapLibre, you'll need to get an access token from Mapbox. [Read more about that here](https://docs.mapbox.com/help/getting-started/access-tokens/). This access token is also needed for certain controls, specifically geocoders.

If you're using Google Maps, you'll need to enter [an API key](https://developers.google.com/maps/documentation/javascript/get-api-key) into the Maps > Settings page.

![](/files/IpZNhYmeWxFprzEm3DVH)

Once you have the access token or API key that you need, enter it into the Settings screen, or into a single Map if you don't want to set a default settings token for the whole plugin at once.


# Creating a Crowdsourced Map

Coming soon.


# Set Up Recurring Import

Make an import that comes from some other data source and regularly updates your WP installation.

A recurring import can be a great way to sync some external database or data source with your WP installation. That way, you can style things the way you want through Mapster, have popups open and managed there, but still have your core geographic data updated however often you like.

Here's a walkthrough on getting it working.

### Get Familiar with the CSV Format for Mapster

The CSV format is quite deep. You can see a [sample spreadsheet here](https://docs.google.com/spreadsheets/d/1RQ4PzT4g5bjmY0dwiOfJ3YUgThnM4ZJuVSU-6rWQM1Y/edit?gid=762889436#gid=762889436) . The first tab of this spreadsheet explains a little bit about the format, and the second page is the actual example. The best way to understand this is to look at the sample spreadsheet and see which values you need to enter.&#x20;

For example, say I had a list of points and wanted to simply add those points and titles. The only fields I would need are:

* `spreadsheet_id` (a unique ID that you choose for each point. This allows the program to overwrite the point when importing again, instead of just making a new point)
* `post_title`
* `lat`
* `lng`

That's it for a really basic import! Let's say you wanted to add something into the content area of the popup. You would add a column with this header:

* `mapster_popup_popup_body_text`

How did I find this? Well, in the Import section of the Mapster plugin (Maps > Settings, then click Import, then Live CSV) you can see a button that says "See all Mapster property fields".

<figure><img src="/files/fC9BAWxrMSZqDYjGzK05" alt=""><figcaption></figcaption></figure>

If you click on this, you'll download a CSV file. If you open this, you can see ALL the available fields that you can set as column names. There are also some hints as to the kind of value you can put in them — some are numbers, some are strings, etc. This gets complex but for most fields, it should be fairly easy to figure it out.

### Do your first import

Next, you need to create some way to get your data from whatever source you're using into Google Sheets. We need to use Google Sheets for recurring imports that happen automatically, because they are hosted online and therefore are always available.

This might involve some more complex stuff, or just copy-pasting values, depending on your workflow. But once you have a Google Sheet, you have to make it public and get the right URL.

{% hint style="info" %}
To get the URL from your Google Sheet, you must go to File > Share > Publish to Web. Select "Comma-separate values (CSV)" from the dropdown under "Link" (by default, this says "Web Page"). Press Publish and you will recieve a URL.
{% endhint %}

Once you have that URL, enter it into the Enter URL input in the Import section and see if Mapster gives you any warnings. If not, give it a try!

See if your shapes imported. If not, try to see where the error might be, or get in touch with us for help.

### Make the Import Recurring

Next up, after you're verified that your format works, you can set up a recurring import to happen every X number of minutes, hours, or days automatically.&#x20;

This is controlled by [WP Cron](https://developer.wordpress.org/plugins/cron/), a Cron system inside Wordpress that runs tasks on a regular basis. By default, there aren't a lot of options for the timing of the Cron jobs.

However, we'd recommend installing [WP Crontrol](https://wordpress.org/plugins/wp-crontrol/), a pretty straightforward plugin that lets you set your own cron job intervals. Once you've set it up, they'll all appear in the dropdown after you paste a particular CSV file.

<figure><img src="/files/DmpIs3zmaDx6ApQGyjc2" alt=""><figcaption></figcaption></figure>

Just select the one you want, hit Create Recurring Import, and you're all set!


# Adding a Custom Style

Coming soon.


# Building a Custom Popup

Coming soon.


# Creating Shapes

Learn about creating features for your maps

In Mapster WP Maps, we classify geography types in three ways: [Locations](/locations/markers), [Lines](/lines/lines), and [Polygons](/polygons/flat-polygons).

All features are set in Wordpress as different custom post types, so they can be fully SEO-compatible (if you wish) and can live as their own posts. You can also reuse them across multiple maps, so you don't have to create any shapes twice.

### Add / Edit / Delete

Adding Locations, Lines, or Polygons is done by simply clicking on their menu item and pressing "Add New" on the post listing screen. Inside each geography post type, you'll find a plethora of options for how to customize and modify each type of geography.

You can easily Duplicate any created Location, Line, Polygon, Map, or Popup Template by hovering over the post in its list, and clicking the "Duplicate" link.

For every type of Geography Type, you can create it and edit it by drawing directly, or by uploading a pre-created geoJSON for that geography type.

If you assign a shape a category, you can add shapes en masse to a map using that category, too.

{% hint style="info" %}
Please note that the *oldest* shapes will appear on top, so if you want to make sure your features are layered properly, edit the published date of your shapes.
{% endhint %}

### Fullscreen Editing

You can expand the size of the Editing map by pressing "Expand" in the corner of the map.&#x20;

### Download GeoJSON

You can also download the geoJSON from any geography type, in case you need to use it in another application.

### Custom Editing Basemap

You can also set a custom basemap to use for editing, such as your own Mapbox Style, if you prefer. This is available only in [Mapster Pro](https://wpmaps.mapster.me/pro). To set this, add a Mapbox Token and then in Settings > Advanced Options, set the style URL in the "Editing Map Style" textbox.

### Post Display Options

You can choose to show individual maps on the posts for each geography type by turning on "Show Map in Post" in the sidebar. You will then need to select a **Template Map** from your existing Maps. This map will have all its default features removed and will just be used a base for your single feature.

<figure><img src="/files/IXz52VBMwHdNKrSd7Mni" alt=""><figcaption></figcaption></figure>


# Displaying Maps

Learn about the options for displaying your map to users.

After you've made your map, you've got to show it off to everyone! There are a few ways to do this with Mapster WP Maps.

* If you use Gutenberg, there is a "Map Select" block, where you can choose from the maps you've created, and everything will be automatically taken care of for you&#x20;

<figure><img src="/files/nFBYnNOA2LBZs6ynlgWH" alt=""><figcaption></figcaption></figure>

* If you want to use Shortcodes directly (as in a widget, or on a post), you can find the shortcode on the Map Editing List (on the right-hand side, near the date you created the map) and copy-paste that shortcode where you like

The following parameters are available for the shortcode `[mapster_wp_map]`:

* `id` -- this specifies the Wordpress ID of the map to be displayed
* `zoom` -- this specifies a custom zoom level that will override the one set in the map options
* `latitude` -- specifies a custom starting latitude, overriding map options
* `longitude` -- specifies a custom starting longitude, overriding map options
* `single_feature_id` -- used to display a single feature (a Location, Line, or Polygon), using the `map_id` as the base template (without any of its default features showing). Use the Wordpress ID for the feature
* `feature_ids`  — similar to single\_feature\_id, this allows you to load multiple features manually into your shortcode. Just separate the IDs with commas.

<figure><img src="/files/78HolaA81yC9S05tCsdH" alt=""><figcaption></figcaption></figure>

* You can use the map post directly and view it as a post, and it will automatically contain the map you created for it

Please let us know if you need more options!


# Map Tiles

Details on the options available in the Map Tiles section of the Maps edit page.

### Map Provider

You must choose a **Map Provider**. This is the only setting that requires an "Update" of the post and reload in order to change.

This is where the map tiles will be loaded from and affects the general map functionality available to you as well as the basic look of the map.

{% hint style="warning" %}
You need to enter a [Mapbox Access Token](https://account.mapbox.com/access-tokens) in order for the "Mapbox" option to work! If you're using Google Maps, [you'll need an API key](https://developers.google.com/maps/documentation/javascript/get-api-key).
{% endhint %}

### Access Token <sup><sub>*<mark style="color:blue;">\[Mapbox]</mark>*<sub></sup>

You can set an **access token** for a map specifically, or, if you've entered a Default Mapbox Access Token in your settings, it will automatically appear when you create a new map.

{% hint style="info" %}
For Google Maps API Key, you need to enter that in the **Settings** area of the plugin.
{% endhint %}

### Map Tile Style <sup><sub>*<mark style="color:blue;">\[Maplibre, Mapbox]</mark>*<sub></sup>

Click the button to open a selector for many different map styles. There are **Free Styles**, which are usable with Maplibre with no access token. Then there are **Mapbox Styles**, usable with an access token from Mapbox. Finally, there are **Mapster Pro Styles**, which are available in the [Pro version](https://wpmaps.mapster.me/pro/) of the plugin.

If you have any suggestions of more styles to add, please let us know.

### Snazzy Map Style <sup><sub>*<mark style="color:blue;">\[Google Maps]</mark>*<sub></sup>

Then you can enter in a string from [Snazzy Maps](https://snazzymaps.com/) here to style your Google Map the way you want.

### Custom Style URL <sup><sub>*<mark style="color:blue;">\[Maplibre, Mapbox]</mark>*<sub></sup>

If you're using Mapbox and you've created your own Style that you want to use, enter the style URL here. You can find this from the Styles page or when editing/saving a Style in Mapbox.

<figure><img src="/files/TRxVJGVDGkzI0sCmZPcz" alt=""><figcaption><p>Finding a style in Mapbox.</p></figcaption></figure>

### Custom Style JSON <sup><sub>*<mark style="color:blue;">\[Maplibre, Mapbox]</mark>*<sub></sup>

This is for adding other providers, including custom tilesets, maps from Maptiler, or other sources. Make sure that you understand the [Mapbox Style JSON](https://docs.mapbox.com/style-spec/guides/) and replace the elements you need and paste into this box.

### 3D Terrain <sup><sub>*<mark style="color:blue;">\[Mapbox]</mark>*<sub></sup>

Add Mapbox [3D Terrain](https://docs.mapbox.com/mapbox-gl-js/example/add-terrain/) to the map.

### 3D Buildings <sup><sub>*<mark style="color:blue;">\[Mapbox,</mark>*<sub></sup><sup><sub>*&#x20;*<sub></sup><sup><sub>*<mark style="color:green;">Pro</mark>*<sub></sup><sup><sub>*<mark style="color:blue;">]</mark>*<sub></sup>

Add Mapbox [3D Buildings](https://docs.mapbox.com/mapbox-gl-js/example/3d-buildings/) to the map.

### Globe <sup><sub>*<mark style="color:blue;">\[Mapbox,</mark>*<sub></sup><sup><sub>*&#x20;*<sub></sup><sup><sub>*<mark style="color:green;">Pro</mark>*<sub></sup><sup><sub>*<mark style="color:blue;">]</mark>*<sub></sup>

You can display the map as a 3D globe here.

You can also select the **Globe Background** and make it transparent or a Stars & Fog look.

### Projection <sup><sub>*<mark style="color:blue;">\[Mapbox]</mark>*<sub></sup>

You can choose from amongst a variety of Mapbox-supported projections.

### Language <sup><sub>*<mark style="color:blue;">\[Mapbox,</mark>*<sub></sup><sup><sub>*&#x20;*<sub></sup><sup><sub>*<mark style="color:green;">Pro</mark>*<sub></sup><sup><sub>*<mark style="color:blue;">]</mark>*<sub></sup>

You can select from amongst a set of Mapbox-supported languages.

### Duplicate Horizontally

By default, the map will scroll infinitely to east and west. If you only want one copy of the map, adjust here.


# Initial View

Select from the options available for initial load of your map.


# Fit to Features

Automatically zoom and center the map so that all of the geographic features you've added to it appear visible, regardless of the device being used.

### Manual Pitch

You can still adjust the pitch, or angle, of the map.

### Manual Rotation

Adjust the bearing, or heading, or rotation, of the map.

### Padding Around Bounds

To make sure your geographic features aren't butted up against the edge of the map, enter a padding.


# Manual Values

Customize the starting point and view of your map completely.

### Set From View

Zoom and adjust the map and then press this button to automatically set all of the values below with values that represent the current map.

### Manual Latitude

Adjust the center latitude of the map.

### Manual Longitude

Adjust the center longitude of the map.

### Manual Zoom

Adjust the zoom level of the map.

### Manual Pitch

You can still adjust the pitch, or angle, of the map.

### Manual Rotation

Adjust the bearing, or heading, or rotation, of the map.


# User Location

Use user IP to roughly set the start of the map.

### About User Location <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

It is fairly imperfect as it only uses the user IP using a free service to set the rough user location, and can easily be wrong or misled by unusual IPs. There are also technical restrictions (the free IP checker service won't work on HTTPS sites).

For best results for opening the map on the user location, look at the [Geolocation Control](/maps/controls/geocoding-and-geolocation).

### Manual Zoom

Adjust the zoom level of the map.

### Manual Pitch

You can still adjust the pitch, or angle, of the map.

### Manual Rotation

Adjust the bearing, or heading, or rotation, of the map.


# Map Size

Set the layout specifications for how your map appears on the page.

### Height & Units

Select a numeric value and a unit.

### Width & Units

Select a numeric value and a unit.

### Add Mobile Breakpoints <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

In [Mapster Pro](https://wpmaps.mapster.me/pro/), set up to two breakpoints for resizing the map to specific widths and heights in different screen sizes.

First set the **Breakpoint pixel width**, then the adjusted height and width of the map.

### Full Page

Make your map take the full width and height of the user screen size. It will still be constrained by any container the map is placed in on the page.

### Ignore Container

The map will sit outside of any container and take up a full height and width on the page, making it a truly full screen map.

### Map Only

Remove all other HTML from the page so it's only the map visible.


# Points, Lines, Polygons

Add geographic features to your map.

### Locations, Lines, & Polygons (Adding Individually)

To add individual geographic features one-by-one, make sure you first create them in the appropriate section of the WP Admin (under Locations, Lines, or Polygons). Then, when you click these dropdowns, you can select specific posts or type their titles to find them and add them.

If you've created a 3D Location, please make sure to turn on the **Load 3D Model Libraries** button if you are adding one to this map.

### Add By Category

If you have assigned shapes to categories, you can add them en masse to a map using that category. These will update automatically as new features get added to those categories.

### Add Custom Posts <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

If you've added the [Mapster Map ACF Field](/developer/mapster-map-acf-field) to any other post types in your installation, you can add those individual posts here!&#x20;

### Add Custom Categories <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

If you've added the [Mapster Map ACF Field](/developer/mapster-map-acf-field) to any other post types in your installation, you can add posts by choosing categories across any taxonomy on your Wordpress site, instead of adding posts one-by-one.


# Clustering

Group points into clusters for easier navigation and viewing.

### Feature Clustering

Different kinds of Location Styles (Circle, Marker, Label & Icon) will not cluster together. To enable clustering for the types of locations you've added, **please make sure you select the correct type of clustering**.

### Cluster by Category <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Cluster by Category allows you to break up clusters into totally different groups depending on the categories of the Locations you've added. You'll want to make sure that Locations are exclusive -- otherwise, the system won't know which cluster to assign a Location to.

Select the **Categories to Cluster.** Categories you don't select will still be broken into individual features on the map. *Please note: currently this only works with Marker type locations.*

Then, you can give the color for these clusters in the text box below. You need to enter a different hex code on each line, in the same order as the categories you selected above.&#x20;

```
#FFFFFF
#1b6a3d
#000000
```

The clusters will be the same color regardless of how many features are in the cluster.

### Cluster Coloring & Sizing <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Cluster Options allow you to change styling information, in close detail, on your map. This applies globally -- ie, *all* clusters on the map will be styled the same way. Clusters are broken into three sizes: **Small, Medium**, and **Large**.

For each of these cluster sizes, you can define the **color**, the "**count**" that defines how many points means a given cluster is Small, Medium, or Large, the **border color**, and the **border width**. This allows you to make clusters really work with your overall style and layout.

### Image on Cluster <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Add an image for your cluster instead of the default coloured circle. The image should not be more than 150x150 pixels in size. The number associated with the cluster will still appear in the middle of the image.


# Interactivity

Define how users can interact with your map.

### Zoom on Scroll

Users can use their mousewheel or touch to zoom the map. Turn this off to prevent users from getting "stuck" on the map while scrolling through a page.

### Interactivity

Turn off all interactivity with the map (zooming, panning, clicking, etc).

### Cooperative Gestures <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Cooperative gestures require the user to press a button or use multiple fingers to scroll.

### Allow Rotation and Pitch

Modify the ability for users to rotate and angle the map without affecting other interactivity.

### Open Popups in Sidebar

Instead of popups opening in their little popup windows, open them in an HTML sidebar instead (which will be placed on top of the map. You can set the **Minimum** and **Maximum** sidebar width.

### Restricted Movement <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Restrict the ability for users to move beyond a certain **bounds** (defined by a set of corner points) and/or restrict their zooming between two given zoom levels.


# Controls


# Basic Controls

Standard controls for your map.

### Zoom Control

Adds a +/- button, along with a small compass that allows users to quickly revert to north if they've rotated the map.

### Scale Control

Adds a [translucent scale](https://docs.mapbox.com/mapbox-gl-js/example/navigation-scale/) onto the map.

### Fullscreen Control

Add a button that allows users to make the map cover the entire screen.

### Attribution Control

Move around the required attribution text for your styles.

### Logo

Modify the position of the logo included with Mapbox or Maplibre.

### Map Type Control <sup><sub>*<mark style="color:blue;">\[Google Maps]</mark>*<sub></sup>

Allow users to switch between satellite, street, and other map types.

### Street View Control <sup><sub>*<mark style="color:blue;">\[Google Maps]</mark>*<sub></sup>

Allow users to access Street View.


# Geocoding & Geolocation

Controls for making it easier for your user to locate places on the map.

### Geocoder Control <sup><sub>*<mark style="color:blue;">\[Requires Mapbox access token]</mark>*<sub></sup>

Allows users to search for real-world locations and zoom to them quickly on selection.&#x20;

* **Limit results** by country code (use [2-letter country codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2))
* **Limit results** by bounds
* **Allow users to enter coordinates** directly when searching for a place <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>
* **Modify the search placeholder text**
* **Change the marker color** automatically placed <sup><sub>*<mark style="color:blue;">\[Mapbox]</mark>*<sub></sup>

### Geolocation Control

Allow users to quickly find themselves on the map by pressing a button.

* **Geolocate on map load** <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>&#x20;
* **Show a circle around the user point** that represents accuracy of the geolocation <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>
* **Show user heading** (direction the user's device is pointing) <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>
* **Track user location** by updating the position automatically as the user moves <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>
* **Enable highest possibly accuracy** of the user's device (browsers are less accurate than mobile devices)

### Directions Control <sup><sub>*<mark style="color:blue;">\[Requires Mapbox access token]</mark>*<sub></sup>

Add a directions interface for entering start and end locations.

* **Change units** between metric and imperial
* **Change default directions type** between Driving/Traffic, Driving, Walking, Cycling
* **Change placeholder text**


# Togglers

Controls that enable and disable certain effects on the map.

### 3D Control

Quickly change the map from a top-down view to an angled view to leverage 3D layouts.

### Layer Control <sup><sub>*<mark style="color:blue;">\[Mapbox, Maplibre,</mark>*<sub></sup><sup><sub>*&#x20;*<sub></sup><sup><sub>*<mark style="color:green;">Pro</mark>*<sub></sup><sup><sub>*<mark style="color:blue;">]</mark>*<sub></sup>

Adds an area for users to turn off and on different layers on your map, as defined in your Mapbox Studio Style or in your Custom Style JSON. [See an example here](https://wpmaps.mapster.me/examples/mapster-wp-map/layer-control/).

<figure><img src="/files/5jHc0pUwp4gjvfjiiIeO" alt=""><figcaption><p>Simple Layer Control.</p></figcaption></figure>

In the left-hand side text area, you can enter layers on each line that you want to turn off and on when the user toggles them. You can add multiple layers to each line by separating them using commas, such as

```
country-label, admin-0-boundary
```

Make sure these layers correspond correctly to the layer names you've given in Mapbox Studio -- otherwise your map will have an error!

On the right hand side, add the text that you want to show for each of the toggles.

Choose the **Checkbox Type**, which can be switches, checkboxes, or radio buttons. Radio buttons mean that only a single set of layers can be shown at once. If you select this, make sure that only one of your layers is visible on the map load, otherwise the control may turn layers off by accident.

{% embed url="<https://www.youtube.com/watch?v=hp2oJba03mc>" %}

<details>

<summary>Screenshot examples of entering layers into editor</summary>

<figure><img src="/files/xXpnNgDPv0hEARfcFwAb" alt=""><figcaption><p>A simple layer control toggling single layers by checkboxes.</p></figcaption></figure>

<figure><img src="/files/h1jJhBGXTgVoF3ZNGUOH" alt=""><figcaption><p>A more complex layer control, with some buttons toggling multiple layers.</p></figcaption></figure>

</details>

### Style Switcher Control <sup><sub>*<mark style="color:blue;">\[Mapbox, Maplibre,</mark>*<sub></sup><sup><sub>*&#x20;*<sub></sup><sup><sub>*<mark style="color:green;">Pro</mark>*<sub></sup><sup><sub>*<mark style="color:blue;">]</mark>*<sub></sup>

This adds an area on the map with a list of styles that you choose that users can toggle between. [See an example here](https://wpmaps.mapster.me/examples/mapster-wp-map/style-control/).

<figure><img src="/files/ohySE4P1cjG9jfdo6r8I" alt=""><figcaption><p>Simple Style Switcher Control.</p></figcaption></figure>

To set this up, go to Controls when creating your map. Make sure you are not using a Google Map, and turn on the Style Control. Then, enter in each Style URL or Custom JSON in the left-side textbox, and titles on the right-hand side. Each entry should be on a different line so that the plugin can associate the correct style with the correct title.

If you are using a Custom JSON, make sure to use a tool like <https://www.textfixer.com/tools/remove-line-breaks.php> to remove all line breaks from your JSON before pasting it in. A couple examples of this are shown below!

{% embed url="<https://www.youtube.com/watch?v=bRl7Iy__PDE>" %}

<details>

<summary>Screenshot examples of entering styles into editor</summary>

<figure><img src="/files/GhxmIYpTWLHTJVfXqMNa" alt=""><figcaption><p>A simple Style Switcher using Mapbox Style URLs.</p></figcaption></figure>

<figure><img src="/files/7DQTVNDPgQ9bFAfxlZ8f" alt=""><figcaption><p>A more complex Style Switcher with custom JSON data.</p></figcaption></figure>

</details>

### Control Menu <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Put controls into a toggleable menu in order to preserve space on the map. Controls you've added will be visible here and you can reorder them as desired.


# Other Controls

Controls that are hard to categorize :)

### Download Control <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Adds the ability for users to download the current data visible on your map as a CSV.

* **Let category filters affect data download** or not
* **Notify specific users when download occurs** via email
* **Include only the fields you prefer when users download data**. To find the names of the fields, download the full CSV and use the header names you see there to exclude them using comma separation

### Print Control <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Allow users to export a quick PNG of your map for use in other applications or to print.

{% hint style="info" %}
We are looking into adding more customization to this control, such as different formats and 300 DPI exporting. Please get in touch if this is an important feature for you and we will try to accomodate!
{% endhint %}

### Custom HTML Control <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Add totally custom HTML. This is suitable for a legend or any custom interactive material you might want to show. [See an example here](https://wpmaps.mapster.me/examples/mapster-wp-map/custom-html-control/).

You can enter HTML and CSS if you put it into a style tag, like the image below.

<figure><img src="/files/ibnVlBAJq4GE8Shxxeui" alt=""><figcaption></figcaption></figure>


# Control Render Order

Take control of how your controls appear on the map.

While you can position controls in different areas around the map in the free version, in Pro you have access to:

### Control Order <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

All the controls you've added to your map will appear here. **You must save your map first before they show up**.&#x20;

Once they are visible, just drag and drop them to reorder the render order. If you have multiple controls in one part of the map, they will then be changed to the order you've given.


# Filters


# Category Filter

Allow users to toggle features on and off based on different categories.

The Category Filter creates a toggleable list of Categories that you have associated with your Locations, Lines, and Polygons added to the current map. These are presented in a list, and include parent and child relationships. Users can toggle checkboxes on or off, thereby adding and removing different features from the map. You can initialize features as on or off depending what you require.

Categories will also display hierarchically if you have child categories.&#x20;

{% hint style="warning" %}
Any feature that has a child category should **also** have its hierarchical parent categories, otherwise the layout may not work properly.
{% endhint %}

<figure><img src="/files/tyaknCno8UlCKIwWbtH6" alt=""><figcaption><p>A basic example of the category filter.</p></figcaption></figure>

### Category Display

Select if categories will show colors, icons, or nothing beside them. These colors and icons can be defined in the *Categories* section of the Wordpress plugin (inside Maps > Categories).

### Checkbox Display

Pick whether your categories will be toggled with switches or checkboxes.

### Advanced Features <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

{% embed url="<https://www.youtube.com/watch?v=nlqeebcM0rU>" %}

### Show Number of Features <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Display the number of features included in a given category in parentheses.

### Functionality <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

This applies to cases in which features may have more than one category or filterable property. Filters are *exclusive* when any of the properties or categories being turned off means the feature disappears. *Inclusive* means that all of the properties or categories must be turned off before the feature disappears.

### Independent Children <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Child categories will function independently of whether or not their parent category is turned on. For this, you'll want to make sure that your child categories don't have the parent category clicked on (or, use inclusive filtering).

### Parent Category Display <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Choose whether you want parent categories to show checkboxes or only be used for visual structural organization of their child categories.

### Excluded Categories <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Select any categories that should not be shown in the category filter.

### Initial Visibility <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Set whether categories should be on or off when the map first loads.

### Preselected Categories <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

If you turn initial visibility off, you can still choose individual categories that should be started as visible.

### Category Order <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Allows you to have the categories appear, both parents and children, in whatever order you want.

### Reset Button <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Adds a button to reset all categories to their original loaded state.

### Additional Filters <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Use properties from your geographic data (imported or added onto posts), or ACF data, to create additional filters.

First, you'll need to make sure your features actually have the data. You can see properties from geographic data in any given feature under "Custom Properties", and ACF fields will show up in the appropriate post types.

<figure><img src="/files/FnDG4OcJqcN3kTwpo0VG" alt=""><figcaption></figcaption></figure>

Next, you'll use some special syntax to tell the Category Filter which properties to include under which headers. The syntax looks like this:

```
property_name : Label

acf_property_name : Label 2
```

If you are using a Custom Property, enter the property name only (no acf\_ required) and then the label you want to show for that property heading, separated by a colon.

Unlike the Advanced Popup, you don't need to get the field ID from ACF, and you don't need to use curly braces. Just enter the "name" of the ACF field, or the name of the property. This feature will run into problems if you have a property and an ACF field with the same name, though.

If you've added these correctly, they will now show up alongside your categories in the Category Filter, and will integrate completely with the Inclusive and Exclusive filtering.

### Render in External Div <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

The category filter will render into a div of your choosing on the page, instead of appearing directly as a control on the map. This can free up space in the appearance of your map.

### Accordion Layout <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Makes a neater appearance by having categories render in dropdown expandable rows.

Nested categories can be rendered as an accordion, which will open the first parent automatically and then only open other parents when they are clicked open by the user. This is great when you have a lot of categories.


# Custom Search Filter

Let users search through your features in a list dropdown.

The Custom Search Filter will give the user an input box to type into, and using their text, it will search through the post titles and popup text you've added in order to present clickable results that will zoom to the relevant feature.

If you want, you can include a geocoder with this -- meaning that users will be able to search both the features you've added *and* real-world locations together. Your features will always appear first in the list if any match is found.

<figure><img src="/files/Gp7EPMXINAYhZzYYi2S0" alt=""><figcaption></figcaption></figure>

### Include Geocoder <sup><sub>*<mark style="color:blue;">\[Requires Mapbox access token]</mark>*<sub></sup>

Allow users to search both general address and your feature information at the same time.

* **Limit results** by country code (use [2-letter country codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2))
* **Modify the search placeholder text**

### Number of Results <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Adjust how many results are returned maximum

### Search Type <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Adjust whether search results must find an exact match, match any term, or match all terms entered. [You can see examples here](https://wpmaps.mapster.me/examples/#controls-filters).

For instance, if you have three points, and they have the titles:

* Bear Lake Station
* Station Grudge Bear
* Lake Bear Station

And someone searches "Bear Lake", then:

* With Exact Matching, "Bear Lake Station" will show up
* With Any Term, all three will show up (all match "Bear")
* With All Terms, "Bear Lake Station" and "Lake Bear Station" will show up

### Embed on Separate Page <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

To make a unique landing page that users can use as a portal to search your map like on popular real estate websites like AirBNB, use the shortcode generated in this section.

You can then style the front-end search form to make it look how you want and have it direct users to specific popups, locations, or shapes on your map.


# Filter Dropdown

A simple list of features on your map presented in a clickable set.

The Filter Dropdown is a simple list of the features on your map, through which users can scroll in order to find a specific feature. Use this if you don't have a huge number of features on your map.

### Display Images <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Show the featured image from the popup in the list above the title.


# Lists

Make a clickable list of all the features shown on your map.

The List is an interface that will present locations to your users as a list on your map. This is perfect for creating a [Store Locator](/maps/lists/store-locator).

<figure><img src="/files/it5vMl44DI3B2G7PUA9a" alt=""><figcaption><p>Simple list with geocoder.</p></figcaption></figure>

### Include Geocoder

If you want to include a location search on top of your list, use the Geocoder Control in the "Controls" section, and it will interact naturally with the List.

### Sort by Distance

Sorts by the distance of the current map's center (adjusting as user searches or moves).

### Show Distance

Show distance from the map center to the shape's center. You can also choose the **units**.

### Listing Type

You can make the list eternally scrollable, or have it break into paginated sections. If paginated, you can choose the **number of locations** to show on the list at a single time.

### Render in External Div

If you want the list to render outside the map in a custom div, put the div ID here.

### List Order <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Automatically sort the items in your list by menu order, title, slug, or ID. By default, they render by date.

### Display Images <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Show thumbnail images above the title in the list.

### Group by Category <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

You can group items together by their categories into individual accordion lists, further compressing your list.


# Store Locator

An advanced List that creates a customizable list of locations.

Store Locators are one of the more complex and useful pieces out there for everyday mapmaking. We've added a lot of features into this addon to help you get started making a pretty and functional Store Locator for your site. [See an example here](https://wpmaps.mapster.me/examples/mapster-wp-map/sample-store-locator/).

{% hint style="warning" %}
**When you've installed Pro, first, go to Settings and turn on the Store Locator**. Then proceed to the rest of the instructions.
{% endhint %}

{% embed url="<https://www.youtube.com/watch?v=5yyfJFt5824>" %}

### Adding Locations

With the Store Locator, you add Locations the same way you normally would with any Mapster map. Add Locations by going to Maps > Locations, and adding them one by one.

There will be a new set of fields under the content in the Locations, called "Additional Details". You can turn this on to add more information about any given location. This includes entering an **address**, **phone number**, **hours**, **website***,* and **social media links**.

For every type of Geography Type, you can create it and edit it by drawing directly, or by uploading a pre-created geoJSON for that geography type.

You can also enter a short description that will appear when a user clicks on a specific location.

To make it easy for yourself, create a category and add all your Locations to that category, so you can add them easily and quickly to your map later on.

### Making the Map

Once you've created your Locations, create a new map. Add your locations inside the Features tab by selecting the category you created to hold the locations, and all your locations should be added to the map.

Now, to add the sidebar that allows users to search for locations, click on them, see hours, and more. Go to the Filter & List tab, and scroll down to List. Enable this, and then scroll down more and you'll see "Store Locator Options".

Turn on "Enable" to turn on a special interface more appropriate for Store Locators. You can see an example in the screenshot below.

You can also sort the hours you assign to locations by days rather than having them appear from the beginning to the end of the week. This means that, based on the current day, the hours for today will show up first in the store locator listings.

{% hint style="info" %}
You may want a full-screen Store Locator. To do that, turn on the full screen replacement in your Map by going to Setup > Layout, and selecting the Full Page and Ignore Container options.
{% endhint %}


# Specialty Maps


# Map Comparer

Show two maps at once with a slider, allowing exact comparison.

Creating a map that shows two different maps at once, with a slider between them, is a great way to show change over time in a map. Creating this is quite straightforward when you're using Mapster WP Maps. This works in both Maplibre and Mapbox maps -- but you can't mix them. You must compare two Mapbox maps or two Maplibre maps. [See an example here](https://wpmaps.mapster.me/examples/mapster-wp-map/map-compare-example/).

{% embed url="<https://www.youtube.com/watch?v=jMA5gyWytnc>" %}

<figure><img src="/files/b8WSKTiSeHx61y2Soird" alt=""><figcaption><p>Users can slide back and forth or move around the map to see changes over time.</p></figcaption></figure>

First, you will need to create your two maps. These are created as normal in Mapster WP Maps. However, you should bear in mind that it's probably best to make sure both maps have the same starting zoom, center, pitch, and rotation. That way, when the map comparer loads, it will be in the same place for both maps.

It's also best if you make your more heavily featured map as your base map, so that loading will happen efficiently.

You can make sure your maps have different Styles loaded, or just maps with different markers and geographical features loaded in. Anything normally added to your map will be visible in the comparer.

Next, in the map you want to appear on the left-hand side, go to your Map edit page. Go to Specialty Maps > Map Compare, and turn it on. Then select the map that will appear on the right side of the map slider.

Voila!


# Heatmaps

Heatmaps are a great way to show large amounts of data.

Mapster WP Maps Pro offers a lot of options when it comes to creating a heatmap and managing it directly inside Wordpress. This requires a Mapbox or Maplibre map. [See an example here](https://wpmaps.mapster.me/examples/mapster-wp-map/heatmap-example/).

{% embed url="<https://www.youtube.com/watch?v=aAY0rJD3-2c>" %}

<figure><img src="/files/P5DPDs4YqZOpueST0Q8u" alt=""><figcaption><p>Map with some simplified earthquake data.</p></figcaption></figure>

The functionality of the heatmap in Mapster WP Maps Pro is very similar to the [example shown here](https://maplibre.org/maplibre-gl-js-docs/example/heatmap-layer/) in the Maplibre documentation.

First, you need to create the Locations for your heatmap. This would be done most efficiently by [importing](broken://pages/MauPr4OctdMGXj1MWFKN) many features at once and assigning them a common category. Once they are imported, create a new Map and add those features to the map.

After you've added the features, go to Specialty Maps > Heatmap and enable the heatmap.

<figure><img src="/files/2XSqX9Yy9JcY63w2XhtS" alt=""><figcaption></figcaption></figure>

You'll need to choose the Location Type to turn into a heatmap with **Heatmap Layer**. All of the geographic features of that type will be substituted with a heatmap.

**Layer Visibility** allows you to cause the original features (markers, circles, or icons) to reappear once the user zooms in far enough. This can allow users to open popups or see the exact location of data once they are zoomed in to a certain level.

If your data has a specific property you'd like the heatmap to cluster with, enter the property name in **Weighted Property** field. This should correspond to metadata that you uploaded or created with your locations. Otherwise, your heatmap will cluster strictly by proximity. You can use ACF fields as well -- just make sure you give the full ACF field  name.&#x20;

**Intensity** works with the Weighted Property to increase the overall intensity of your heatmap. Play with this to get a broader range of colors.

For the **color range**, you can enter as many colors as you like, from low to high intensity. You may enter hex values, RGB, or RGBA. Be aware that every color should be on a separate line!

You can change the **Point Radius** to change the overlaps of the points when the heatmap is generated. A larger number will generally create more overlaps, causing a more intense but less geospecific heatmap.

Finally, modify the **opacity** to change the overall transparency of the heatmap layer on your map.


# Elevation Profile

Show the elevation of a line over its distance.

Elevation maps can be great for showing more information about trips, runs, or other information concerning paths where elevation change is a factor. With Mapster WP Maps, you can create elevation profiles for single-line maps or multiple-line maps, depending on what you need. [See an example here](https://wpmaps.mapster.me/examples/mapster-wp-map/elevation-chart/).

<figure><img src="/files/MQf5MLTBdW1JNKPjwS0Y" alt=""><figcaption></figcaption></figure>

The elevation chart will show the corresponding dot on the map as you mouse over the chart, so you can see where the elevation changes with ease.

### Single Line Maps

To create an elevation profile for a single line, first, create that line as a geographic feature. Style it however you like. Then, create a new Map and add that single line as the only Line feature in the map (if you add other lines, this will likely cause issues).

Once you've added that, go to Specialty Maps > Elevation Line Chart and click Enable. Then choose the Single Line option, and decide if you want the elevation profile to load immediately on the map load, or whether it should only be accessible by the user clicking the small "mountain" icon control that will appear on the map.

You can also select the profile line **color**, as well as the **units** (feet or meters).

<figure><img src="/files/1LxhGgBM5wP6ZGveU3iz" alt=""><figcaption></figcaption></figure>

### Multiple Line Maps

Multiple line maps work in a similar way, only you can add multiple lines to your map and they will each cause the elevation chart to open and be generated on click. Disable the **Single Line** option.

### Additional Features

Some additional features we are considering include:

* The ability to upload GPX elevation data to allow higher accuracy
* Showing multiple elevation profiles at once

Please get in touch if these features are valuable to you and we can work on them with more urgency.


# User Submission

To see details on user submission, see the [relevant doc page here](/pro-sections/user-submission).


# Listing Page Map

Make a page with locations or areas listed and interactable between the map and your posts.

With Mapster Pro, you can create a page that will list the posts that you've attached to a map beside them, and allow users to interact with the post listings and have things change on the map. This is easiest to see in an example like the one below.

This type of map can be a little tricky to set up, but these instructions should help you to get going.

[See an example of the Listing Page Map here](https://wpmaps.mapster.me/examples/mapster-wp-map/listing-map/).

### Make Your Posts, Then Geographies, & Associate Them

This type of map was originally built for polygons, but it should work equally well with other types of geographies. The idea is that you create a geography in Mapster, and then "associate" that geography with another post in your Wordpress installation. It doesn't matter what post type your other post is, you can associate it in the sidebar area of any geography that you create.

<figure><img src="/files/Zbu25il2Ddh7kxB63pKU" alt=""><figcaption><p>Here, you can select the post to associate with your geography.</p></figcaption></figure>

This associated post will be used to create the "Listing" side of the Listing Map. It will use the Title and Featured Image of this post in order to create the listing itself, and when the user clicks on the listing, they will be directed to the post's URL on the frontend.

### Create the Listing Map

For the listing map, not every geography that you add will be shown in the Listing area. Only those geographies that are "associated" with other posts in your installation will be shown.

So, feel free to add any geographies you want as if you were creating a normal map! This can be handy to add labels on top of polygons, for instance, if you want to only associate posts with polygons but still show neat labels on top of them.

Make sure to go to the "Specialty Maps" section and select "Listing Page".

You can choose a few options:

* Lazy load (still in development)
* Center on hover -- when a user hovers over one of the listings, the map will automatically center on the associated geography
* Listing style -- choose between an image grid (great if you have featured images) or just a simple list
* Sticky map -- if you have a long set of listings, the map will move smoothly beside the listings as the user scrolls down the page

### Adding the Shortcodes

The best way to add the Listing Map and the Listings into your installation is to use the provided shortcodes in different container \<div>. You can find the Map shortcode on the "Maps" page in Wordpress, and the Listing shortcode in the "Specialty Maps" > Listing Page area of the specific map you created.

<figure><img src="/files/f2Ek7WwGGzLJTYEXM4x7" alt=""><figcaption></figcaption></figure>

Put these shortcodes into the areas you want them to appear on your page -- usually best as two columns -- and you should see your listing map appear!


# Preloader

Select from a few different presets to show when your map is loading.

The preloader graphic appears before your map is fully loaded.

### Loading Graphic

By default all of the loaders visible at [Sam Herbert's SVG Loaders](https://samherbert.net/svg-loaders/) are enabled. Select from among them here.

You can also upload your own by selecting **Custom** and uploading an image.

### Background Color

Choose the background color and transparency, which will show as an overlay on top of your map container as it's loading.

### Loader Color

If you've selected one of the preset loaders, you can change its color here.


# Developer


# Javascript

Add a custom function.

Here, you can add a Javascript function that should be run after the map has done initializing. This is a simple way to hook into any given map and manipulate displays or controls as you need.

{% hint style="info" %}
If you need more advanced hooks with Javascript, check out the Developer section on [hooks](/developer/hooks).
{% endhint %}

Enter the name of a function here. For example, let's call our function "myCustomScript".

Create a global function with that script name. Your script will automatically receive a "map" and a "features" variable. For Maplibre and Mapbox, this will be a map object matching those libraries; for Google Maps, it'll be a map object matching the Google Maps API. As follows:

```
window.myCustomScript = function(map, features) {
	console.log(map);
	console.log(features);
}
```

{% embed url="<https://www.youtube.com/watch?v=ZAuJYJ6IoA8>" %}


# Embedding Maps

Allow other websites to embed your map

{% hint style="warning" %}
Available in Pro only.
{% endhint %}

Allowing external users or apps to embed your maps expands the breadth of your creativity hugely. We're also working on API options so you can call your map data from a mobile app! Get in touch if you need this ASAP.

**When you've installed Pro, the menu items under "Embed & API" will be visible when editing a Map**.

To embed a map, simply go to the Embed & API section when on a given Map edit screen, turn on Allow Embed, and copy the embed code that appears underneath. You can give this to other users or place it on other sites as needed.

### Setting Parameters

You can manually set the center and zoom of an embed code according to the URL if you like!

Set it using query strings on the URL that's given to you, for example like:

```
<iframe src="http://mapster-wordpress-maps-development.local/wp-content/plugins/mapster-wordpress-maps/admin/includes/mapster-embed-map.php?map_id=1609" />
```

You can add&#x20;

* \&latitude=\<lat value>
* \&longitude=\<lng value>
* \&zoom=\<zoom value>

to the URL, like

```
<iframe src="http://mapster-wordpress-maps-development.local/wp-content/plugins/mapster-wordpress-maps/admin/includes/mapster-embed-map.php?map_id=1609&latitude=0&longitude=0&zoom=2" />
```

### Permissions

However, you may not want your map to be embeddable anywhere on the internet. To only allow specific users, turn on **Protect Embed** and, in the text area below, enter each domain you want to allow on a separate line.

![](/files/JdMc9SsooljC49GfUOrP)


# Faster Loading (Cache)

Make your maps with tons of data much faster to load!

{% hint style="warning" %}
Available in Pro only.
{% endhint %}

Although we don't generally recommend using Mapster for many thousands of features (it's better to start looking into tiling services at that point), it can be functional depending on your use case. If you have a lot of geographical features and you are finding that the map is slow to load -- or you just want to optimize your site and load time -- you can look into using our Pro Caching feature.

<figure><img src="/files/u9h3TZDTMfuUex41MAtq" alt=""><figcaption></figcaption></figure>

Caching will create a static file that contains all the geographic information for your map, so that the Wordpress backend doesn't have to execute any complicated PHP queries in order to put together all that information on an on-demand basis for users.

This is great for a few use cases:

* Speeding up responses for maps that aren't updated often
* Preventing maps that contain hundreds or thousands of features from executing long queries on every load

For maps that are updated automatically or very often, the caching feature isn't ideal, because a new cache needs to be manually generated every time.

**To create a cache**, just go to the "Developer" tab for the map you want to cache. Make sure the map has all the features and settings you want. Turn on the "Cache" button, and then press "Generate Cache". Depending on the size of your map, this may take up to a minute to generate, and then you will get a success message.

As long as the button for the Cache stays on, your map will now use the cache.

Anytime you make an update, such as adding features or changing settings, you will need to Generate Cache again for those to show up in the front end.


# Caching

Make your page load extremely fast with caching.

{% hint style="warning" %}
Available in Pro only.
{% endhint %}

Normally, when you load a map on the frontend, Wordpress has to assemble all the posts along with all their metadata and send it to the user. Then the user receives this, and the response is parsed and the geographies loaded onto the map.

The heaviest part of this — the part that slows down loading the most — is the work Wordpress has to do in order to assemble and query all the geographies. If you have hundreds or thousands of geographies, this can take more than a few seconds, especially if you have a lot of metadata too.

**The cache** works by generating this response one time, and then placing it into a static file in your **Uploads** folder. This file is then returned instantly whenever your map is loaded. This means the response time only requires the user to load the file and have it parsed.

If the file is large — with many thousands of complex polygons, for instance — the time could still be slow, but it will be many times faster than Wordpress querying it.

### Downsides to Caching

When you cache, it generates a static file of your map *at that moment*. That means that any new geographies you add, or any changes you make to existing geographies or map settings, won't be automatically included.

When you make these changes, remember to come back to the Cache section and press "Refresh Cached Response" in order to update that static file.

### How to Use Caching

Turn on Use Cache and then press Generate Cache Response. Once it's done, then you are now using a cached file!


# Progressive Loading

This feature is currently under development!


# Query String Control

Use a custom query string to open your map directly on a specific marker.

With this functionality, you can cause your map to open directly onto a specific marker when loaded. This might be useful if you want to have a lot of features on a map, but you still want users to be oriented to a specific marker or feature when the map loads.

Using a query string, you can set:

* Initial marker that should center and open any associated popup (`?marker_id=<id>`)
* Custom latitude and longitude (`?lat=<number>&lng=<number>`)
* Custom zoom (`?zoom=<number>`)

To use this feature, you don't need to change any settings in your map. Instead, you need to modify the URL that you provide to users or use for your links.

You can see an example of the form of the URL at our example site:

<https://wpmaps.mapster.me/examples/mapster-wp-map/printing-map/?map_id=914&marker_id=705>

The usual URL for this map is as follows:

<https://wpmaps.mapster.me/examples/mapster-wp-map/printing-map/>

So you can see that we add a query string to the URL.

This query string is in the form:

`/map_id=<map_id>&marker_id=<marker_id>`&#x20;

Or

`/map_id=<map_id>&lat=<number>&lng=<number>&zoom=<number>`

Even if there's only one map on the page, you have to specify the map\_id. You can find this on the Maps page in the Wordpress admin:

<figure><img src="/files/XF1s0bN8wVuave0bnXs5" alt=""><figcaption></figcaption></figure>

And you can find the particular ID for a given Location (marker) on the Locations admin page:

<figure><img src="/files/picZTlk70lYx9cmwQ1hH" alt=""><figcaption></figcaption></figure>

Using these two pieces of information, you just add the query string to the end of your URL, and from then on you can provide that URL to users and it will open on the specific marker you specified! It will also automatically open any popup associated with that point.


# Markers

Markers are the default display of a location post type.

Markers are displayed using a traditional "map markers" icon, and are HTML elements.&#x20;

To add one to your Location post, press "Replace Drawing" and click on the map, or search for a location, or enter a latitude and longitude.

{% hint style="info" %}
To set a **custom image** as your marker, use the Icon & Label Location type instead of the marker type (this is because Mapbox and Maplibre don't generally play very nicely with custom icons for traditional markers).
{% endhint %}

### Color

Set a color for the marker.

### Scale

Adjust the marker size.

### Rotation

Rotate the marker around a central point.

### Anchor

Choose where the marker is anchored to the underlying map point.

### Hover Effects <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

You can change the **Color, Scale,** and **Rotation** on hover.

### Default Zoom Level

Set the zoom level when this point is clicked or zoomed.


# Circles

Circles are another way to display a single location.

To add one to your Location post, press "Replace Drawing" and click on the map, or search for a location, or enter a latitude and longitude.

### Radius

Set a size for the circle.

### Opacity

Adjust the circle transparency.

### Color

Set a color for the circle.

### Border Width

Choose if you want to show a separate border around your circles.

### Border Color

Set a color for the border.

### Border Opacity

Set a transparency for the border.

### Static Circle <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

This will cause the circle shape to be locked to the real-world map. Normally the circle remains the same visual size as you zoom in and out. With this selected, it will not. You may have to radically change the circle radius in order to ensure the circle is the size you want.

### Hover Effects <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

You can change the **Radius, Opacity, Color, Border Width, Border Color,** and **Border Opacity** on hover.

### Default Zoom Level

Set the zoom level when this point is clicked or zoomed.


# Labels

Create totally custom text with labels.

To add one to your Location post, press "Replace Drawing" and click on the map, or search for a location, or enter a latitude and longitude.

{% hint style="info" %}
Labels can work together with [Icons](/locations/icons), creating a marker with text under or on it if you wish.
{% endhint %}

### Label Text

Enter the actual text to be shown in the label.

### Font

Choose from a variety of built-in fonts provided from an external open-source provider. To add more fonts to a Mapbox map, you should load that into your Mapbox Style itself.

### Font Size

Change the pixel size of your font.

### Color

Set the text color.

### Opacity

The transparency of your label.

### Rotation

Rotate the text.

### Position X & Position Y

You can set the text to be offset by a certain amount horizontally and vertically.

### Outline Width

By default, the text has a "halo". Set the width here.

### Outline Color

Set the color of the halo.

### Outline Blur

This affects the gradient with which the halo fades into the background.

### Default Zoom Level

Set the zoom level when this point is clicked or zoomed.


# Icons

Create totally custom icons.

To add one to your Location post, press "Replace Drawing" and click on the map, or search for a location, or enter a latitude and longitude.

{% hint style="info" %}
Icons can work together with [Labels](/locations/labels), creating a marker with text under or on it if you wish.
{% endhint %}

### Image

Set the image for your icon. It's best to use an appropriately-sized image. Most image types are accepted.

### Scale

After adding your image, it might render at an unexpected size. Set the size as you want here.

### Opacity

Set the transparency of your icon.

### Rotation

Rotate the icon if needed.

### Position X & Position Y

Adjust the position offset of your icon from the center point horizontally and vertically.

### Anchor

Set the anchor point of the image. Ideal if you are using a custom marker icon is setting this to "Bottom".

### Static Size <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

This will keep the icon a static real-world size — meaning that its edges will be anchored to the map. You will probably need to play with the scale after selecting this to make your icon the size you want.

### Hover Opacity <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Adjust the transparency on mouse hover.


# 3D Models

A great way to do some special visualization of points.

To add one to your Location post, press "Replace Drawing" and click on the map, or search for a location, or enter a latitude and longitude.

You'll need to add a valid model to see it on the map.

### 3D Model File <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

For now, we prefer GLB files. However, please get in touch if you need others to work.

### Scale <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

You'll likely need to adjust this to make the 3D object the ideal size. If you can't see it, try some extremely large values.

### Rotation X, Y, & Z <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

These values will help you adjust the 3D model so it's pointed the right way. Depending on the orientation in your source file, you may need to play with these values to get them just right.

### Default Zoom Level

Set the zoom level when this point is clicked or zoomed.


# Lines

Line link together multiple coordinates.

To add a line to your Line post, press "Replace Drawing" and start to click on the map, clicking twice on a point to finish the line. You can also upload a geoJSON if you prefer.

### Bezier Line

By default, lines are drawn exactly straight between your coordinates. But you can draw a curved bezier line if you prefer. Just look for this symbol, click it, and press **Alt while dragging** to adjust the bezier curve of your line.

<details>

<summary>Bezier Line Examples</summary>

<figure><img src="/files/q5xh9OskhlHPp2UFoM1R" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/0tAnQNyMWHSMKMpQdHed" alt=""><figcaption></figcaption></figure>

</details>

### Color

Adjust the color of the line.

### Width

Adjust the line thickness.

### Opacity

Adjust the transparency of the line.

### Dashed Line <sup><sub>*<mark style="color:blue;">\[Mapbox]</mark>*<sub></sup>

Mapbox allows customized dashed lines. You can adjust the **dash length** and the **gap length**.

### Hover Color <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Adjust color when hovered.

### Hover Width <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Adjust thickness when hovered over.

### Hover Opacity <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Adjust transparency when hovered over.


# Multi Lines

Multi lines are lines that are a single shape but cover more than one line figure on the map.

To add multi lines, you can import them using the geoJSON importer in the Line post.

{% hint style="info" %}
You can import fine using Free, but to edit multi lines you will need Mapster Pro.
{% endhint %}

### Editing Multi Lines <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

To create and edit Multi Lines, look for the button in the geometry creation section that says "Edit As MultiLineString".

<figure><img src="/files/Wz7ayu7UTLIrVuhGKjDQ" alt=""><figcaption><p>An example from MultiPolygons, but MultLines are the same.</p></figcaption></figure>

This will open a popup window, either with the existing Multi feature or with a way to draw the multi feature. The instructions in the popup should be clear, but just to reiterate: you must **shift-click** different discrete features in order to join them together as a multi feature.&#x20;

You can separate them by clicking and pressing the "Separate" button, and then edit each feature independently by clicking on the lines and dragging.

This uses Mapbox GL Draw internally for the editing on the map: see the [Mapbox docs](https://github.com/mapbox/mapbox-gl-draw) for more information on this.\ <br>


# Flat Polygons

Polygons cover a specific area.

To add a polygon to your Polygon post, press "Replace Drawing" and start to click on the map, clicking twice on a point to finish the polygon area. You can also upload a geoJSON if you prefer.

Flat polygons are standard polygons that just cover an area on the map. There are other types of polygons available as well (3D and image).

### Color

Set the color of the polygon.

### Opacity

Set the transparency of the polygon.

### Outline Color

The outline color is a 1 pixel border around polygons. Unfortunately the width *cannot* be adjusted. To make an adjustable border around your polygon, the best strategy is to make a line that has the same geography as your polygon.

### Hover Color <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Color of polygon when hovered.

### Hover Opacity <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Transparency of polygon when hovered.

### Hover Outline Color <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Color of outer border when hovered.


# 3D Polygons

3D polygons cover an area and add an additional 3D height visible when the map is tilted.

To add a polygon to your Polygon post, press "Replace Drawing" and start to click on the map, clicking twice on a point to finish the polygon area. You can also upload a geoJSON if you prefer.

{% hint style="info" %}
To see the 3D nature of the polygon, be sure to tilt the map by holding the right mouse button and dragging the map.
{% endhint %}

### Color <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Set the color of the polygon.

### Base Height <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

This is the bottom height of the polygon. By default this will be on the ground, but you can make it higher if you like.

### Top Height <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

This is the top of the polygon. It should be a larger number than the base height.

### Hover Color <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Color of polygon when hovered.

### Hover Base Height <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Base height of polygon when hoeverd.

### Hover Top Height <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Top height of polygon when hovered.


# Image Polygons

Place an image on your map stretched to a specific bounds.

Image polygons are a new feature and may behave a little differently than you expect, but the concept is that you are able to place images onto the map to fit a polygon that you've drawn.

{% hint style="warning" %}
The polygon will *not* slice the image. Instead, the polygon you draw will serve as a guide for placing the image onto the map. You will need to add transparency to your image if you want it to be sliced to be a certain specific shape.
{% endhint %}

### Polygon Image <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Add any type of image file to have it fill the bounds that your drawn polygon has.

{% hint style="info" %}
If you need more functionality from this feature, please get in touch with us and we will be happy to explore solutions for you!
{% endhint %}


# Pattern Polygons

Add a polygon that fills with a repeating image to make a pattern.

Pattern polygons are great for adding backgrounds or a textured look to a shape on your map.

### Pattern Image <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Add a PNG or JPG to have it repeat continually across the polygon.


# Multi Polygons

Multipolygons are polygons that have holes in them, or single shapes that cover multiple areas on the map.

To add multi polygons, you can import them using the geoJSON importer in the Line post.

{% hint style="info" %}
You can import fine using Free, but to edit multi polygons you will need Mapster Pro.
{% endhint %}

### Editing Multi Polygons <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

To create and edit Multi Polygons, look for the button in the geometry creation section that says "Edit As MultiPolygons.

<figure><img src="/files/Wz7ayu7UTLIrVuhGKjDQ" alt=""><figcaption><p>An example from MultiPolygons, but MultLines are the same.</p></figcaption></figure>

This will open a popup window, either with the existing Multi feature or with a way to draw the multi feature. The instructions in the popup should be clear, but just to reiterate: you must **shift-click** different discrete features in order to join them together as a multi feature.&#x20;

You can separate them by clicking and pressing the "Separate" button, and then edit each feature independently by clicking on the lines and dragging.

This uses Mapbox GL Draw internally for the editing on the map: see the [Mapbox docs](https://github.com/mapbox/mapbox-gl-draw) for more information on this.\ <br>


# Popup Templates


# Introduction

Popup Templates are where you can create formats for map popups.

Popup Templates are design schemas for your popups. This way, you can pick what elements you want to have in different popups you'll use. You don't set the actual content of popups here -- this is just a template creation, and you'll fill in the real content on each geography feature you create.

{% embed url="<https://www.youtube.com/watch?v=ZBvQtot_8vQ>" %}

If you click "Popup Templates" on the left-hand side of the menu, you'll enter into another custom post type. This comes preset with a few popup styles that we like, but you can feel free to create your own too.

Popup Templates provide you with a basic preview of a single popup, and some basic pre-set placeholder content.

<figure><img src="/files/Akick76P7bEGosAraxif" alt=""><figcaption></figcaption></figure>


# Layout, Colors, Text, CSS

Basic layout options for Popup Templates.

### Layout Settings

* **Enable Header** — turn on/off the area that shows the title in the popup
* **Enable Image** — turn on/off any featured image display
* **Image Height** — predefine the height of the featured image
* **Image Thumbnail Resolution** — if you are making the thumbnail large, you may want to use a larger dimension than the default 300x300&#x20;
* **Enable Body** — turn on/off the main content area of the popup
* **Enable Footer** — turn on/off the bottom of the popup containing a button
* **Enable Pointer** — turn on/off the small triangular pointer on the bottom of the popup

### Background Colors

Here, you can set various background colors corresponding to the different elements of the popup.

### Text

* **Align** — set your text alignment across the popup
* **Header Text** — set the text color of the title header
* **Body Text** — set the text color of the main content
* **Button Text** — set the text color of the footer button

### CSS

* **Popup Class** — if you want to write your own CSS in a separate file, enter a class here that will be loaded on the parent of the popup, allowing you to target the popup in your CSS
* **Use Custom CSS** — if you want to completely rewrite the underlying default CSS that Mapster applies to popups, you can do it here. Please be aware that it's easy to make mistakes doing this, so be careful!


# HTML

Build a totally custom popup.

### Custom HTML <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

You can completely rewrite the HTML of the popup if you want, entering your own format and entering in custom tags that will insert dynamic content. [See an example here](https://wpmaps.mapster.me/examples/mapster-wp-map/sample-custom-html-popup/).

<figure><img src="/files/sm53sB69lHt86XuuXSBw" alt=""><figcaption></figcaption></figure>

### Dynamic Tags <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

By using the tags indicated in the description of the field, you can enter in tags that will be replaced in the front end with data of that feature post. These include:

* Header Text `{header}`
* Image URL `{image_url}`
* Content `{content}`
* Button Link `{button_url}`
* Button Text `{button_text}`
* Post Title`{post_title}`&#x20;

### Custom Fields <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

You can also reference ACF fields or custom properties that you've added to your data, similar to elsewhere in the plugin. For custom properties, add the name of the field:

<figure><img src="/files/FnDG4OcJqcN3kTwpo0VG" alt=""><figcaption></figcaption></figure>

So, in the case of the above, if you wanted to add "name" into your popup, you would add:

```
<div>Some custom {name} HTML</div>
```

For ACF fields, use the field name (not the field ID). So for the following:

<figure><img src="/files/4ylh3PpCSJJVdut9DU0T" alt=""><figcaption></figcaption></figure>

If you wanted to add the "School name", you would add:

```
<div>My custom {school_name}</div>
```


# Options

Additional options for popup templates.

### Max Width

Set the maximum pixel width of your popup to avoid overspilling content.

### Popup Anchor

This will set where the popup opens. Normally this is set to bottom, so that the little triangle points down to the point clicked. You can change it to a variety of values.

### Close Button

Choose whether or not to have an "X" button to allow the user to close the popup directly.

### Close on Click

Choose whether or not the popup should close when another feature or the map is clicked.

### Close on Map Move

Select this to have the popup close as soon as the map moves.

### Center on Open <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Center the popup window in the middle of the map when it opens.

### Zoom on Open <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Zoom down to the points when the popup opens.

### Open to Modal <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Instead of opening to a popup, open directly to a modal display that allows much more content and shortcodes.

### Starting Popup Position <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

If you've changed the size of your marker and now your popup appears a bit disconnected, or if you are having problems getting your hover to work, you might have to adjust the starting position of the popup relative to the marker. You can do that here by adding a custom distance to move the popup to the left, top, right, or bottom. The value is in pixels.


# Popup Content

Set information into your popup.

Popup content is set per-feature that you create. This means that in every geography type (Location, Line, Polygon), there is a Popup section below the main geography options. This is where you can enter the content that will show in your popup.

<figure><img src="/files/FCqpY39MObEIJ5PGIejE" alt=""><figcaption><p>Example Popup section from a Polygon.</p></figcaption></figure>

### Enable Popup

Turn this switch on to enable popups on this geography.

### Popup Template

Here is where you select a [Popup Template](/popups/popup-templates/introduction) that you've created (or one of the default that comes with the plugin).&#x20;

{% hint style="warning" %}
You must select a Popup Template in order for Popups to show!
{% endhint %}

### Interaction

Popups can open either on click or hover. If you choose Hover, you can choose whether to keep the popup **Open On Hover,** preventing it from being closed when the mouse moves off the point. You can also choose whether to enable **Click in mobile**, since there is no hover in mobile.

### Popup Header Text

Set the title header text.

### Popup Image Type

You can choose to upload a single **Featured Image**, or a set of images that make up a carousel **Gallery**.

### Popup Body Text

Enter any text you want into the Popup Body. By default, shortcodes will not work.

#### Dynamic Popup Body Text <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Use feature properties or ACF fields to dynamically fill your popup!

<details>

<summary>Detailed Dynamic Content instructions</summary>

First, you'll need to make sure your features actually have the data. You can see properties from geographic data in any given feature under "Custom Properties", and ACF fields will show up in the appropriate post types.

The screenshot below shows where custom properties can be added if you're not using ACF fields.

<figure><img src="/files/FnDG4OcJqcN3kTwpo0VG" alt=""><figcaption></figcaption></figure>

Head to any post where you want to create an advanced popup (or use the Mass Edit to change multiple popups at once). You'll use some special syntax to tell the Category Filter which properties to include under which headers. The syntax looks like this:

Copy

```
 Here's some popup content showing the {property_name}
```

Or, for ACF fields:

Copy

```
Here's some popup content showing the {acf.field_r4nd0m5tr1ng}
```

If you are using an ACF field, enter "acf." and then the field id (shown below).

<figure><img src="/files/4ylh3PpCSJJVdut9DU0T" alt=""><figcaption></figcaption></figure>

You can use this syntax in the popup header, the content, or the button text. The curly braced part will be replaced with the relevant property value or ACF value from that specific feature.

</details>

{% embed url="<https://www.youtube.com/watch?v=Fr8-G90ZsEI>" %}

### Render Shortcode <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

If you want your popups to render shortcodes, enable this. It may slow down the loading since it must render using Wordpress PHP.

### Popup Button Text

Enter the text to appear in the button.

### Popup Button Action

Select from a number of actions that can happen when the button is pressed. You can open the **Feature Post**, a **Custom URL**, a **Modal Display** with more content, **Google Maps Directions** to the point of the geography, or **do nothing**.

### Modal Details <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

If you selected to open a Modal Display, you can enter the modal details here. This is great for showing a lot more content than can fit nicely into a normal popup (as well as shortcodes).

### Open Link on Click

If you prefer to have the click open a link immediately instead of a popup, you can enable it here, then enter the **Custom URL** and choose whether it will open in a **New Window** or not.

### Open Popup On Load

Choose if you want this popup to open the instant that the map loads.<br>


# User Submission

Create a site focused on features created and submitted by users

A great way to enhance content on your site and increase user engagement is to allow users to submit and edit points and point information. [You can see a basic example here](https://wpmaps.mapster.me/examples/mapster-wp-map/user-submission-map/).

Our User Submission plugin not only allows users to create geographies, but allows you to require any other information you need from users. You can collect data from extra Advanced Custom Fields, set different permissions, and create easy search functions for users to find their posts again to edit them.

This feature works by giving you shortcodes for Create Point and Edit Point buttons, which users can press while on a page with a map on it. Then the user will be walked through a step-by-step process to add their point and fill in any extra fields you've set up.

**When you've installed Pro, first, go to Settings and turn on User Submission**. Then proceed to the rest of the instructions.

{% embed url="<https://www.youtube.com/watch?v=rU_y6v0Hq4g>" %}

### Tips

This feature is complicated, but it can really help you create a powerful submission-based site. Let us know if any functionality you need seems to be missing!

To have a truly crowdsourced map, turn Publish Immediately to on, and set selectable Categories to a category already being used in a front-end map. Then user posts will show up instantly!

Combining the ACF custom fields with our [Custom Field Popup Syntax](broken://pages/oU2zX35JHEOGqsPlC0Ss) can really superpower your site, too.


# Overview

Get a sense of how User Submission works in Mapster WP Maps

Because the User Submission feature is quite complicated and involves a lot of options, it's easiest to get a full overview with a video. Please check out the video below to get an overview of the process, what it looks and feels like, and the ins and outs of the different options!

{% embed url="<https://youtu.be/rU_y6v0Hq4g>" %}


# Submission Interface

Set options for your User Submission site

To get started, go to the Map where you want to have users submit points. Points will not necesary be tied to this specific map, but there needs to be an underlying map that will be used for the users to actually select the geographic point they want to submit.

Go to the User Submission tab, and enable Enable Submission. The first set of options is concerning the Submission Interface.

You can set **Categories** for the user to select from when they start making their point. You can customize how these look by going to the Maps > Categories area (where you create the categories), and there you can set icons and descriptive text.

By default, users can add points only by using the map directly and selecting the point. You can choose to add an **Address Search** which may make it easier for users to narrow down their selection.

By default, all posts will come through as "Untitled". You can change this by giving the ACF field "name" in the **Title Field**. This must be a field that's on the field group you've added in the [Adding Custom Fields](/pro-sections/user-submission/adding-custom-fields) stage.

Finally, you are presented with some **Shortcodes** with various options for placing your buttons wherever you would like on the page. These shortcodes have a few different parameters you can set:

* `type` refers to whether the shortcode is for users to Create a Point (`type="create_point"`) or to Edit a Point (`type="edit_point"`)
* `button_text` defines what the text will be on the button
* `header_text` defines what the header of the modal popup will say
* `modal_size` allows you to specify a modal that is `lg` (nearly full-width) or `sm` (about half the screen width)

You also *must* include the ID of the map in this shortcode (this is how the system knows which map to place the submission interface on).

```
[mapster_wp_map_submit map_id="7921" type="create_point"]
[mapster_wp_map_submit map_id="7921" type="edit_point" button_text="Edit Point" header_text="Edit Point"]
```

**To set any other messages to custom text**, you'll want to install some kind of translation plugin that allows you to edit translatable content (even if you just have one language on the site). This will let you change any of the messages shown during the point creation or editing process.

{% embed url="<https://youtu.be/rU_y6v0Hq4g>" %}


# Adding Custom Fields

Collect any information you want from users

You may want to collect more information from users than just a title, a geography, and a description. If so, you can easily integrate [Advanced Custom Fields](https://www.advancedcustomfields.com/) into Mapster WP Maps and the fields will appear immediately in your frontend forms.

At the *very* least, you should have a custom field that will let you identify the post the user submits (a title field).

Create the field set however you like in ACF, and then set it to conditionally display on the **Location** and the **User Submission** post types. It must be set to be visible on **both** of these post types to work properly.

![](/files/2xIdTNBm0CsiKlaDMA6q)

These fields will now appear as part of your front-end form, and will collect data from users. You can then user the data from these fields in other areas of your site -- output their data in a custom popup, or use them as part of the [Advanced Category Filter](broken://pages/N11qbgvuayN7PaRtbYee)!

{% embed url="<https://www.youtube.com/watch?v=rU_y6v0Hq4g>" %}


# Submission Admin

Set options for your User Submission site

After the [Submission Interface](/pro-sections/user-submission/submission-interface) options, there are a number of Administrative options you can select from to be applied during the submission process.

If you only want users to be able to submit points that fall inside a specific area, select a Polygon you've created in the Polygon section of the plugin for the **Allowed Area** option. Users will be presented with an error message if their selection falls outside of this area.

You can select either a single **Template Post** for user submissions, or multiple template posts. This will allow you to preset certain styles -- whether that's marker colors, icons, circle radius, etc -- for user submitted points, based on a generic "template" Location that you have created in the plugin.&#x20;

If you want to have different Template Posts for different categories that the user can select, check the **Multiple Templates** box to on and then select templates *in the same order as the categories* that you set above. These must have the same number of templates and in the same order to function correctly!

**Notify Users** will allow you to select site users who will receive an email whenever a user submits a point.

**Permissions** enable you to select whether anyone can submit and/or edit a point, only logged in users, or only logged in users with administrator permissions.

**Publish Immediately** allows you to set whether or not posts should be set to Draft when created (and thereby not shown immediately on any associated map), or should be made fully published right away and appear on the maps associated with the category a user selects.

{% embed url="<https://www.youtube.com/watch?v=rU_y6v0Hq4g>" %}


# Mass Edit

Edit many features at once

Mass Editing adds a ton of power and quality of life to Mapster WP Maps by allowing you to make changes en masse to selected features.

**When you've installed Pro, a new menu item will appear under Maps called "Mass Edit"**. That's where the magic happens!

{% embed url="<https://www.youtube.com/watch?v=cu5leo6jV98>" %}

Select features as a group by choosing their categories, or individually using the Locations, Lines, and Polygons selectors. It won't matter if you select the same feature twice.

Based on what you select, you'll want to edit Points, Lines, Polygons, and/or Popups. You can edit any or all of these at the same time.

Options should be familiar and look the same as they do on the main edit screen for each feature type. Just press the **Edit This Data** checkbox to tell Mapster WP Maps that you want that particular data to be changed during the mass edit.

Edit as usual, then press the Mass Edit button at the bottom, and you'll be told how many features got updated.


# General

Basic settings available in Mapster.

This is about the general settings for the plugin, found in the Settings section under the Maps menu item.

![](/files/IpZNhYmeWxFprzEm3DVH)

### Default Access Token <sup><sub>*<mark style="color:blue;">\[Mapbox]</mark>*<sub></sup>

This token will automatically load into a new map when you create one, so you don't have to add it manually every time.

### Google Maps API Key <sup><sub>*<mark style="color:blue;">\[Google Maps]</mark>*<sub></sup>

You need to enter in your Google Maps API key here if you want to use Google Maps for your map.

### Gutenberg Editor

Choose whether to turn off or on the more modern Gutenberg editing interface with Maps, Lines, Locations, and Polygons.

### Public Pages

You may not want people to be able to directly access the various types of post types that Mapster creates. You can edit that here for all the relevant post types.

### Permalinks

Set custom permalinks so that links to your map features don't show the default "mapster-wp-\<feature\_type>" permalink. This is great for your SEO and user experience.


# Account Management

The Freemius interface for managing the plugin account.

If you press **Account Management** in the top right, you can access the Freemius interface which manages the logistical side of the plugin.

### Account

Adjust your name and email.

You can also **Sync** here if you're having any trouble with your license key connecting properly with your installation.

Nearer the bottom of this section, you can manually enter in the **license key** you received with Mapster Pro.

### Billing

Enter in billing information for any invoice needs you have.

### Payments

See your past payments made for the plugin.

**If you have any trouble disabling or enabling features here, please** [**contact us**](https://docs.google.com/forms/d/e/1FAIpQLScN5BgC-kiOPofI_4a1CgbvF27tNRpWrdgm6vNGEEha4iRPmQ/viewform?usp=sf_link).


# Advanced

More complicated options for advanced users.

### Mapbox Username <sup><sub>*<mark style="color:blue;">\[Mapbox,</mark>*<sub></sup><sup><sub>*&#x20;*<sub></sup><sup><sub>*<mark style="color:green;">Pro</mark>*<sub></sup><sup><sub>*<mark style="color:blue;">]</mark>*<sub></sup>

Log into Mapbox to find your username (it's **not** your email). This is only used for advanced functionality, like if you are creating tilesets from your data.

### Mapbox Secret Token <sup><sub>*<mark style="color:blue;">\[Mapbox,</mark>*<sub></sup><sup><sub>*&#x20;*<sub></sup><sup><sub>*<mark style="color:green;">Pro</mark>*<sub></sup><sup><sub>*<mark style="color:blue;">]</mark>*<sub></sup>

This is **only** for advanced functionality like managing tilesets. Make sure you have given this secret token the correct permissions.

### Store Locator <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

You must enable this if you are using the Store Locator functionality.

### User Submission <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

You must enable this if you are using the User Submission functionality.

### Editing Map Style <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

If you want to have a different default map tileset appear in your Points, Lines, and Polygons pages — instead of OpenStreetMaps — enter the style from Mapbox here.

### Default Shortcode Map <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

If you are creating shortcodes for individual features or sets of features, then you usually have to enter an ID for a map you've created so they can be displayed on that map visually. Here, you can specify a default so your shortcode won't need to have that specified.

### Default Map View <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Manually set the starting view of all new Maps.

### Spatial API <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Turn the [Spatial API](/developer/spatial-db-and-api) functionality on and off here.

### Encoded Geometries <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Currently in development, this may help speed up your map load if you have lots of complex shapes.

### Tileset Management Format <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

This is a very advanced feature that allows you to specify properties to be attached to the features you send to Mapbox. Please see the Mapbox Tileset Management page for more information.


# Import

Check out the many ways to import into Mapster WP Maps.

### Geo File Import

Here, you can import using standard geographic file formats, such as GeoJSON, KML, GPX, or zipped Shapefiles.&#x20;

{% hint style="warning" %}
The version of the importer in the basic plugin can handle about **100 features at a time** before having some errors occurring. If you [download the Pro version](https://wpmaps.mapster.me/pro) you'll be able to import as many features as you like, and style them conditionally as well.
{% endhint %}

When importing, we'll scan your feature and show you some details so you can see if things look right. We'll alert you to any potential issues in your data, and we have even built in a small reprojection tool to help you out if your geo file isn't meant for web maps.

The features will be created in the corresponding post types, and then you can go edit them. If you need to add properties during Import, or edit large numbers of features afterwards with Mass Editing, that is also available in Mapster Pro!

<details>

<summary>Reprojection Walkthrough</summary>

**To use the reprojection tool**, you'll first need to find out what projection your original file is in. You can go to <https://epsg.io/> once you have an idea. When you have a specific projection page on EPSG.io, you need to get the Proj.4 projection string.

<figure><img src="/files/HVpXR476J2wPuNtPIn4p" alt=""><figcaption></figcaption></figure>

For example, if my projection is "NAD83 / UTM zone 12N", then my EPSG page is <https://epsg.io/26912>. If I scroll to the bottom of this page, there is an "Export" section, where one of the options on the left is "PROJ.4". If I click on that, I get the string `+proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs` . This is what I should enter into the "Proj.4 string" input in the Mapster WP Maps Importer.

<figure><img src="/files/7tpGpJI0kCa5oGrsQdVM" alt=""><figcaption></figcaption></figure>

A new file will be downloaded to your computer once you hit the Try Reprojecting button. You can verify if this is now the right projection by going to [geoJSON.io](https://geojson.io/) and dragging your file. If everything looks right, you're in business!

</details>

### Pro Geo File Import <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

With Mapster Pro, you can import **any number of features** at a time. This is done through a batch mechanism of 50 at a time.

Go to Maps > Settings and click on the Data Importer button. In addition to the default functionalities (validating your file, basic reprojection, assigning a category), much more is now included.

{% embed url="<https://www.youtube.com/watch?v=CMv0m2doVfU>" %}

All the properties on your data file will be retained, in each feature under "Custom Properties" after import. These can later be used in advanced [Category Filters](/maps/filters/category-filter) or [Popups](/popups/popup-templates).

There is a complex system for assigning feature properties to different variables in Mapster, such as title, category, and any styling used in the plugin. It gets very complex very fast so please refer to the video above to understand how it works!

### WP GL JS Maps Import

If you are still using our old plugin WP Mapbox GL JS, first of all, thanks for upgrading because that thing is old! Here, you can download an export file from that plugin and use it to add all your features into this one.

### Static CSV <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Here, upload a single static CSV file containing points, lines, and/or polygons. It must be in the correct format. You can find [an example here.](https://docs.google.com/spreadsheets/d/1RQ4PzT4g5bjmY0dwiOfJ3YUgThnM4ZJuVSU-6rWQM1Y/edit?gid=762889436#gid=762889436)&#x20;

You can go very deep with customization on this. Press the "See All Mapster Property Fields" for a CSV download that will give you more information on the particular fields you can add to make your import come out just the way you want it.

### Live CSV <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

The Live CSV uses the same format as the Static CSV, but it must come from an online source that provides a CSV that can be parsed and read remotely. Google Sheets is a good place for this but you could use any remote server that's open to being downloaded and read.

{% hint style="info" %}
If you are using Google Sheets, you must also make it public by choosing the option File > Share > Publish to Web. Then, enter the URL and your file should import properly.
{% endhint %}

After you've verified a spreadsheet, you'll be presented with options to specify how often the spreadsheet should be fetched again. These are set from the Cron options in your Wordpress installation.

If you want to add a new cron interval, I recommend the [WP Crontol plugin.](https://en-ca.wordpress.org/plugins/wp-crontrol/) With this you can add a new interval and then it will appear in the options section in the Live CSV section.

Any new locations will be added, and any that have already been added will be updated with their values (this is done using the `spreadsheet_id` value, so make sure you don't change that!).

{% hint style="warning" %}
Removed rows will not be deleted — you should do this manually in Mapster.
{% endhint %}

### Migration <sup><sub>*<mark style="color:green;">\[Pro]</mark>*<sub></sup>

Migrating content can be tricky when moving from a local or development Wordpress site to your production environment. However, this is pretty simple when it comes to Mapster WP Maps if you do things in the right order. Our posts are saved in a very consistent Wordpress format, so we're actually able to use the built-in Wordpress Exporter tool for almost every aspect of the migration.

<figure><img src="/files/vHY0dvu7JXdW2KXTmVXj" alt=""><figcaption></figcaption></figure>

Here are the steps that should ensure a successful migration.

1. Make sure Mapster WP Maps (free or Pro) is installed onto your new site.
2. If using Pro, use the Migration tool (Settings > Importer > Migration) to migrate all your settings by downloading from your old site and uploading to your new site.
3. Head to Tools > Export, and use the Wordpress Importer/Exporter tool. You'll see a screen something like the one above.
4. Download individual XML Export Files and upload them in the following order. This ensures that proper categories and pre-requisites are created before they are referenced in other posts.
   1. Popup Templates
   2. Polygons, Lines, and/or Locations
   3. Maps
5. Double-check to make sure your maps, geographies, categories, and images are all uploaded successfully.

That should do it! We hope this makes it nice and simple for you to migrate things over whenever you need to.


# Tileset Management

Learn how to connect your Wordpress installation to Mapbox Tiling and make maps with a ton of data

Mapster WP Maps allows you to interconnect your Mapbox account and your Wordpress installation. The first way we've implemented this so far is with the ability for you to create or update a tileset source inside Mapbox using [Mapbox's MTS (Mapbox Tiling Service)](https://www.mapbox.com/mts), which allows you to generate really big tilesets that will load instantly into your Mapbox maps.

![](/files/1p6RBLOeUu5dJMm8OOmy)

To get started, you'll need to get your **Mapbox Username** and a **Mapbox Secret Token** with `tilesets:read`, `tilesets:write`, and `tilesets:list` enabled. Enter these into the "Advanced Options" tab of the Settings. Your Mapbox Username is just the name that appears in Mapbox in the top-right when you click on your user icon.

![](/files/TZ7guo7RoPgiOWae9FFf)

Once you've added these, you're ready to create a tileset source and tileset. You will need some Mapbox knowledge to really understand why you're doing this and how it works (check out our [Youtube tutorials](https://www.youtube.com/watch?v=z1KYkQBo408\&list=PLm76kc4VPkn2iezD5Vup4nkApyWF-haXP\&index=7\&t=3s) for a Mapbox tutorial!).&#x20;

Select the category that you'd like to be turned into a tileset. This can contain any kinds of Geography Types -- Points, Polygons, Lines -- it doesn't matter. They'll all be joined together. This upload will also include any Custom Properties you've added onto the data. Note that it *won't* include ACF Fields, only custom properties. Get in touch if that's an issue that you need fixed!

Select whether you're creating a new tileset source or updating an existing one. If creating new, enter a name and press "Update Tileset Source". This will take a short time to query, and you'll see a series of responses returning that will explain if your requests worked or not.

If you're updating, select from the dropdown list of Tileset Sources that appear, and Update Tileset Source. Again, you'll see a series of responses that show the status.

Now you can go to Mapbox and see your new/updating tileset. If you enter it, you'll see the tileset job generation in process.

If you need custom recipes or other advanced features, just get in touch with us. By default this uses a very simple recipe that will make your data visible at all zoom levels and include all data properties.


# Mapster Map ACF Field

Use Mapster to help build custom post types with geographic information stored appropriately and usable with the rest of the Mapster plugin.

<figure><img src="/files/VdYFj7bkz2qbadLycdhm" alt=""><figcaption></figcaption></figure>

If you want to use Mapster to store geographic information, or even attach geographic information to your own custom post types and then display them using the Mapster plugin, you can do that!

First, you have to install [Advanced Custom Fields](https://www.advancedcustomfields.com/) (the free version is fine). Once you do, if you are creating your custom fields, just look for the Mapster Map field type.

This will create a geographic editing field just like the one you see in the Mapster plugin:

<figure><img src="/files/Mi0hHetrMWFpP7nXfU4v" alt=""><figcaption><p>This is an example of the "Point" type.</p></figcaption></figure>

You must select a single **Geography Type** (Point, Line, or Polygon).

If you don't select **Styling**, then that means you will just be storing geographic information. When getting this information out from ACF using ACF functions, the information will be stored as a GeoJSON. Just parse it as an object and you will be able to load it into any normal GIS system or other map.

{% hint style="info" %}
If you plan to add your geographies to a Mapster Map, you will at least need to add Styling. Otherwise, the map won't know how your point should look. Only leave Styling off if you're planning to save purely geographic information for your own use.
{% endhint %}

If you do select **Styling**, then you'll be able to set all the options in the same way you can set them in the equivalent Mapster post type (Point, Line, or Polygon). This creates a ton of freedom to style your geographies wherever you want.

If you also want to customize Popups this way, just turn the **Popups** option on as well.

### Adding to a Mapster Map

Once you've created your custom geographies on your custom post types, you can add them to any map you've created with Mapster. Open your map, then go to the **Points, Lines, Polygons** tab. There, scroll down and you will see a field for **Add Custom Posts.** Here, select the specific posts from your custom post type that you want to add, and presto! They will appear on your map.


# Mapster Map Gravity Forms Field

Add a field to your gravity forms to allow entering of geographic data with ease.

In addition to an ACF field, Mapster also includes a geographic field you can use with Gravity Forms! This lets you capture geographic information from users and also to display it using a variety of tools.

{% hint style="info" %}
This feature is relatively new and currently quite simple. If you want any more convenience features or minor changes, please let us know and we'll get on it!
{% endhint %}

Start off by going to Forms after you've installed both Gravity Forms and the Pro version of the Mapster WP Maps plugin. Create a new form. Then go and select the Mapster Map field from the right-hand side.

<figure><img src="/files/XUBoqqVIvKTHdfbbRmbo" alt=""><figcaption></figcaption></figure>

When you've added the field, then click on the field to change its settings.

Set the **Field Label** (the name of the field), the starting **Center Latitude** and starting **Center Longitude**, and the starting **Zoom** level.

If you're having trouble with these, try [making a normal Mapster map](/getting-started/guides/your-first-map) and see what the best zoom and center are, and copy-paste those settings here.

{% hint style="info" %}
To preserve fast loading, Mapster doesn't automatically load the map Javascript before you add the form — so after you create it, you'll need to Save Form and reload the page to see the map.
{% endhint %}

Once you reload, you'll see something like this:

<figure><img src="/files/5eVgYJlbJXrDE3UFA9jp" alt=""><figcaption></figcaption></figure>

From here, you can change the **Map Type** between Satellite and Streets.

You can also select the **Geographic Type** you want users to be able to submit: Point, Line, or Polygon. the tools in the top left of the map will change accordingly.

<figure><img src="/files/ZGhmzW2DeFu46njKW97G" alt=""><figcaption></figcaption></figure>

Now your form is ready for your users or your admins to use!

To use it on the front end, simply have users click the icon in the top left and draw on the map. When they add a point or draw a line, everything will be saved in the database as GeoJSONs.

<figure><img src="/files/DfffWW6vTqeeUCiIMOc7" alt=""><figcaption></figcaption></figure>

Once a user has submitted, you will see the responses in the Entries area of Gravity Forms. By clicking on one, you'll see the submitted geography displayed on a map.

<figure><img src="/files/bfrW7NjBOMub7ywSXkdj" alt=""><figcaption></figcaption></figure>

With this, you've now saved user input on geographies inside Gravity Forms! Good job.


# Custom Scripts

Mapster WP Maps is built to allow developers to easily extend and tweak map display and settings. We have a huge number of ways you can hook into specific maps during runtime to execute functions and modify content. Custom Scripts is the simplest way to get developer access.

{% embed url="<https://www.youtube.com/watch?v=ZAuJYJ6IoA8>" %}

Custom Scripts are scripts you can write somewhere in the Javascript on your site, and then give to a specific map to call after it's done initializing. This is a simple way to hook into any given map and manipulate displays or controls as you need.

For any particular map, go to the Custom section. Enter the name of a function here. For example, let's call our function "myCustomScript".

Create a global function with that script name. Your script will automatically receive a "map" and a "features" variable. For Maplibre and Mapbox, this will be a map object matching those libraries; for Google Maps, it'll be a map object matching the Google Maps API. As follows:

```
window.myCustomScript = function(map, features) {
	console.log(map);
	console.log(features);
}
```

From here, make the modifications you need!


# Hooks

A "hook" in our parlance is, like in Wordpress generally, a place where you can "hang" a function that you want to run. Every hook recieves certain variables and can be registered to run on a specific map.

{% embed url="<https://www.youtube.com/watch?v=wwxYvxsknmM>" %}

For example, let's say we need to resize the map in some special way after the page loads.

We'll register our hook before the map runs:

```
mwm.add_action('map_set', (map) => {
  // Do something with the map
  map.on('load', () => {
    map.setZoom(12);
  })
})
```

If you want to only target a specific map on a specific page, you can also pass the map ID (found by hovering over the map in the Maps > Maps screen, or in the URL when editing the map) to the hook function as follows:

```
mwm.add_action('map_set/mapster-7314', (map) => {
  // Do something with the map
  map.on('load', () => {
    map.setZoom(12);
  })
})
```

See below for lists of hooks as well as what data they provide. Get in touch if what you need isn't here!

### General Hooks

<table><thead><tr><th>Hook Name</th><th width="150">Variables Passed</th><th>Description</th></tr></thead><tbody><tr><td>access_token_set</td><td></td><td>After Access Token is set, if present.</td></tr><tr><td>data_fetched</td><td>postResponse</td><td>After all data to load map is fetched.</td></tr><tr><td>map_size_set</td><td></td><td>After map DOM element size is initially set.</td></tr><tr><td>map_library_set</td><td>mapLibrary</td><td>After map library (MapLibre, Mapbox, or Google Maps) is set.</td></tr><tr><td>map_set</td><td>map</td><td>After map variable is initialized.</td></tr><tr><td>set_interactivity</td><td></td><td>After map interactivity is enabled or disabled.</td></tr><tr><td>set_terrain</td><td></td><td>After map 3D terrain is enabled.</td></tr><tr><td>loading_icon_started</td><td></td><td>After loading icon appears.</td></tr><tr><td>loading_icon_done</td><td></td><td>After loading is completed.</td></tr><tr><td>map_resize_set</td><td></td><td>Whenever map is resized during runtime.</td></tr><tr><td>map_markers_set</td><td>markers</td><td>After markers are set onto map.</td></tr><tr><td>map_features_set</td><td></td><td>After map features set as Mapbox layers are placed onto map.</td></tr><tr><td>map_datalayers_set</td><td>dataLayers</td><td>After map features set as Google Maps data layers are placed onto map.</td></tr><tr><td>set_clustering</td><td></td><td>After map layers clustering has completed.</td></tr><tr><td>set_customscripts</td><td></td><td>After custom scripts are run.</td></tr><tr><td>set_mapstyle</td><td></td><td>After anytime the map style changes.</td></tr></tbody></table>

### Controls Hooks

| Hook Name                    | Variables Passed      | Description                             |
| ---------------------------- | --------------------- | --------------------------------------- |
| zoom\_control\_set           | zoomControl           | After this control is set onto the map. |
| geocoder\_control\_set       | geocoderControl       | After this control is set onto the map. |
| directions\_control\_set     | directionsControl     | After this control is set onto the map. |
| 3d\_control\_set             | 3dControl             | After this control is set onto the map. |
| scale\_control\_set          | scaleControl          | After this control is set onto the map. |
| geolocation\_control\_set    | geolocationControl    | After this control is set onto the map. |
| fullscreen\_control\_set     | fullscreenControl     | After this control is set onto the map. |
| map\_type\_control\_set      | mapTypeControl        | After this control is set onto the map. |
| street\_view\_control\_set   | streetViewControl     | After this control is set onto the map. |
| customSearch\_control\_set   | customSearchControl   | After this control is set onto the map. |
| filterDropdown\_control\_set | filterDropdownControl | After this control is set onto the map. |
| categoryFilter\_control\_set | categoryFilterControl | After this control is set onto the map. |
| list\_control\_set           | listControl           | After this control is set onto the map. |

### Interaction Hooks

| Hook Name                          | Variables Passed | Description                                             |
| ---------------------------------- | ---------------- | ------------------------------------------------------- |
| layer\_feature\_clicked            | clickedFeature   | After a click event occurs on a layer feature.          |
| layer\_feature\_hovered            | hoveredFeature   | After a hover event occurs on a layer feature.          |
| popup\_opened\_from\_layer\_click  | clickedPopup     | After a popup is opened from a layer feature click.     |
| popup\_opened\_from\_layer\_hover  | hoveredPopup     | After a popup is opened from a layer feature hover.     |
| popup\_closed\_from\_layer\_hover  |                  | After a popup is closed from a layer feature mouseout.  |
| external\_link\_opened             |                  | After a user is redirected to an external link.         |
| marker\_feature\_clicked           | clickedFeature   | After a click event occurs on a marker feature.         |
| marker\_feature\_hovered           | hoveredFeature   | After a hover event occurs on a marker feature.         |
| popup\_opened\_from\_marker\_click | clickedPopup     | After a popup is opened from a marker feature click.    |
| popup\_opened\_from\_marker\_hover | hoveredPopup     | After a popup is opened from a marker feature hover.    |
| popup\_closed\_from\_marker\_hover |                  | After a popup is closed from a marker feature mouseout. |

### Examples

Here are a few script examples performing different tasks that might help you build your own.

#### Creating a Custom Zoom Event on Click of External Element

* Add IDs onto the elements to be clicked by looking at the Location IDs in the WP backend
* Set the zoom level you want in the click event from jQuery

```
// HTML
<div>
  <p class="map-office" id="map-office-578">Mount Vernon Office</p>
  <p class="map-office" id="map-office-577">Puyallup Office</p>
</div>

// JS
<script>
let allLocations = []
mwm.add_action('data_fetched', (postResponse) => {
  allLocations = postResponse.locations;
})
mwm.add_action('map_set', (map) => {
  map.on('load', () => {
    jQuery(document).on('click', '.map-office', function() {
       let thisId = jQuery(this).attr('id').replace("map-office-", "");
       let thisLocation = allLocations.find(location => location.id === parseInt(thisId));
       map.flyTo({ center : thisLocation.data.location.coordinates, zoom : 12 });
    });
  })
})
</script>
```


# Spatial DB & API

In Pro, you can really superpower your Wordpress site and turn it into a proper spatial backend for other apps, external users, or other types of spatial queries. The database Wordpress uses, MySQL, does contain quite a bit of spatial functionality -- not as much as PostGIS and PostgreSQL, but enough for most usage for most spatial projects.

![](/files/PWfH06tGM0MCE2cixKiV)

### Creating the Spatial Database

To create a spatial table in your Mapster WP Maps installation, make sure you have Pro installed, and go to Maps > Settings. Click on the Advanced Options tab and scroll down to the Spatial API option. Once this is enabled, on the next page load your spatial database will be created and populated with all the features that currently exist in your installation.

The `mapster_maps_geometry` table contains just three columns: an identifying ID, a post\_id corresponding to the post, and a coordinates column containing the geometry for that post. The geometry column will be used for spatial queries and space is minimized by not storing any additional information.

As long as the Spatial API option is enabled, the database will continue to be updated as you create new geometries and update existing geometries.

### Querying the Spatial Database

SQL has a number of spatial queries you can do if you're into writing your own SQL queries. You can find a list of them at the [Microsoft documentation here](https://docs.microsoft.com/en-us/sql/relational-databases/spatial/create-construct-and-query-geometry-instances?view=sql-server-ver15). Your spatial data is stored as geometries in the coordinates column.

### Creating an API

This is a feature that can help you connect your Wordpress site to other applications, external users, or other management platforms. Mapster has built in a `query` endpoint that can receive a variety of queries and perform these queries on your spatial database.

Responses will return as a full GeoJSON, with found posts as GeoJSON features.

The endpoint for your queryable endpoint will be&#x20;

```
yourwordpressinstall.com/wp-json/mapster-wp-maps/query
```

This is a POST endpoint. Available query parameters include:

<table><thead><tr><th>Parameter</th><th width="208">Input Type</th><th></th><th data-hidden></th></tr></thead><tbody><tr><td>category</td><td>integer</td><td>ID for a Mapster WP Maps category</td><td></td></tr><tr><td>query_type</td><td>string</td><td><code>pip</code> for Point-in-Polygon, <code>polygon-overlap</code> for Polygon Overlap</td><td></td></tr><tr><td>query_feature</td><td>geoJSON feature object</td><td>Point or Polygon depending on the query</td><td></td></tr><tr><td>bounds_only</td><td>boolean</td><td>Output the whole feature (<code>false</code>) or only the feature bounds (<code>true</code>)</td><td></td></tr><tr><td>custom_fields</td><td>array of strings</td><td>An array of the names of Advanced Custom Fields you want to include as feature properties</td><td></td></tr></tbody></table>

### Example Queries

#### **Point in Polygon**

The following query performs a point-in-polygon query on category 8, returning the full feature geoJSONs along with feature properties `school_name` and `activities`.

**Query**

```
fetch('http://localhost:8888/wp-json/mapster-wp-maps/query', {
    method : "POST",
    body : JSON.stringify({
        "category" : 8, // A Mapster WP Maps Category
        "query_type" : "pip",
        "query_feature" : {
            "type" : "Feature",
            "properties" : {},
            "geometry" : {
                "type" : "Point",
                "coordinates" : [79.804687, 60.930432202923335]
            }
        },
        "bounds_only" : false,
        "custom_fields" : ["school_name", "activities"]
    })
}).then(resp => resp.json()).then(response => {
    console.log(response)
});
```

**Response**

```
{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "properties": {
                "post_id": "1687",
                "title": "Russia",
                "permalink": "http://localhost:8888/mapster-wp-polygon/russia/",
                "excerpt": "",
                "school_name": null,
                "activities": null
            },
            "geometry": {
                "type": "MultiPolygon",
                "coordinates": [
                    [
                        ...
                    ]
                ]
            }
        }
    ]
}
```

#### Polygon Overlap

This will check for intersecting polygons in category 8, and return the full feature geoJSON.

```
fetch('http://localhost:8888/wp-json/mapster-wp-maps/query', {
    method : "POST",
    body : JSON.stringify({
      "category" : 8,
      "query_type" : "polygon-overlap",
      "query_feature" : {
        "type": "Feature",
        "properties": {},
        "geometry": {
          "type": "Polygon",
          "coordinates": [
            [ 
              ...
            ]
          ]
        }
      }
  })
}).then(resp => resp.json()).then(response => {
    console.log(response)
});
```


# Internationalization

Need to include translations to other languages, or translate the entire plugin for a client? We've set everything up to work with WPML.

You'll need to first enable the Mapster WP maps Post Types in WPML. Go to WPML > Settings > Post Types Translation, and change Maps, Locations, Lines, and Polygons to "Translatable".

Then enable Map Category translation: go to WPML > Settings > Taxonomies Translation, and change Map Categories to "Translatable".

Now you'll be able to make copies of your maps in different languages, and these will automatically pull any category or other translations from your settings.

There is also a setting in Maps > Features, where you can choose to show features from *all* languages on your map, even if they don't have a translation in the currently active language.

### Map Language

You can select the language for a given map on any Map screen. Just go into the Setup tab and select the language you want. You'll need to use Mapbox for this and a style that has the appropriate language available.

<figure><img src="/files/3WRdWiIZgC5wxHPkRzni" alt=""><figcaption></figcaption></figure>

### Admin Translation

If you need to translate all the backend language, as well, that can be done through WPML's String Translation plugin. Enable this plugin, go to WPML > Theme and plugins localization > Strings in the plugins and select Mapster WP Maps. Scan the plugin for strings.

Head over to WPML > String Translation and enter translations where you think they are needed. Presto -- internationalized!

Note that by default, translations will only appear in the front end of the site. If you want backend translation as well, you will need to enable "Set admin language as editing language" on the Profile page in the Users area of WP.


# Overview

What Mapster WP Maps is, how it works, and what's new in V2.

**Mapster WP Maps** is a WordPress plugin for building interactive, fully customizable maps — directly from your WordPress admin. No coding required to get started, with extensive developer tools available when you need them.

## How It Works

WP Maps has three layers that work together:

1. **The Mapmaker** — a visual map editor that lives in your WordPress admin. This is where you configure everything: add features, style them, set up controls, and manage how your map looks and behaves.
2. **The WordPress Plugin** — handles storing your map configuration, serving it to the frontend, and providing the shortcode you use to embed maps on any page or post.
3. **The SDK** — a JavaScript library that runs in your visitors' browsers and renders the actual map using the mapping library of your choice.

As a regular user, you'll mostly be working inside the Mapmaker. The plugin and SDK handle everything else automatically.

## Map Libraries

WP Maps supports three mapping libraries, each with different strengths:

| Library          | API Key Required | Best For                                                  |
| ---------------- | ---------------- | --------------------------------------------------------- |
| **MapLibre**     | No               | Free, open-source maps with no usage limits               |
| **Mapbox GL JS** | Yes              | High-quality styles, advanced features, satellite imagery |
| **Google Maps**  | Yes              | Familiarity, Street View, Google-native styling           |

You choose your library when creating or editing a map. Most features work across all three — any exceptions are noted in the relevant section.

> **Tip:** If you're just getting started or don't need a specific mapping style, MapLibre is a great choice — it requires no API key and has no usage limits.

## What's New in V2

V2 is a significant rewrite focused on a better editing experience:

* **New visual Mapmaker** — replaces the old ACF-based editor with a purpose-built, real-time map editor. Changes preview live as you make them.
* **Unified editing interface** — map settings, features, controls, and styles are all managed in one place.
* **Improved developer API** — the old hooks system has been replaced with an event-based SDK. See the [Developer](/mapster-wp-maps-v2/developer/sdk-overview) section for details.
* **Same core functionality** — all the features you know from V1 are still here. Only the interface has changed.

If you're upgrading from V1, see [Upgrading from V1](/mapster-wp-maps-v2/the-mapmaker/controls).


# Installation & Setup

How to install WP Maps and set up your API keys.

## Installing the Plugin

Install WP Maps like any other WordPress plugin. You can:

* Search for **Mapster WP Maps** in your WordPress admin under **Plugins > Add New**, or
* [Download the zip from WordPress.org](https://wordpress.org/plugins/mapster-wp-maps/) and upload it via **Plugins > Add New > Upload Plugin**

Once activated, you'll see a **Maps** item in your WordPress admin menu.

## API Keys

WP Maps works out of the box with **MapLibre** — no API key needed. If you want to use **Mapbox** or **Google Maps**, you'll need to supply your own API key.

### Mapbox

To use Mapbox GL JS, you'll need a Mapbox access token. Get one at [mapbox.com](https://account.mapbox.com/auth/signup/) — Mapbox offers a generous free tier.

Once you have your token, add it under **Maps > Settings > Mapbox Access Token**. You can also enter it on a per-map basis in the Mapmaker if you don't want a global default.

> **Note:** Certain controls — like the Geocoder and Directions — also require a Mapbox token even if you're using MapLibre. If you plan to use those controls, you'll need to add a token.

### Google Maps

To use Google Maps, you'll need a Google Maps API key with the **Maps JavaScript API** enabled. You can create one in the [Google Cloud Console](https://console.cloud.google.com/).

Add your key under **Maps > Settings > Google Maps API Key**.

> **Note:** Some Google Maps features (like the Geocoder) require additional APIs to be enabled on your key, such as the **Places API** or **Directions API**. Google will surface an error in the browser console if a required API isn't enabled.

## Pro License

If you have a WP Maps Pro license, activate it under **Maps > Settings > Account Management**. This unlocks Pro-only features, which are marked throughout these docs with a **Pro** badge.

<figure><img src="/files/Kw0cSLtFrG3R50jmf3mn" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/r5BJDE8eW7vs0Xn18Ger" alt=""><figcaption></figcaption></figure>


# Your First Map

Create your first map, add a feature, and embed it on a page — step by step.

This walkthrough will get you from zero to a working embedded map. It takes about five minutes.

## 1. Create a New Map

In your WordPress admin, go to **Maps > Add New**. This opens the **Mapmaker** — the visual editor where you'll configure everything about your map.

When the Mapmaker loads, you'll see:

* A **left panel** with your features list and controls
* A **live map preview** in the center and Map Settings button
* A **right panel** that shows context-sensitive settings (it starts with a welcome screen and quick-start links)
* A **top bar** with Save, Undo/Redo, and a shortcode copy button

<figure><img src="/files/VcGoz373cha96U0SWMAI" alt=""><figcaption></figcaption></figure>

## 2. Add a Feature

The quickest way to add a point to your map is to click directly on the map. In the right panel, click **Add a point by clicking the map**, then click anywhere on the map preview to drop a marker.

You can also import existing data (GeoJSON, KML, GPX, or Shapefile) by clicking **Import a file** in the right panel.

<figure><img src="/files/P2F1X4eL1sX6yqw3jjUy" alt=""><figcaption></figcaption></figure>

## 3. Style Your Feature

Once you've added a marker, it appears in the **left panel** under Features. Click it to select it — the right panel will switch to show that feature's settings, where you can adjust its color, size, popup content, and more.

> **Tip:** You can add as many features as you like before saving. See [Features](/mapster-wp-maps-v2/the-mapmaker/features) and [Styling](/mapster-wp-maps-v2/the-mapmaker/styling) for the full range of options.

## 4. Set Your Map Style

To change your map's base style, open **Map Settings** using the settings icon in the bottom bar (or the style shortcut in the right panel welcome screen). From there you can choose your map library, pick a style, and set the default view.

<figure><img src="/files/sSVlPEDq6AlLo8R4YD6l" alt=""><figcaption></figcaption></figure>

## 5. Save and Get Your Shortcode

When you're happy with your map, click **Save** in the top-right corner. Once saved, click the **\[]** (shortcode) button next to Save — this copies your map's shortcode to your clipboard.

The shortcode looks like this:

```
[mapster_wp_map id="5"]
```

## 6. Embed Your Map

Paste the shortcode into any WordPress page, post, or widget area. Your map will render on the frontend exactly as it appears in the Mapmaker preview.

You can also use the Mapster Map Select Gutenberg widget to select a map if you prefer.

<figure><img src="/files/ZZnjwoxsf8387fjeQf94" alt=""><figcaption></figcaption></figure>

***

That's it! From here, explore the [Mapmaker](/mapster-wp-maps-v2/the-mapmaker/interface-overview) section to learn about the full range of features, controls, and styling options.


# Upgrading from V1

What to expect when upgrading from WP Maps V1 to V2.

## The Short Version

For most users, upgrading is automatic. Install V2 over your existing plugin and everything carries over — your maps, features, and settings are untouched.

If anything looks off after upgrading, we're here to help. Reach out at [mapster.me/contact](https://mapster.me/contact) and we'll get you sorted.

## What's Changed

The main change in V2 is the editing interface. Maps are now configured in the **Mapmaker** — a new visual editor — rather than the old ACF-based post editor. Your existing map data is fully compatible; you'll just be editing it in a new place.

All the same features are still there. Nothing has been removed.

## For Developers: Hooks → Events

If you built custom functionality using V1's hooks system (`mwm.add_action()` etc.), those hooks have been replaced by the new event-based SDK. The capabilities are the same — and in most cases more flexible — but the syntax is different.

See the [Migrating from V1](/mapster-wp-maps-v2/developer/migrating-from-v1) guide in the Developer section for a full mapping of old hooks to new events.

## Using the Classic Editor

If you prefer the old editing interface, it's still available. Open any map in the Mapmaker and click **Use Classic Editor** in the top bar to switch back to the previous post-based editor. You can move between the two freely.

## Need to Roll Back to V1?

If you run into a bug or just want to wait while V2 continues to stabilize, you can roll back to the last V1 release. Download the zip below, then go to **Plugins > Add New > Upload Plugin** and install it over the existing plugin. Your data will not be affected.

[**Download WP Maps V1 (last release)**](https://drive.google.com/file/d/12M_6lV9H4ZIgMjfPaIigjJmPkqn80sEh/view?usp=drive_link) — Pro version

[**Download WP Maps V1 (last release)**](https://drive.google.com/file/d/1ztNdZpsFDwax1GJ6Q9xdYz-Bo8KfrEn8/view?usp=sharing) — Free version

> **Note:** Rolling back is safe — no map data or settings will be lost. When you're ready to try V2 again, just update the plugin normally.


# Mapster Pro

How to purchase, activate, and manage your Mapster Pro license.

Mapster Pro is the premium version of the plugin, managed through **Freemius** — a licensing and payment platform built for WordPress plugins. This page covers how to get Pro, what the license allows, and how to get help if something goes wrong.

## Purchasing Pro

Purchase a license at <https://wpmaps.mapster.me/>. During checkout, Freemius will create an account for you using your billing email. After payment, you'll receive a license key by email.

## Activating Your License

1. In your WordPress admin, go to **Maps → Settings**.
2. Click **Account Management** in the top right.
3. In the **Account** section, scroll down to find the license key field and enter the key you received.
4. Click **Activate** — the plugin will verify the key with Freemius and unlock Pro features.

If the key isn't connecting, try clicking **Sync** in the same Account panel. This forces the plugin to re-check your license status with Freemius.

## License Restrictions

Each Pro license covers **one active site** by default. You can use it on one production domain at a time.

**Localhost is always included** — any installation running on `localhost` or a local development environment is covered automatically and does not count against your license.

If you need to run the plugin on **additional non-localhost development or staging sites** (e.g. a staging subdomain), you can request extra activations. Just reach out via the [support form](https://docs.google.com/forms/d/e/1FAIpQLScN5BgC-kiOPofI_4a1CgbvF27tNRpWrdgm6vNGEEha4iRPmQ/viewform?usp=sf_link) and we'll sort it out.

## Managing Your Account

The Freemius **Account Management** panel (Maps → Settings → Account Management) gives you access to:

* **Account** — update your name and email; manually enter or re-enter your license key; sync your license status.
* **Billing** — update billing details for invoices.
* **Payments** — view past payments.

## Trouble Activating or Getting Help

If you're having trouble with activation, or if Freemius emails are being blocked by your mail provider, use the support form below — we can activate your license manually and help resolve any issues.

[Contact support](https://docs.google.com/forms/d/e/1FAIpQLScN5BgC-kiOPofI_4a1CgbvF27tNRpWrdgm6vNGEEha4iRPmQ/viewform?usp=sf_link)


# Interface Overview

A guide to the Mapmaker layout and how to navigate it.

The Mapmaker is the visual editor you use to build and configure your maps. You can open it from your WordPress admin by going to **Maps** and clicking any map, or **Add New** to create one.

\[SCREENSHOT: Full Mapmaker interface with labeled areas]

## The Layout

The Mapmaker is divided into five areas:

### Top Bar

The top bar runs across the full width of the editor and gives you access to navigation actions:

* **WP Admin** — returns you to the WordPress admin dashboard
* **View Live** — opens your map's public page in a new tab
* **Use Classic Editor** — switches to the legacy post-based editor if you prefer it
* **Map title** — displayed in the center; click to rename your map
* **Save** — saves all changes. The button is only active when you have unsaved changes; when everything is saved it shows a checkmark instead
* **\[]** (Shortcode) — copies your map's embed shortcode to the clipboard
* **Undo / Redo** — steps back or forward through your editing history
* **Mobile / Desktop toggle** — switches the map preview between a desktop and mobile viewport so you can check how your map will look on smaller screens
* **?** — opens the help panel with contextual documentation

### Left Panel

The left panel has two sections:

* **Features** — lists all the points, lines, and polygons on your map. Click any feature to select it and edit it in the right panel. Use the **+** button to add new features, or switch to drawing mode to place them directly on the map.
* **Controls** — lists all the controls added to your map (search, zoom, geocoder, etc.). Click any control to edit its settings in the right panel.

### Map Preview (Center)

The live map preview updates in real time as you make changes. You can pan and zoom it just like any map.

When you're in **drawing mode** (after clicking Add Point, Add Line, or Add Polygon), a small floating toolbar appears at the top of the map. Click the appropriate icon to draw your feature directly on the map, or use the upload icon to import a file.

### Right Panel

The right panel is context-sensitive — it changes based on what you have selected:

* **Nothing selected** — shows a welcome screen with quick-start actions
* **Feature selected** — shows that feature's style, popup, and position settings
* **Control selected** — shows that control's configuration options

### Map Settings (Bottom Panel)

The **Map Settings** drawer slides in from the right and contains your map's global configuration — style, initial view, layout/dimensions, interactivity options, specialty features, loading behavior, and developer settings. Open it by clicking the palette icon in the right panel welcome screen, or the settings icon in the top bar.

<figure><img src="/files/MTLbNQRgxF52nhK80kIO" alt=""><figcaption></figcaption></figure>

## Saving Your Work

Changes are not auto-saved. The **Save** button in the top bar will highlight whenever you have unsaved changes. The Mapmaker will also warn you if you try to navigate away with unsaved changes.

> **Tip:** Use Undo / Redo freely while editing — your history is preserved until you save or reload the page.


# Map Settings

Configure your map's style, dimensions, view, and behavior.

Map Settings live in the **settings drawer** — open it by clicking the palette icon in the right panel welcome screen, or the settings icon in the top bar. Settings are organized into collapsible sections.

> **Note:** Changes in the **Starting View** and **Layout** sections are not reflected in the Mapmaker preview — they only take effect on your live embedded map.

<figure><img src="/files/MTLbNQRgxF52nhK80kIO" alt=""><figcaption></figcaption></figure>

## Style & Base Map

Choose the visual style of your map's background tiles.

Click **Choose Map Style in Map Gallery** to browse and preview available styles. The gallery shows styles from MapLibre, Mapbox, and community providers depending on which library your map uses.

Additional options in this section:

* **3D Terrain** — renders elevation data as a three-dimensional surface. <sup>Pro, Mapbox only</sup>
* **Globe** — switches the map projection to a 3D globe view instead of a flat map. <sup>Pro, Mapbox/MapLibre only</sup>
* **Duplicate map horizontally** — tiles the map continuously left and right so users can pan without hitting the edge of the world. Only available when Globe is disabled. <sup>Mapbox/MapLibre only</sup>
* **Projection** — changes the flat map projection. Options include Mercator, Natural Earth, Albers, Equal Earth, Equirectangular, Lambert Conformal Conic, and Winkel Tripel. Only available when Globe is disabled. <sup>Mapbox only</sup>

## Starting View

Controls where the map is centered and how zoomed in it is when it first loads.

**Initial Load** sets the behavior on load:

* **Fit to Features** — automatically zooms and pans to fit all features on the map. Use the **Padding** slider to add breathing room around the edges.
* **Manual Center & Zoom** — set a fixed center point and zoom level. Enter a latitude and longitude directly, or click **Set from current map view** to use wherever you've panned the preview.
* **User Location** — centers the map on the visitor's current location (requires browser permission). Set a **Zoom** level for how close in the map starts.

**Pitch** and **Rotation** apply regardless of the Initial Load mode and set the map's tilt angle and compass bearing on load.

## Layout

Controls the size of the embedded map.

* **Width** — set a value and unit (%, px, or vw). Defaults to 100%.
* **Height** — set a value and unit (px, %, or vh). Defaults to 400px.

**Full Page Map** expands the map to fill the entire browser viewport. When enabled:

* **Ignore Container** — breaks the map out of its WordPress page container so it spans edge to edge.
* **Hide other page content** — hides everything else on the page, showing only the map.

**Enable Mobile Sizes** lets you set two breakpoints, each with their own width and height. This is useful if your map needs different proportions on smaller screens.

## Interactivity

* **Disable all interaction** — makes the map completely static. Users can't pan, zoom, or click anything.
* **Enable zoom on scroll** — allows zooming with the mouse wheel or trackpad scroll.
* **Enable rotation and pitch** — allows users to tilt and rotate the map by right-clicking and dragging (or two-finger gesture on touch). <sup>Mapbox/MapLibre only</sup>

**Show popups in sidebar** — instead of opening popups over the map, displays them in a sidebar panel. Set a **Minimum Width** and **Maximum Width** for the sidebar.

**Restrict User Movement** <sup>Pro</sup> — prevents users from panning outside a defined bounding box. Enter the northeast and southwest corner coordinates, and optionally set minimum and maximum allowed zoom levels.

## Attribution & Logo

* **Map Attribution** — shows the required copyright text for your map's data/style. You can reposition it but can't remove it without a Mapbox enterprise agreement.
* **Logo** — shows the Mapbox or MapLibre logo. <sup>Mapbox, MapLibre</sup>

Both have a **Position** option once enabled, with the same four corner placements used throughout the [Controls](/mapster-wp-maps-v2/the-mapmaker/controls).

## Specialty

Specialty map types — including [heatmaps](https://github.com/mapstertech/mapster-wp-maps-docs/tree/main/v1/maps/specialty-maps/heatmaps.md), [side-by-side map comparisons](https://github.com/mapstertech/mapster-wp-maps-docs/tree/main/v1/maps/specialty-maps/map-comparer.md), [user submission maps](https://github.com/mapstertech/mapster-wp-maps-docs/tree/main/v1/maps/specialty-maps/user-submission.md), and [listing page maps](https://github.com/mapstertech/mapster-wp-maps-docs/tree/main/v1/maps/specialty-maps/listing-page-map.md) — are not yet available in the Mapmaker interface. To configure them, open your map in the **Classic Editor** (linked in the top bar or in this section) and go to the **Specialty Maps** tab.

> **Looking for elevation profiles?** That's no longer a specialty map type — it's the [Elevation](/mapster-wp-maps-v2/the-mapmaker/controls#elevation) control, available directly in the Mapmaker.

## Loading <sup>Pro</sup>

Customize the loading screen that appears while the map initializes.

* **Use custom loader** — when disabled, choose from a set of built-in loading graphics and set a **Background Color** and **Loader Color**. When enabled, upload your own image to use instead.

## Developer

* **Allow map embed** <sup>Pro</sup> — enables your map to be embedded via `<iframe>` on external sites. Add one or more **Allowed Origins** (e.g. `https://example.com`) to control which domains can embed it. The iframe code is shown here once enabled.
* **Use Cache** <sup>Pro</sup> — generates a static JSON cache file for your map data, which can improve frontend load times. After saving any changes, click **Generate Cache** to rebuild it. Cache is not used inside the Mapmaker preview.
* **Custom JS Function** — enter the name of a JavaScript function defined elsewhere on your site. This function will be called after the map initializes, with the map instance passed as an argument. See the [Developer](/mapster-wp-maps-v2/developer/sdk-overview) section for more on working with the map instance programmatically.


# Features

How to add, import, and manage the points, lines, and polygons on your map.

Features are the things that appear on your map — points, lines, and polygons. In the Mapmaker, all your features are listed in the **left panel**, and you can add new ones in a few different ways.

> **Looking to style your features?** See [Styling](/mapster-wp-maps-v2/the-mapmaker/styling) for colors, markers, icons, and more.

## Feature Types

When you add a feature, you choose what geometry type it is (point, line, or polygon), and then what *kind* of that type you want to display. You can switch between kinds at any time without losing your data.

**Points** can be displayed as:

* **Marker** — a standard map pin
* **Circle** — a filled circle with configurable radius
* **Label & Icon** — text or an icon displayed directly on the map (no pin)
* **3D Object** — a 3D model placed at a coordinate <sup>Pro, Mapbox/MapLibre only</sup>

**Lines** are displayed as:

* **Line** — a stroked path between two or more coordinates

**Polygons** can be displayed as:

* **Polygon (Flat)** — a filled, flat area
* **Polygon (3D)** — an extruded area with height <sup>Pro, Mapbox/MapLibre only</sup>
* **Image Polygon** — a polygon filled with an image <sup>Pro, Mapbox/MapLibre only</sup>
* **Pattern Polygon** — a polygon filled with a repeating pattern <sup>Pro, Mapbox/MapLibre only</sup>

## Adding Features

There are two buttons at the top of the left panel: **Add Geo** and **Add Post**.

### Add Geo — Draw on the Map

**Add Geo** puts the Mapmaker into drawing mode. A small toolbar appears at the top of the map with four options:

* **Add Point** — click anywhere on the map to place a point
* **Add Line** — click to place vertices; double-click to finish
* **Add Polygon** — click to place vertices; double-click to close the shape
* **Upload** — import features from a file (see [Importing Files](#importing-files) below)

Click the same button again to exit that drawing mode without adding anything.

### Add Post — Link WordPress Posts

**Add Post** opens a modal for linking existing WordPress content to your map. This is how you add features that are managed as WordPress posts rather than drawn directly. It has two tabs:

**From Mapster Posts** — link features you've already created as Mapster post types:

* **Locations** — individual Mapster Location posts (points)
* **Lines** — Mapster Line posts
* **Polygons** — Mapster Polygon posts
* **Map Categories** — add all features belonging to a Mapster category at once

**From All WP Posts** — link any WordPress post type that has geographic data attached:

* **Custom Posts** — search for individual posts by title
* **Custom Categories** — add all posts from a WordPress category or taxonomy

Click **Save** in the modal to apply your selections. The features will load into your map immediately.

<figure><img src="/files/EAu3Ewq9QbDXld0PEqwq" alt=""><figcaption></figcaption></figure>

## Importing Files

The **Upload** option (in the drawing toolbar, or in the right panel welcome screen) lets you import geographic data from a file. Supported formats:

* **GeoJSON** (`.geojson`, `.json`)
* **Shapefile** (`.zip` — the shapefile and its companion files zipped together)
* **GPX** (`.gpx`)
* **KML** (`.kml`)

After selecting a file, the Mapmaker shows you a preview of how many points, lines, and polygons it contains. Click **Import** to add them all to your map as individual features.

> **Tip:** For large or complex polygon files, simplify them first at [mapshaper.org](https://mapshaper.org) to keep your map loading fast.

For **CSV imports** and more advanced import options (recurring imports, field mapping), use the **Full Import Tool** found under **Maps > Settings** in your WordPress admin.

## Managing Features in the Left Panel

All your map's features are listed in the left panel. Click any feature to select it — the right panel switches to show that feature's settings.

At the bottom of the features list is a **Manage Clustering** button, which opens the clustering settings in the right panel. See [Styling → Clustering](/mapster-wp-maps-v2/the-mapmaker/styling#clustering) for details.

## Editing a Feature

When a feature is selected, the right panel shows its settings organized into collapsible sections. At the top:

* **Title** — the feature's name, used in popups and lists
* **Type** — switch between display types within the same geometry (e.g. change a Marker to a Circle). Switching type resets the feature's styling to defaults.

Below that, you'll find sections for the feature's **appearance** (covered in [Styling](/mapster-wp-maps-v2/the-mapmaker/styling)), **popup**, **interactivity**, and **Position & Geometry**.

### Position & Geometry

The **Position & Geometry** section lets you move or update a feature's coordinates:

* **Adjust Position on Map** — re-enters drawing mode with this feature selected, so you can drag it to a new position
* **GeoJSON upload** — replace this feature's geometry by uploading a GeoJSON file
* **GeoJSON download** — download this feature's geometry as a GeoJSON file

> **Note:** Multi-geometry features (MultiPoint, MultiLineString, MultiPolygon) can't be adjusted in the Mapmaker. Edit them by opening the feature's WordPress post directly in the classic editor.

## Removing a Feature

Scroll to the bottom of any selected feature's settings panel to find the **Remove** button. This removes the feature from the map — it does not delete the underlying WordPress post if the feature was added via **Add Post**.


# Styling

Style your map's markers, lines, polygons, and clusters.

Each feature's appearance is configured in the right panel when that feature is selected. The options available depend on the feature type. Hover over any feature in the left panel list and click it to open its settings.

> **Looking to add or manage features?** See [Features](/mapster-wp-maps-v2/the-mapmaker/features).

## Markers

Markers are the classic map pin. Select a marker to access:

**Appearance**

* **Color** — the fill color of the marker
* **Size** — scales the marker up or down as a percentage of its default size

**Marker Styling**

* **Anchor** — which point of the marker image aligns to the coordinate. Defaults to bottom-center (the pin tip). Options: Center, Top, Bottom, Left, Right, and the four corners.
* **Rotation** — rotates the marker 0–360°

**Interactivity — Hover Effects** <sup>Pro</sup>

* When enabled, set a separate **Hover Color**, **Hover Size**, and **Hover Rotation** that activates when a user's cursor is over the marker.

## Circles

Circles are filled, fixed-radius points — useful for representing areas or for a cleaner look than a pin.

**Appearance**

* **Color** — fill color
* **Radius** — size in pixels
* **Opacity** — fill transparency (0–100%)

**Circle Styling**

* **Border Color**, **Border Width**, **Border Opacity** — stroke around the circle
* **Static size during zoom** — when enabled, the circle stays the same pixel size regardless of zoom level, rather than scaling with the map <sup>Pro, Mapbox/MapLibre only</sup>

**Interactivity — Hover Effects** <sup>Pro</sup>

* Set a **Hover Color**, **Hover Radius**, **Hover Opacity**, and separate **Hover Border** color, width, and opacity.

## Labels & Icons

The Label & Icon type (called Symbol internally) lets you display a custom image and/or a text label directly on the map at a coordinate, without a pin shape.

**Icon**

* **Icon Enabled** — toggle the icon on or off independently of the text label
* **Image** — select from your media library
* **Size** — scale as a percentage

**Icon Style** (visible when icon is enabled)

* **Anchor** — alignment point of the icon to its coordinate (same options as Marker)
* **Opacity**, **Rotation** — standard
* **Move X / Move Y** — offset the icon from its exact coordinate in either direction
* **Static size during zoom** <sup>Pro, Mapbox/MapLibre only</sup>

**Text**

* **Text Enabled** — toggle the text label on or off
* **Label Text** — the text to display (can be a fixed string)
* **Text Color**, **Text Size**

**Text Style** (visible when text is enabled)

* **Font** — choose from a set of available typefaces (Open Sans, Klokantech Noto Sans, Metropolis in Regular, Bold, and Italic variants)
* **Opacity**, **Rotation**
* **Move X / Move Y** — offset the label from its coordinate
* **Outline Color**, **Outline Width**, **Outline Blur** — adds a halo around the text for legibility

**Interactivity — Hover Effects** <sup>Pro</sup>

* When icon is enabled: set a **Hover Icon Opacity**.

## Lines

**Appearance**

* **Color** — stroke color
* **Width** — stroke width in pixels
* **Opacity** — transparency (0–100%)

**Line Styling**

* **Dashed Line** — when enabled, set a **Dash Length** and **Gap Length** in pixels to create a dashed or dotted stroke <sup>Mapbox/MapLibre only</sup>

**Interactivity — Hover Effects** <sup>Pro</sup>

* Set a **Hover Color**, **Hover Width**, and **Hover Opacity**.

## Polygons (Flat)

**Appearance**

* **Color** — fill color
* **Opacity** — fill transparency (0–100%)

**Polygon Styling**

* **Outline Color** — stroke color around the polygon boundary

**Interactivity — Hover Effects** <sup>Pro</sup>

* Set a **Hover Color**, **Hover Opacity**, and **Hover Outline Color**.

## Polygons (3D) <sup>Pro, Mapbox/MapLibre only</sup>

3D polygons are extruded shapes, like building footprints raised off the map surface.

**Appearance**

* **Color** — fill color
* **Base Height** — the height at which the extrusion starts (for floating shapes)
* **Top Height** — the total height of the extrusion

**Interactivity — Hover Effects**

* Set a separate **Hover Color**, **Base Height**, and **Top Height** on hover.

## Image Polygons <sup>Pro, Mapbox/MapLibre only</sup>

Fill a polygon with an image instead of a solid color.

**Appearance**

* **Image** — select an image from your media library to use as the fill

## Pattern Polygons <sup>Pro, Mapbox/MapLibre only</sup>

Fill a polygon with a repeating tiled image instead of a solid color — useful for textured or hatched area styles.

**Appearance**

* **Pattern** — select an image from your media library to tile across the polygon

## Clustering

Clustering groups nearby point features into a single bubble when zoomed out, reducing visual clutter. Access clustering settings by clicking **Manage Clustering** in the left panel.

**Enable Clustering** — turns clustering on or off for the map.

**Cluster Types** — choose which feature types participate in clustering. Any combination of Markers, Circles, Labels & Icons, Polygons, and Lines can be clustered.

**Image** <sup>Pro, Mapbox/MapLibre only</sup> — optionally replace the default circle clusters with a custom image from your media library.

### Behavior <sup>Pro, Mapbox/MapLibre only</sup>

* **Cluster by Category** — when enabled, each Mapster category gets its own cluster, so features from different categories stay separate even when overlapping. Set the **Included Categories** to control which categories participate.
* **Show Category Name** — displays the category name on the cluster bubble.

### Colors <sup>Pro</sup>

When not clustering by category, set colors independently for **Small**, **Medium**, and **Large** cluster sizes. Each size has:

* **Cluster Color** — the bubble fill
* **Border Color** — the ring around the bubble
* **Font Color** — the count number

When clustering by category, you can enable **Category Colors** <sup>Mapbox/MapLibre only</sup> to assign a distinct color to each category's clusters. When category colors are active, the size-based color settings above don't apply.

### Sizes <sup>Pro</sup>

Set **Radius** and **Border Width** independently for Small, Medium, and Large clusters. Size options are not available when clustering by category.


# Popups

Add popups to your map features and customize their content and design.

Popups are information panels that appear when a user interacts with a feature on your map. The system has two parts that work together:

* **Popup Templates** — reusable design layouts you create once and assign to features. These control the visual structure (colors, layout, which elements appear).
* **Popup Content** — the actual text, images, and settings you enter per feature.

## Enabling a Popup

Select any feature in the Mapmaker. In the right panel, open the **Interactivity** section. Turn on **Popup Enabled** to activate the popup for that feature.

Once enabled, choose how it opens:

* **Open on Click** — the popup appears when the user clicks the feature
* **Open on Hover** — the popup appears when the cursor moves over the feature. You can also enable **Keep popup open when hovering** to prevent it from closing when the cursor moves away.

### Direct Link Instead of Popup

If you'd rather have a click on the feature navigate directly to a URL instead of opening a popup, enable **Link on Marker Click** and enter the destination URL. You can choose whether it opens in the same tab or a new one.

## Setting Popup Content

With the popup enabled, an additional **Popup** section appears in the right panel. This is where you set the content for this specific feature.

### Design

Click **Select Design** to choose a Popup Template. A modal will open showing previews of all your existing templates — click **Use Popup Template** to apply one, or click **Add New** to create a new template (this opens the Popup Templates editor in a new tab).

> **Note:** A popup must have a template selected to display. If no template is selected, the popup won't appear even when enabled.

### Content Fields

* **Header Text** — the popup's title. Appears in whatever position the template designates for a header.
* **Body** — a rich text / HTML editor for the main popup content. Supports full HTML.
* **Button Text** — the label for the popup's call-to-action button.
* **Render Shortcodes** <sup>Pro</sup> — when enabled, WordPress shortcodes in the body content will be processed server-side and rendered. This may slightly increase load time.

### Media

Switch between **Featured Image** and **Gallery** tabs to add images to the popup. Featured Image is a single image; Gallery is a set of images displayed as a carousel.

### Dynamic Content <sup>Pro</sup>

You can use feature property values in your popup text using curly brace syntax. This works in the Header, Body, and Button Text fields.

For properties created using the built-in meta field creator, use curly brace syntax as follows:

```
This location's category is {category}.
The elevation is {elevation} meters.
```

The property name inside the braces must match a custom property on the feature. Properties are visible and editable on any feature in the classic editor under "Custom Properties".

If you use ACF to manage your custom fields, you can use a special syntax for ACF using the field ID shown in ACF.

```
This location's category is {acf.field_randomstring}.
The elevation is {acf.field_name} meters.
```

You can find these field IDs in your ACF interface as below.

<figure><img src="/files/KDbD5Ca1iAVFLmbx3AJb" alt=""><figcaption></figcaption></figure>

## Popup Options

In the bottom section of the Popup panel:

* **Open on Load** — the popup opens automatically when the page loads, without the user needing to click. Useful for drawing attention to a featured location.
* **Always Open** <sup>Pro</sup> — when combined with Open on Load, keeps the popup permanently visible. It cannot be closed by the user.

**Button Click** — controls what happens when the button in the popup is pressed:

* **To Feature Post** — navigates to the feature's WordPress post page
* **To URL** — navigates to a custom URL you specify
* **Open modal** <sup>Pro</sup> — opens a larger modal overlay with additional content (see below)
* **Open Google Directions** — opens Google Maps directions to the feature's coordinates
* **Do nothing** — the button appears but takes no action (useful for display-only purposes)

For To Feature Post, To URL, and Open Google Directions, you can enable **Open in New Tab**.

### Modal Content <sup>Pro</sup>

If you choose **Open modal** for the button action, a WYSIWYG editor appears where you can enter the modal's content. This is a good place for additional detail, images, or embedded shortcodes that won't fit neatly in the popup itself.

## Sidebar Display

If you've enabled **Show popups in sidebar** in [Map Settings → Interactivity](/mapster-wp-maps-v2/the-mapmaker/map-settings#interactivity), popup content will appear in a sidebar panel beside the map rather than floating over it. All the content and options above work the same way.

## Popup Templates

Popup Templates are created and managed as their own post type in WordPress, under **Maps > Popup Templates** in your admin menu. Each template defines the visual layout — which elements appear, in what order, and how they're styled.

You can create a new template from the Popup Templates list, or jump directly from the **Select Design** modal inside the Mapmaker. The plugin comes with several ready-made templates to get you started.

<figure><img src="/files/67HW0eqJ83rOwTdMCKZN" alt=""><figcaption></figcaption></figure>

For full details on building and customizing popup templates, see the [Popup Templates documentation](https://github.com/mapstertech/mapster-wp-maps-docs/tree/main/v1/popups/popup-templates/introduction.md).

> **Note:** Popup template creation and editing is currently managed outside the Mapmaker, in the classic WordPress editor. This is being updated — a native template editor inside the Mapmaker is planned for a future release.


# Controls

Add search, navigation, and utility tools to your map.

Controls are the interactive tools layered on top of your map — search boxes, zoom buttons, filters, download links, and more. Add and configure them from the **Controls** section of the left panel, under **Tools & Controls**. Click any control in the list to open its settings in the right panel; a checkmark shows which ones are currently enabled.

> **Looking for the attribution text or provider logo?** Those live in [Map Settings](/mapster-wp-maps-v2/the-mapmaker/map-settings#attribution--logo), not here.

Almost every control has a **Tool Position** setting that places it in one of the map's four corners (Top Right, Top Left, Bottom Right, Bottom Left) — this is called out once here rather than repeated for each control below.

Some controls and options are limited to specific map providers or require Mapster Pro. Where that's the case, it's marked with a tag like <sup>Pro</sup> or <sup>Mapbox only</sup>. The Mapmaker interface shows the same information live as a small badge next to the relevant field.

## Search & Discovery

Five controls help visitors find and filter features, and they overlap in purpose. The quick distinction:

* **Address Search** — looks up a real-world address, independent of your map's features.
* **Custom Search** — searches your own feature titles and popup content (optionally blended with address search).
* **Filterable List** — a minimal dropdown of every feature; pick one to zoom to it.
* **Map Items List** — a full list or sidebar of features, with sorting, images, category grouping, and a Store Locator mode.
* **Category Filter** — shows or hides groups of features by category. It doesn't list or search individual features.

### Address Search <sup>Mapbox, Google Maps</sup>

Adds a search box that lets visitors look up real-world addresses and zoom to them. On Mapbox, this requires a Mapbox access token configured for your map. On Google Maps, it uses Google's own Places Autocomplete and needs no extra token. Not available on MapLibre.

* **Tool Position**
* **Default Text** — placeholder shown in the search input before the user types.
* **Accept Coordinates** <sup>Pro, Mapbox only</sup> — lets users type a longitude/latitude pair directly to jump to that point.
* **Limit by Area** <sup>Mapbox only</sup> — restricts results to a bounding box you define with NE/SW corner coordinates.
* **Limit by Country** — restricts results to one or more countries, picked from a country list (ISO 3166-1 alpha-2 codes under the hood).

### Custom Search

Gives visitors a search box that searches through your feature titles and popup text, returning clickable results that zoom to the matched feature.

* **Tool Position**
* **Search Type** — Exact Match (the default) finds the exact phrase. Any Terms and All Terms <sup>Pro</sup> match on individual words instead.
* **Number of Results** <sup>Pro</sup> — maximum results shown in the dropdown.
* **Include Address Search** — merges real-world address lookup into the same box; your own features always appear first in the results.
* **Limit by Countries** <sup>Mapbox, Google Maps</sup> — restricts the address-search portion to selected countries. Only applies when Include Address Search is on.
* **Render in External Container** <sup>Pro</sup> — renders the search box into a `<div>` elsewhere on your page instead of on the map.

You can also embed this search box on its own, anywhere on your site, using the shortcode shown in the control's settings panel: `[mapster_custom_search id="..." to_url="..."]`.

### Filterable List

A simple dropdown listing every feature on the map. Visitors click any entry to zoom to it. Best for maps with a small to moderate number of features — for something more full-featured, use Map Items List below.

* **Tool Position**
* **Default Text** — placeholder shown before the user interacts with the dropdown.
* **Display Images** <sup>Pro</sup> — shows each feature's popup featured image beside its title in the list.

### Map Items List

A feature list displayed alongside the map, with more structure than Filterable List: sorting, pagination, images, and category grouping.

* **Tool Position**
* **Layout Type** — Scrollable shows every result in one continuous list; Paginate breaks results into pages.
* **Order** <sup>Pro</sup> — sort by title, slug, ID, or menu order (each ascending or descending), in addition to the default order.
* **Display Images** <sup>Pro</sup> — shows each feature's popup featured image above its title.
* **Group by Category** <sup>Pro</sup> — nests items under collapsible category headings.
* **Sort by Distance** — sorts features by distance from the current map center, recalculating as the user pans.
* **Show Distance** — displays each feature's distance from the map center, in the **Units** you choose (Imperial or Metric).
* **Render in External Container** — renders the list into a `<div>` elsewhere on your page instead of on the map.

**Store Locator** <sup>Pro</sup> turns the list into a business-directory interface — each entry expands into a detail view with address, phone, hours, website, social links, and a "Get Directions" link.

* **Store Locator Enabled** — turns the mode on. You'll also need to fill in the store fields (address, phone, hours, socials, custom button) on each feature's own WordPress post — this data isn't entered in the Mapmaker itself. See the [Store Locator](https://github.com/mapstertech/mapster-wp-maps-docs/tree/main/v1/maps/lists/store-locator.md) guide for a walkthrough of setting up those fields.
* **Order Hours Using Current Day** — rotates the weekly hours list so today appears first, labeled "Today"/"Tomorrow" instead of always starting from Sunday.

<figure><img src="/files/FGRLc8cKsPtKUoZaftCq" alt=""><figcaption><p>Store Locator list view.</p></figcaption></figure>

<figure><img src="/files/lt43Uqzs6fq07iC4Otdb" alt=""><figcaption><p>Store Locator detail view, opened by clicking an item in the list.</p></figcaption></figure>

### Category Filter

Adds a toggleable list of your feature categories so visitors can show or hide groups of features on the map.

**Display**

* **Tool Position**
* **Toggle Display** — show each category as a switch or a checkbox.
* **Badge Display** — show a color swatch, an icon, or nothing beside each category label.
* **Show Parent Categories** <sup>Pro</sup> — when off, a parent category's own toggle is hidden and only its children remain interactive; the parent still displays as a group label.
* **Show Number of Features** <sup>Pro</sup> — appends the count of matching features to each category label.
* **Children Toggle Independent from Parent** <sup>Pro</sup> — when off (default), checking or unchecking a parent cascades to its children. When on, children toggle independently of their parent's state.
* **Accordion Layout** <sup>Pro</sup> — collapses parent categories into expandable rows, useful when you have many categories.
* **Add Reset Button** <sup>Pro</sup> — adds a button that restores every toggle to its initial state.
* **Render in External Container** <sup>Pro</sup> — renders the filter into a `<div>` elsewhere on your page instead of on the map.

**Behavior**

* **Toggle Functionality** <sup>Pro</sup> — for features assigned to more than one category: **Inclusive** (default) keeps a feature visible as long as at least one of its categories is still checked. **Exclusive** hides a feature the moment any one of its categories is unchecked.
* **Excluded Categories** <sup>Pro</sup> — hides specific categories from the filter list entirely (their features are unaffected — they just can't be toggled from this control).
* **Additional Filters** <sup>Pro</sup> — adds extra filter checkboxes driven by custom or ACF properties on your features, alongside the category tree.

> **Note:** Which categories are checked by default, and the display order of categories, aren't yet editable from the Mapmaker. Configure Initial Visibility, Preselected Categories, and Category Order from the classic editor's Filters section for now — see the [Category Filter](https://github.com/mapstertech/mapster-wp-maps-docs/tree/main/v1/maps/filters/category-filter.md) guide.

\[SCREENSHOT: Category Filter settings panel in the Mapmaker, showing the Display and Behavior accordions]

## Navigation & View

### Zoom

Adds zoom in/out buttons. On Mapbox and MapLibre this also includes a compass that snaps the map back to north when clicked. On Google Maps it's Google's own native zoom control. Enabled by default. Only setting: **Tool Position**.

### Scale

Adds a small translucent scale bar showing real-world distance at the current zoom level. Only setting: **Tool Position**.

### Fullscreen

Adds a button that expands the map to fill the browser window. Only setting: **Tool Position**.

### User Location

Displays the visitor's position on the map using the browser's Geolocation API — the browser will prompt for permission. This control requires HTTPS.

* **Tool Position**
* **Set User Location on Load** <sup>Pro</sup> — automatically triggers geolocation as soon as the map loads, instead of waiting for a click.
* **Follow User Movement** <sup>Pro</sup> — keeps the map centered on the user as their position updates, rather than a one-time locate.
* **Show User Direction** <sup>Pro</sup> — shows a heading indicator using device compass data (most effective on mobile). Turning this on also enables movement tracking.
* **Enable High Accuracy** <sup>Pro</sup> — requests GPS-level precision from the device. Slower to acquire and uses more battery.
* **Show Accuracy Circle** <sup>Pro</sup> — draws a circle around the user's position representing the margin of error.

These five options currently take effect on Mapbox and MapLibre only. On Google Maps, this tool is a simple locate-and-center button regardless of these settings.

### 3D Toggle <sup>Mapbox, MapLibre only</sup>

Adds a button that toggles the map between a flat top-down view and an angled 3D perspective — useful for making 3D polygons or 3D terrain visible. Only setting: **Tool Position**.

### Map Type <sup>Google Maps only</sup>

Adds Google's native control for switching between roadmap and satellite views. Only setting: **Tool Position**.

### Street View <sup>Google Maps only</sup>

Adds the Street View "pegman" that visitors can drag onto the map to drop into street-level imagery. Only setting: **Tool Position**.

## Map Style & Layers

### Map Style Toggle <sup>Pro, Mapbox/MapLibre only</sup>

Adds a panel where visitors can switch between multiple map styles you define.

* **Tool Position**
* **Default Style Label** — the label shown for your map's own starting style in the list.
* **Styles** — an ordered, add/remove list of entries, each with a **Style Title** and either a **Style URL** (a Mapbox/MapLibre style URL) or pasted **Style JSON**. Remove line breaks from any pasted JSON first.

<figure><img src="/files/N7ezgdhB0iVfeDnjcjex" alt=""><figcaption><p>Map Style Toggle on the live map.</p></figcaption></figure>

### Map Layers Toggle <sup>Pro, Mapbox/MapLibre only</sup>

Adds a panel where visitors can show or hide named layers from your Mapbox Studio style or custom style JSON.

* **Tool Position**
* **Checkbox Type** — Checkbox or Switch allow multiple layer groups on at once; Radio allows only one at a time.
* **Layer Groups** — an add/remove list of groups. Each group has a **Layer Group Title** (the label shown to visitors) and its own list of **Layer ID** rows — one row per style layer to toggle together. Layer IDs must exactly match the layer names in your style; if any layer in a group can't be found, that group's toggle won't appear at all.

<figure><img src="/files/tpFPKysaRW19hsPEGER8" alt=""><figcaption><p>Map Layers Toggle on the live map.</p></figcaption></figure>

## Data & Output

### Data Downloader <sup>Pro</sup>

Adds a button that lets visitors download the currently visible map features as a CSV file.

* **Tool Position**
* **Apply Filters to Download** — when on, features currently hidden by an active Category Filter are excluded from the download.
* **Notify Admins of Download** — sends an email to selected WordPress users whenever a download occurs, including which category filters were active at the time.
* **Included Columns in CSV** — an allow-list of column names to include; leave empty to include every column. Do a full download first to see the exact field names available, then enter the ones you want here.

### Print <sup>Pro, Mapbox/MapLibre only</sup>

Adds a button that exports the current map view as a PNG image of the on-screen map canvas. Only setting: **Tool Position**.

### Custom HTML <sup>Pro, Mapbox/MapLibre only</sup>

Places a box of fully custom HTML on the map — useful for a legend, a custom filter, or a decorative panel.

* **Tool Position**
* **Edit Custom HTML** — opens a code editor to write your HTML. Include a `<style>` tag for CSS; the content is inserted directly into the map container.

\[SCREENSHOT: Custom HTML control's code editor modal in the Mapmaker]

### Directions <sup>Mapbox only</sup>

Adds a routing interface where visitors enter a start and end point to get turn-by-turn directions. Requires a Mapbox access token; not available on MapLibre or Google Maps.

* **Tool Position**
* **Default Text** — placeholder text for the starting-location input.
* **Directions Type** — Driving Traffic, Driving, Walking, or Cycling.
* **Units** — Imperial (miles) or Metric (kilometres).

### Elevation <sup>Pro, Mapbox only</sup>

Displays a chart of elevation change along a Line feature's path. Hovering the chart tracks the corresponding point on the map with a marker. Only works with Line features — points and polygons are ignored.

* **Tool Position**
* **Open on Load** — automatically shows the chart when the map loads, instead of waiting for a click. Only takes effect when Single Line Only is also on.
* **Single Line Only** — when on, the chart always profiles the first line feature on the map. When off, visitors click any line to generate its chart, switching between lines.
* **Profile Color** — the color of the chart line.
* **Show Line Length** — adds a distance scale to the chart's horizontal axis.
* **Units** — Metric (meters/km) or Imperial (feet/miles).

<figure><img src="/files/3Ip87V6EZj6Uz2VKHzaG" alt=""><figcaption><p>Elevation chart open on the live map.</p></figcaption></figure>

## Not Yet in the Mapmaker

Grouping several controls into a single toggleable menu, and manually reordering how overlapping controls stack in a corner, are older Pro capabilities that aren't available in the Mapmaker interface yet. See [Control Menu](https://github.com/mapstertech/mapster-wp-maps-docs/tree/main/v1/maps/controls/togglers.md#control-menu) and [Control Render Order](https://github.com/mapstertech/mapster-wp-maps-docs/tree/main/v1/maps/controls/control-render-order.md) for how to set these up from the classic editor in the meantime.


# Shortcodes & Embedding

Display your maps anywhere in WordPress using the map block or shortcode.

Once you've built a map in the Mapmaker, there are a few ways to embed it in your WordPress site.

## Gutenberg Block

If you're using the WordPress block editor, search for the **Map Select** block. Choose a map from the dropdown and it will be inserted and rendered automatically — no shortcode needed.

<figure><img src="/files/8RRGFNI9RrSeDOeqd5ks" alt=""><figcaption></figcaption></figure>

## Shortcode

You can find the shortcode for any map on the **Maps list page** in your WordPress admin. It appears on the right side of each row, near the creation date. Copy and paste it into any post, page, widget, or template that accepts shortcodes.

The shortcode is `[mapster_wp_map]` with the following parameters:

### `id`

The WordPress ID of the map to display. This is the only required parameter.

```
[mapster_wp_map id="42"]
```

### `zoom`

Overrides the starting zoom level set in the map's settings.

```
[mapster_wp_map id="42" zoom="10"]
```

### `latitude` / `longitude`

Override the starting center coordinates set in the map's settings.

```
[mapster_wp_map id="42" latitude="40.7128" longitude="-74.0060"]
```

### `single_feature_id`

Displays a single feature (Location, Line, or Polygon) using the specified map as a base template, but without any of the map's other features. Use the WordPress ID of the feature.

```
[mapster_wp_map id="42" single_feature_id="87"]
```

### `feature_ids`

Similar to `single_feature_id`, but accepts multiple feature IDs separated by commas. Only those features will be loaded onto the map.

```
[mapster_wp_map id="42" feature_ids="87,91,104"]
```

## Map Post Page

Every map also has its own WordPress post page. Visiting that URL will display the map directly — no shortcode needed. This can be useful for linking to a standalone map page.


# Plugin Settings

Configure global plugin settings including API keys, permalinks, and public access.

Global plugin settings are found under **Maps → Settings** in your WordPress admin menu. These apply across all maps and features in the plugin.

<figure><img src="/files/KqoOj3TcwxSMD3wMPHL4" alt=""><figcaption></figcaption></figure>

## API Keys

### Default Access Token

Your default Mapbox access token. When you create a new map, this token is pre-filled automatically so you don't have to enter it each time.

### Google Maps API Key

Required if you want to use Google Maps as your map library. Enter your API key here and it will be available across all maps configured to use Google Maps.

## Editor

### Gutenberg Editor

Controls whether the Gutenberg block editor is used when editing Maps, Locations, Lines, and Polygons. Disable this to fall back to the classic editor for those post types.

## Public Pages

By default, WordPress may expose direct URLs for each of Mapster's post types (Locations, Lines, Polygons, etc.). If you don't want visitors to be able to access these posts directly, you can disable public access for each post type here.

## Permalinks

Set custom permalink slugs for Mapster's post types. By default, URLs use the plugin's internal slugs (e.g. `mapster-wp-location`). Customizing these improves SEO and makes URLs more user-friendly.

After changing permalinks, save your WordPress permalink settings (**Settings → Permalinks**) to flush the rewrite rules.

## Account Management

Click **Account Management** in the top right of the settings page to open the Freemius account panel. This is where you manage the commercial side of the plugin:

* **Account** — update your name and email. Use **Sync** if your license key isn't connecting correctly. You can also manually enter your **license key** here.
* **Billing** — enter billing details for invoice purposes.
* **Payments** — view your past payments.

If you have trouble activating or managing your license, [contact support](https://mapsterwp.com/contact).


# SDK Overview

How to hook into Mapster WP Maps V2 as a developer.

Mapster WP Maps V2 exposes a JavaScript SDK that lets you interact with maps on the page — subscribing to lifecycle events, reacting to user interactions, and accessing the underlying map library object to make your own modifications.

## The `mwm_v2` Global

When the plugin loads on a page, it immediately creates a global object:

```js
window.mwm_v2
```

This is your entry point as a developer. It has one method you'll use directly:

```js
window.mwm_v2.onload(fn)
```

`onload` registers a function to be called once the SDK is ready to accept event subscriptions for each map instance. Code placed inside `onload` is guaranteed to run before any map events fire, so your listeners will catch everything from the beginning.

## Subscribing to Events

Inside your `onload` callback, use `mwm_v2.add_action` to subscribe to events:

```js
window.mwm_v2.onload(() => {
  window.mwm_v2.add_action('map:loaded', ({ map, config, features, markers, controls }) => {
    // the map is initialized — do something with it
    console.log(map);
  });
});
```

Every event handler receives the same object:

| Property   | Description                                                               |
| ---------- | ------------------------------------------------------------------------- |
| `map`      | The underlying map library instance (MapLibre, Mapbox GL, or Google Maps) |
| `config`   | The map's configuration object                                            |
| `features` | Array of feature data loaded onto the map                                 |
| `markers`  | Marker instances currently on the map                                     |
| `controls` | Control instances currently on the map                                    |

See [Events Reference](/mapster-wp-maps-v2/developer/events-reference) for the full list of available events.

## Targeting a Specific Map

On pages with multiple maps, your `onload` callback runs once per map instance. Use `config.id` inside your handler to filter to the map you want:

```js
window.mwm_v2.onload(() => {
  window.mwm_v2.add_action('map:loaded', ({ map, config }) => {
    if (config.id !== 42) return;
    // only runs for map with WordPress ID 42
  });
});
```

## Custom Scripts

The Custom Scripts feature works the same as in V1. In the map's settings, enter the name of a global function. That function will be called automatically after the map loads, receiving `map` and `features` as arguments:

```js
window.myCustomFunction = function(map, features) {
  console.log(map, features);
}
```

This is a simpler alternative to `onload` when you only need to target one specific map and don't need to subscribe to multiple events.

## Accessing the Map Library

The `map` object passed to your handlers is the raw instance from whichever library the map is using — MapLibre GL JS, Mapbox GL JS, or the Google Maps API. You can call any method available in that library directly on it:

```js
window.mwm_v2.onload(() => {
  window.mwm_v2.add_action('map:loaded', ({ map }) => {
    map.flyTo({ center: [-74.006, 40.7128], zoom: 12 });
  });
});
```

Refer to the relevant library's documentation for available methods.

## Layer Names

If you're using MapLibre GL JS or Mapbox GL JS, feature types are rendered as layers (and sources of the same name) directly on the `map` object. You can target these with native methods like `map.setPaintProperty()`, `map.on('click', layerName, ...)`, or `map.getLayer()`.

| Feature Type    | Layer / Source Name          |
| --------------- | ---------------------------- |
| Circle          | `mapster-circles`            |
| Symbol          | `mapster-symbols`            |
| Line            | `mapster-lines`              |
| Polygon (Flat)  | `mapster-polygons`           |
| Polygon (3D)    | `mapster-extrusion-polygons` |
| Pattern Polygon | `mapster-pattern-polygons`   |

Markers aren't a map layer — they're rendered as individual library `Marker` instances (available via the `markers` property) rather than a GeoJSON layer.

Image Polygons are added one layer per feature rather than a single shared layer, named `fill-image-{featureId}-layer` (source: `fill-image-{featureId}`), where `featureId` is the feature's Mapster ID.

If clustering is enabled for a feature type, its layer name gets a `-cluster` suffix (e.g. `mapster-circles-cluster`), or `-{categoryID}-cluster` when clustering by category.

This is not part of the public API and may change between versions — treat direct layer manipulation as an advanced/unsupported technique.


# MapInstance API

Public methods and properties on the MapInstance object.

Each map on the page is represented by a `MapInstance`. In normal usage you access the instance indirectly through `mwm_v2.add_action` and the properties passed to your event handlers. The properties and methods below are the public-facing API.

## Properties (via event handler)

These are available inside any event handler callback as `{ map, config, features, markers, controls }`:

| Property   | Type   | Description                                                                                                                       |
| ---------- | ------ | --------------------------------------------------------------------------------------------------------------------------------- |
| `map`      | Object | The underlying map library instance (MapLibre GL JS, Mapbox GL JS, or Google Maps). Call native library methods directly on this. |
| `config`   | Object | The map's full configuration. Includes `config.id` (WordPress post ID of the map) and all settings.                               |
| `features` | Array  | Feature objects loaded onto the map (locations, lines, polygons).                                                                 |
| `markers`  | Array  | Marker instances currently rendered on the map.                                                                                   |
| `controls` | Object | Control instances keyed by control name (e.g. `controls.geocoder`, `controls.zoom`).                                              |

## Methods

### `showLayers()`

Shows all feature layers on the map after they've been hidden with `hideLayers()`.

### `hideLayers()`

Hides all feature layers on the map. The map base style remains visible.

### `updateFeatures(features)`

Replaces the map's current features with a new array. The map re-renders without reinitializing. Useful for dynamically loading or filtering features from your own data source.

### `updateConfig(config)`

Updates the map configuration at runtime. The SDK diffs the incoming config against the current one and emits only the events needed to apply the relevant changes — so updating a single control won't trigger a full re-render.

### `remove()`

Tears down the map instance and empties its container element. The instance is no longer usable after this is called.


# Events Reference

All events available via mwm\_v2.add\_action in Mapster WP Maps V2.

All events are subscribed to via `mwm_v2.add_action` inside an `mwm_v2.onload` callback. Every handler receives the same object: `{ map, config, features, markers, controls }`.

See [SDK Overview](/mapster-wp-maps-v2/developer/sdk-overview) for usage details.

## Lifecycle Events

These fire in order as the map initializes. Subscribe to whichever stage you need.

| Event               | Description                                                                              |
| ------------------- | ---------------------------------------------------------------------------------------- |
| `map:loaded`        | The map library has initialized and the map is ready. The `map` object is available.     |
| `style:loaded`      | The map's base style has finished loading.                                               |
| `data:fetched`      | Feature and config data has been fetched from the server.                                |
| `features:loaded`   | Features have been processed and are being added to the map.                             |
| `features:rendered` | All features are visible on the map. This is the safest point to interact with features. |

## Interaction Events

These fire in response to user actions on map features.

| Event               | Description                                                              |
| ------------------- | ------------------------------------------------------------------------ |
| `marker:click`      | A marker feature was clicked.                                            |
| `marker:mouseenter` | The cursor entered a marker feature.                                     |
| `marker:mouseout`   | The cursor left a marker feature.                                        |
| `layer:click`       | A layer feature (circle, line, polygon, symbol) was clicked.             |
| `layer:mousemove`   | The cursor moved over a layer feature.                                   |
| `layer:mouseout`    | The cursor left a layer feature.                                         |
| `popup:open`        | A popup was opened (from any trigger — click or hover, marker or layer). |
| `popup:close`       | A popup was closed.                                                      |
| `modal:open`        | A modal was opened from a popup button action.                           |

## Map State Events

These fire when the map's display or configuration changes at runtime.

| Event             | Description                                |
| ----------------- | ------------------------------------------ |
| `map:resize`      | The map container was resized.             |
| `style:set`       | The map style was changed.                 |
| `terrain:set`     | 3D terrain was enabled or changed.         |
| `globe:set`       | Globe projection was toggled.              |
| `projection:set`  | The flat map projection was changed.       |
| `interaction:set` | Map interactivity was enabled or disabled. |
| `features:update` | Features were updated after initial load.  |
| `controls:update` | All controls were refreshed.               |

## Notes

* Interaction event handlers receive `{ map, config, features, markers, controls }` — the same as all other events. Event-specific data (e.g. which feature was clicked) is not passed through the public API. To get that level of detail, attach listeners directly to the underlying `map` object using the native library API.
* Not all events are guaranteed to fire on every map depending on configuration (e.g. `terrain:set` only fires if 3D terrain is enabled).


# Examples

Practical code examples for common developer use cases.

## Fly to a Location on External Element Click

A common pattern is building a sidebar or list where clicking an item flies the map to the corresponding feature. This example uses location IDs from the WordPress backend to match list items to map features.

```html
<!-- HTML: list items with IDs matching location post IDs -->
<div>
  <p class="map-office" id="map-office-578">Mount Vernon Office</p>
  <p class="map-office" id="map-office-577">Puyallup Office</p>
</div>

<script>
window.mwm_v2.onload(() => {
  window.mwm_v2.add_action('features:rendered', ({ map, features }) => {
    document.querySelectorAll('.map-office').forEach(el => {
      el.addEventListener('click', () => {
        const id = parseInt(el.id.replace('map-office-', ''));
        const feature = features.find(f => f.id === id);
        if (feature) {
          map.flyTo({ center: feature.data.location.coordinates, zoom: 12 });
        }
      });
    });
  });
});
</script>
```

## Run Code Only on a Specific Map

On pages with multiple maps, use `config.id` to target one:

```js
window.mwm_v2.onload(() => {
  window.mwm_v2.add_action('map:loaded', ({ map, config }) => {
    if (config.id !== 42) return;
    // only runs for the map with WordPress ID 42
    map.setZoom(10);
  });
});
```

## Show and Hide Layers on Button Click

```html
<button id="hide-btn">Hide Features</button>
<button id="show-btn">Show Features</button>

<script>
window.mwm_v2.onload(() => {
  window.mwm_v2.add_action('features:rendered', ({ map }) => {
    // Use the native library to toggle layer visibility directly
    document.getElementById('hide-btn').addEventListener('click', () => {
      map.setLayoutProperty('your-layer-id', 'visibility', 'none');
    });
    document.getElementById('show-btn').addEventListener('click', () => {
      map.setLayoutProperty('your-layer-id', 'visibility', 'visible');
    });
  });
});
</script>
```

## Attach a Native Map Event Listener

For interaction detail not available through the `add_action` API (such as which specific feature was clicked), attach listeners directly to the `map` object using the native library's event API:

```js
window.mwm_v2.onload(() => {
  window.mwm_v2.add_action('map:loaded', ({ map }) => {
    // MapLibre / Mapbox GL JS native event
    map.on('click', (e) => {
      const features = map.queryRenderedFeatures(e.point);
      if (features.length > 0) {
        console.log('Clicked feature:', features[0]);
      }
    });
  });
});
```


# Migrating from V1

How to update V1 hook code to work with the V2 event system.

The developer hook system has changed significantly in V2. If you have custom code built on V1 hooks, it will need to be updated. The changes are straightforward once you understand the pattern, but they touch every hook call you've written.

> **You can always revert.** If you need more time to update your custom code, you can roll back to V1 of the plugin while you work through the migration. V1 and V2 are separate plugin versions.

## What Changed

### 1. The global object is now `mwm_v2`

V1 used a global `mwm` object. V2 uses `window.mwm_v2`.

### 2. You must wrap subscriptions in `onload()`

In V1, `mwm.add_action()` could be called anywhere on the page. In V2, `add_action` must be called inside an `mwm_v2.onload()` callback, which ensures your listeners are registered before any events fire:

```js
// V1
mwm.add_action('map_set', (map) => { ... });

// V2
window.mwm_v2.onload(() => {
  window.mwm_v2.add_action('map:loaded', ({ map }) => { ... });
});
```

### 3. Event names use colons instead of underscores

| V1 Hook                          | V2 Event            |
| -------------------------------- | ------------------- |
| `map_set`                        | `map:loaded`        |
| `data_fetched`                   | `data:fetched`      |
| `map_markers_set`                | `features:rendered` |
| `map_features_set`               | `features:rendered` |
| `map_datalayers_set`             | `features:rendered` |
| `loading_icon_done`              | `features:rendered` |
| `set_clustering`                 | `features:rendered` |
| `set_mapstyle`                   | `style:loaded`      |
| `set_terrain`                    | `terrain:set`       |
| `set_interactivity`              | `interaction:set`   |
| `map_resize_set`                 | `map:resize`        |
| `layer_feature_clicked`          | `layer:click`       |
| `layer_feature_hovered`          | `layer:mousemove`   |
| `popup_opened_from_layer_click`  | `popup:open`        |
| `popup_opened_from_layer_hover`  | `popup:open`        |
| `popup_closed_from_layer_hover`  | `popup:close`       |
| `marker_feature_clicked`         | `marker:click`      |
| `marker_feature_hovered`         | `marker:mouseenter` |
| `popup_opened_from_marker_click` | `popup:open`        |
| `popup_opened_from_marker_hover` | `popup:open`        |
| `popup_closed_from_marker_hover` | `marker:mouseout`   |

Some V1 hooks (`access_token_set`, `map_library_set`, `map_size_set`, `set_customscripts`) have no direct equivalent in V2. In most cases `map:loaded` or `features:rendered` is the right replacement.

### 4. Callback arguments have changed

In V1, each hook passed its own specific variable — `map_set` gave you `map`, `data_fetched` gave you `postResponse`, `map_markers_set` gave you `markers`, and so on.

In V2, **every event handler receives the same object**:

```js
{ map, config, features, markers, controls }
```

This means you can no longer rely on hook-specific arguments. Update your callbacks to destructure from this object instead:

```js
// V1
mwm.add_action('data_fetched', (postResponse) => {
  console.log(postResponse.locations);
});

// V2
window.mwm_v2.onload(() => {
  window.mwm_v2.add_action('data:fetched', ({ features }) => {
    console.log(features);
  });
});
```

> **Note on interaction events:** V1 passed the clicked or hovered feature directly to interaction hooks (e.g. `clickedFeature`, `hoveredFeature`). V2 does not pass event-specific data through `add_action`. To access the specific clicked feature, attach a native event listener to the `map` object using the underlying library's API (e.g. `map.on('click', ...)`). See [Examples](/mapster-wp-maps-v2/developer/examples) for a pattern.

### 5. Map targeting works differently

In V1, you could target a specific map by appending its ID to the hook name:

```js
mwm.add_action('map_set/mapster-7314', (map) => { ... });
```

In V2 there is no suffix syntax. Instead, check `config.id` inside the handler:

```js
window.mwm_v2.onload(() => {
  window.mwm_v2.add_action('map:loaded', ({ map, config }) => {
    if (config.id !== 7314) return;
    // only runs for map ID 7314
  });
});
```

## Custom Scripts

The Custom Scripts feature (entering a global function name in the map's settings) is **unchanged**. Your existing custom script functions will work in V2 without modification.

## Full Before/After Example

```js
// V1
let allLocations = [];
mwm.add_action('data_fetched', (postResponse) => {
  allLocations = postResponse.locations;
});
mwm.add_action('map_set', (map) => {
  map.on('load', () => {
    jQuery(document).on('click', '.map-office', function() {
      const id = parseInt(jQuery(this).attr('id').replace('map-office-', ''));
      const loc = allLocations.find(l => l.id === id);
      map.flyTo({ center: loc.data.location.coordinates, zoom: 12 });
    });
  });
});
```

```js
// V2
window.mwm_v2.onload(() => {
  window.mwm_v2.add_action('features:rendered', ({ map, features }) => {
    document.querySelectorAll('.map-office').forEach(el => {
      el.addEventListener('click', () => {
        const id = parseInt(el.id.replace('map-office-', ''));
        const feature = features.find(f => f.id === id);
        if (feature) {
          map.flyTo({ center: feature.data.location.coordinates, zoom: 12 });
        }
      });
    });
  });
});
```

Notice that in V2 you no longer need a separate `data_fetched` hook to cache features — they're available in every handler via `features`. You also no longer need to wait for `map.on('load', ...)` inside `map:loaded`, since subscribing to `features:rendered` already guarantees the map and features are fully ready.


