Laravel Mapcn
Toggle sidebar

Popups

Docs / Popups

Overview

The <x-map-popup> component creates standalone popups anchored to specific coordinates on the map. Unlike marker popups, these are not attached to a marker and can be opened independently.

Basic Usage

With Close Button

Add a close button so users can dismiss the popup:

Close on Move

Automatically close the popup when the user pans or moves the map:

blade
<x-map-popup
    :lat="51.505"
    :lng="-0.09"
    :open="true"
    :close-on-move="true"
>
    <p>I'll close when you move the map!</p>
</x-map-popup>

Props

PropTypeDefaultDescription
:latfloatrequiredLatitude
:lngfloatrequiredLongitude
:openbooltrueInitial visibility
max-widthstring'300px'CSS max-width
:close-buttonboolfalseShow close icon
:close-on-moveboolfalseClose when the map moves