🗺️
Mapster WP Maps
HomeProExamplesContact
  • Getting Started
    • About
    • Installation
    • Key Concepts
    • Importing/Exporting
    • Guides
      • Your First Map
      • Creating a Crowdsourced Map
      • Set Up Recurring Import
      • Adding a Custom Style
      • Building a Custom Popup
  • Creating Shapes
  • Displaying Maps
  • Maps
    • Map Tiles
    • Initial View
      • Fit to Features
      • Manual Values
      • User Location
    • Map Size
    • Points, Lines, Polygons
    • Clustering
    • Interactivity
    • Controls
      • Basic Controls
      • Geocoding & Geolocation
      • Togglers
      • Other Controls
      • Control Render Order
    • Filters
      • Category Filter
      • Custom Search Filter
      • Filter Dropdown
    • Lists
      • Store Locator
    • Specialty Maps
      • Map Comparer
      • Heatmaps
      • Elevation Profile
      • User Submission
      • Listing Page Map
    • Preloader
    • Developer
      • Javascript
      • Embedding Maps
      • Faster Loading (Cache)
      • Caching
      • Progressive Loading
  • Locations
    • Markers
    • Circles
    • Labels
    • Icons
    • 3D Models
  • Lines
    • Lines
  • Multi Lines
  • Polygons
    • Flat Polygons
    • 3D Polygons
    • Image Polygons
  • Multi Polygons
  • Popups
    • Popup Templates
      • Introduction
      • Layout, Colors, Text, CSS
      • HTML
      • Options
    • Popup Content
  • Pro Sections
    • User Submission
      • Overview
      • Submission Interface
      • Adding Custom Fields
      • Submission Admin
  • Mass Edit
  • Settings
    • General
    • Account Management
  • Advanced
  • Import
  • Tileset Management
  • Developer
    • Mapster Map ACF Field
    • Mapster Map Gravity Forms Field
    • Custom Scripts
    • Hooks
    • Spatial DB & API
    • Internationalization
Powered by GitBook
On this page
  • 3D Control
  • Layer Control [Mapbox, Maplibre, Pro]
  • Style Switcher Control [Mapbox, Maplibre, Pro]
  • Control Menu [Pro]

Was this helpful?

  1. Maps
  2. Controls

Togglers

Controls that enable and disable certain effects on the map.

PreviousGeocoding & GeolocationNextOther Controls

Last updated 4 days ago

Was this helpful?

3D Control

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

Layer Control [Mapbox, Maplibre, Pro]

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. .

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.

Screenshot examples of entering layers into editor

Style Switcher Control [Mapbox, Maplibre, Pro]

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.

Screenshot examples of entering styles into editor

Control Menu [Pro]

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.

This adds an area on the map with a list of styles that you choose that users can toggle between. .

If you are using a Custom JSON, make sure to use a tool like to remove all line breaks from your JSON before pasting it in. A couple examples of this are shown below!

See an example here
https://www.textfixer.com/tools/remove-line-breaks.php
See an example here
Simple Layer Control.
A simple layer control toggling single layers by checkboxes.
A more complex layer control, with some buttons toggling multiple layers.
Simple Style Switcher Control.
A simple Style Switcher using Mapbox Style URLs.
A more complex Style Switcher with custom JSON data.