Beautiful Maps - Mapbox
  • Introduction
    • 👋Welcome
    • Key use cases
    • Key features
    • Demo apps
  • Getting Started
    • Registering for a Mapbox account
    • Install the plugin
    • Adding the access token
    • Adding a map to your app
  • Loading a Map
    • Selecting a default location
    • Setting zoom levels
    • Setting a map style
    • Adding controls to a map
  • Loading Markers
    • Structuring your database for markers
    • Adding multiple markers
    • Adding a single marker
    • Adding popups to markers
    • Using custom icons
    • Changing marker on hover
    • Removing markers from a map
    • Trigger an action when marker is clicked
  • Geolocation
    • Show the user's current location
  • Drawing Mode
    • Drawing shapes on a map
    • Saving drawings
    • Loading drawings
  • Route Navigation
    • Adding navigation
Powered by GitBook
On this page
  1. Loading Markers

Removing markers from a map

PreviousChanging marker on hoverNextTrigger an action when marker is clicked

Last updated 3 months ago

The Beautiful Maps - Mapbox plugin comes with two actions for removing markers from a map:

  • Clear Markers A Mapbox Map (removes all markers from the map)

  • Remove Single Marker A Mapbox Map (removes a single marker from the map)

Remove Single Marker

While the 'Clear Markers' action does not require any information, you are required to specify which marker you want to remove for the 'Remove Single Marker' action.

As outlined in the plugin action, you will need to provide a unique ID associated with a marker:

You can assign a Unique ID to a marker that can be referenced later by including it in the 'Unique IDs' field on the 'Add List of Markers' action:

You can also assign a Unique ID to a marker when using the 'Add Single Marker' action: